SlicerRt / SlicerRT

Open-source toolkit for radiation therapy research, an extension of 3D Slicer. Features include DICOM-RT import/export, dose volume histogram, dose accumulation, external beam planning (TPS), structure comparison and morphology, isodose line/surface generation, etc.
https://slicerrt.org
127 stars 60 forks source link

DICOM Deformable SRO import does not handle grid orientation correctly #151

Closed MLanghof closed 3 years ago

MLanghof commented 4 years ago

The third row in the grid orientation matrix should be determined via a cross product instead of being assumed as a z unit vector: https://github.com/SlicerRt/SlicerRT/blob/master/DicomSroImportExport/Logic/vtkSlicerDicomSroReader.cxx#L549

This is mandated by section C.20.3.1.1 of the DICOM standard:

[ X Y Z ]_Depth = [ X Y Z ]_Row ⨯ [ X Y Z ]_Column

The cross product between the row (X) direction cosine and the column (Y) direction cosine of Image Orientation (Patient) (0020,0037).

Attempting to load any DICOM Deformable SRO where the grid has a rotation along other axes than the z axis using SlicerRT currently produces incorrect results as a consequence.


Example: With direction cosines 1 0 0 0 0 1 in (0020,0037), the full grid orientation matrix must clearly be

1 0 0 
0 0 1
0 -1 0

in order to be right handed and orthogonal. It describes a grid orientation that is rotated by 90° around the x axis. SlicerRT currently produces the grid orientation matrix

1 0 0 
0 0 1
0 0 1

which is a 2D projection, not a 3D rotation.

lassoan commented 3 years ago

Thanks for reporting this, good catch! The implementation was obviously wrong, I guess it was not detected before because most often the grid was aligned to z direction.