Hi everyone,
I have a Dicom image that is represented in Slicer using the Anatomical coordinate system (RAS namely Right, Anterior and Superior).
I was wondering if it is possible in Slicer to change the reference system moving from the Anatomical coordinate system, to the world reference system, namely XYZ.
To expand on what Steve said, you need to provide a conceptual basis for what you want your final coordinate system to be. X, Y, and Z are just labels.
For example if X, Y, and Z represent world-space coordinates in another software tool like Unity, threejs, or babylonjs, it’s better to think in terms of “up”, “right”, and “front” since toolkits/software often have different mappings of XYZ to those concepts.
A natural mapping of “S” is to “up”, since superior generally refers to “up” on a patient. “A” or anterior is usually “front”. “R”, which is “right” from the patient’s perspective (and left someone looking at the patient from the front) will map to either left or right in your coordinate system.
Once you have the conceptual mapping from RAS to “up”, “front”, and “right” for your destination coordinate system, you can map those concepts whatever XYZ conventions you’d like. You can do this mapping with a change of basis matrix transform, which simply consists of a matrix of unit vectors that transform RAS to whatever XYZ convention you may have. I find that much easier than thinking about the problem as rotations or anything like that.
Also keep in mind that RAS is a right handed coordinate system, and your destination XYZ coordinate system may be left handed. That makes no difference for the change of basis matrix (one of the elements will be negative), but depending on what you’re doing with the data it may impact things like shading.