Re: Yet another VTK, DICOM and Orientation problem
Jean-Christophe Fillion-Robin via vtkusers <[email protected]>
| Newsgroups | gmane.comp.lib.vtk.user |
|---|---|
| Message-ID | <CANLz8R6p_NB61i9E9DO-q4Mp4XoTtYazH1Lojr90X9sXYvPVvA@mail.gmail.com> |
Hi Romain, To learn which rotation matrix would be needed, you could load the dataset into 3d Slicer and inspect the direction cosine in the Volumes module. See https://download.slicer.org/ That said, considering that VTK is orientation-less (there are no direction cosines associated with vtkImageData), building an medical image viewer is a significant amount of work. Also worth noting that there is a proposal to add orientation into vtkImageData but some more validation is needed, see https://www.slicer.org/wiki/Documentation/Labs/VTK-Orientation Hth Jc On Tue, Dec 11, 2018 at 8:12 AM Romain LEGUAY <[email protected]> wrote: > Hello everyone, > > I'm trying to create a viewer of dicom with anatomical views (axial, > sagittal and coronal) from a radiologist point of view. > > As starting point, I use the example provided in vtkDICOM module : > testDicomDisplay > <https://github.com/dgobbi/vtk-dicom/blob/master/Examples/TestDICOMDisplay.cxx> > . > It uses vtkDICOMReader with SetMemoryRowOrderToFileNative activated. > > When I try to display an axial CT scan, I don't obtain expected > orientation as you can see in pic1: the sagittal view is in Posterior -> > Anterior direction. > [image: pic1.png] > > When I try to display a sagittal CT scan, I have different orientations: > [image: pic2.png] > > To fix this orientation problem, I tried to create some transformation > matrices that converts > Patient Coordinates (DICOM) to World Coordinate (VTK coordinates). > > To do this, I follow those steps: > * get the patient matrix (Pm) using the method > vtkDICOMReader::GetPatientMatrix (if I understand correctly, this matrix is > in DICOM space) > * create the rotation (Rm) from DICOM space to VTK space (rotation on VTK > X-axis around the origin point): > 1 0 0 0 > 0 -1 0 0 > 0 0 -1 0 > 0 0 0 1 > * Multiply Pm by Rm to obtain the matrix PRm to go from Patient > Coordinates to VTK Coordinates. > * Use the Matrix PRm with a point in IJK coordinates (voxel coordinates) > multiplied by the spacing. > > I know I made a mistake because I don't have the result expected but I > don't know what I did wrong... > > Can someone provide me some tips please? > > Thank you, > > Romain > > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Search the list archives at: http://markmail.org/search/?q=vtkusers > > Follow this link to subscribe/unsubscribe: > https://public.kitware.com/mailman/listinfo/vtkusers >
pic1.png
(image/png, 559.4 KB) - not displayed
pic2.png
(image/png, 179.9 KB) - not displayed