Import mhd data

Hi, I’m new to 3D Slicer. I’d like to know how the mhd metadata would affect the image rendered in 3D Slicer. To my knowledge, 3D Slicer uses RAS coordinate system. And in mhd file, we can specify AnatomicalOrientation and TransformMatrix to define relation between (i, j, k) and RAS coordinate system. But I’m not so sure about how they interact with each other. My questions include:

(1) Does the TransformationMatrix specify rotation between (i,j,k) and the RAS coordinate?
(2) What’s the effect of different AnatomicalOrientation in 3D Slicer? In an mhd file, I’ve manually switched between LPS, RAI, RAS for the same raw data, but the rendered image, and the IJKtoRAS Direction Matrix remains the same.

Slicer uses ITK image reader to load metaimage files. This reader intentionally ignores AnatomicalOrientation (I’ve raised this question before to ITK developers and Kitware and they confirmed that this is not a bug and they will not change the behavior) and considers the image to be in LPS coordinate system. Slicer converts the image to RAS when it is loaded into the scene, and Slicer converts it back to LPS when it is saved to file.

If you want to specify coordinate system using anatomical axes then you need to use nrrd file format.