I am using the C# implementation for SimpleITK to display MRI data in the Unity game engine and I am running into issues with orientations and IJK to world transform matrices.
My data is a nifti file in RAS coordinates with 1mm isotropic voxels and :
origin = (-127, -96, -110)
direction = identity matrix
dimensions = (256, 256, 208)
From my understanding, when loading an image file in SimpleITK, it converts it to LPS format, meaning that subsequent calls to the
GetDirection functions should be returning these values:
origin = (127, 158, -110)
direction = (-1, 0, 0; 0, -1, 0; 0, 0, 1)
However I am getting a different origin value of (127, 96, 110).
I confirmed the LPS orientation values by converting the original RAS scan into LPS and I am getting the proper numbers in 3DSlicer. But when I load the corrected LPS scan into SimpleITK I get yet again different values :
origin = (-127, -158, -110)
direction = (1, 0, 0; 0, 1, 0; 0, 0, 1)
I get the feeling that SimpleITK is just inverting the x and y origin/direction values regardless of the initial orientation. Am I missing something? I don’t know if this is expected behavior and how I should correct for it.
Thank you for your help!