[vtkusers] Yet another VTK, DICOM and Orientation problem
Jean-Christophe Fillion-Robin
jcfr at kitware.com
Tue Dec 11 11:56:48 EST 2018
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 <romain.leguay at gmail.com>
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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20181211/e19ae568/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic1.png
Type: image/png
Size: 572778 bytes
Desc: not available
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20181211/e19ae568/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic2.png
Type: image/png
Size: 544089 bytes
Desc: not available
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20181211/e19ae568/attachment-0003.png>
More information about the vtkusers
mailing list