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.
[ 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
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.
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:
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 bein 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
which is a 2D projection, not a 3D rotation.