I’m trying to load a spatial registration into 3D Slicer, and I’ve run into a few questions:
1. Multiple Frames of Reference
Does 3D Slicer support multiple frames of reference in a single registration file? I’ve noticed that when I load a registration containing multiple items in the “Registration Sequence” attribute, only one transform matrix appears. How should multiple transforms be handled?
2. Differences in Sign
When I load a test matrix from a generated file, I see that some signs differ between the matrix values stored in the DICOM file and those displayed in Slicer. What might cause these discrepancies?
3. Matrix Multiplication Order
If multiple matrices are present in the “Matrix Sequence” attribute, the final transform matrix displayed seems to be calculated as (using NumPy notation):
m1 @ m2 @ m3
However, according to Equation C.20.2-2 in the DICOM standard, it appears the multiplication order should be reversed. Could you clarify how Slicer applies these matrices and why the resulting order might differ from the standard?
This is due to the different coordinate systems used to store and display. While information in dicom files is stored in the LPS system, Slicer displays coordinates as RAS, having to flip the signs of the first 2 axes when uploading data from a dice into the software.
A transform node can store a sequence of transforms. But since linear transforms can be combined into a single matrix, we usually use a single transform.
Matrix Multiplication Order
You can find the full implementation here:
If you believe that this implementation is incorrect and you have a DICOM SRO file (created by a clinical software) that Slicer does not seem to load correctly then please submit a bug report to the SlicerRT repository.
I was reviewing the Spatial Registration IOD, specifically the RegistrationSequence tag (0070,0308), which states:
A Sequence of registration Items. Each Item defines a spatial registration of the images referenced in that Item to the Registered RCS established by this SOP Instance. All referenced images are in the same spatial Frame of Reference or atlas. One or more Items shall be included in this Sequence.
If I understand correctly, each registration item may have a different Frame of Reference UID. However, in the snippet you shared, it appears that the matrices from each registration item are multiplied together. This could cause issues when multiple Frames of Reference are involved.
Unfortunately, I don’t have a clinical software DICOM SRO file to share because I am creating one myself and trying to load it.
Regarding the matrix multiplication order, it seems that the first matrices are applied on the outer side, as shown here:
This suggests an order of M1 x M2 x M3, which might conflict with the description provided for the FrameOfReferenceTransformationMatrix in equation C.20.2-2 of the standard. I might be misunderstanding something from the code or the standards—any clarification would be appreciated.
The current implementation was tested with DICOM SRO from a clinical system. Probably it was not tested with multiple frame of references.
Please check for examples at https://portal.imaging.datacommons.cancer.gov/explore/ (you can filter for Modality=Registration) to test Slicer and your implementation. If you want to use some DICOM feature that is not implemented by anyone else then it is tough, as you may need to interpret the standard, implement, and test it on your own and hope that others will interpret and implement it the same way.
If you implement any improvements or fixes in SlicerRT that work well on clinical images then those will be very welcome. I’m not sure if anyone else currently has funding for improving DICOM SRO in SlicerRT - maybe @cpinter knows more.
Thanks for the discussion. As @lassoan says this was implemented several years ago, but was tested with clinical data. The actual driver of the work I think was @gcsharp . I am not aware of any project aiming to improve this part of SlicerRT. Finally there is some activity around SlicerRT, but unfortunately not touching the SRO support (that I am aware of, as of now).