If so, does this imply the following mapping for the force2Ddimension?
0 == x == axial
1 == y == coronal
2 == z == sagittal
force2Ddimension details
force2Ddimension: 0 # axial slices, for coronal slices, use dimension 1 and for sagittal, dimension 2
Does Pyradiomics automatically reorder axes internally to match SimpleITK’s conventions (x, y, z), or is it the user’s responsibility to ensure the input image has the correct orientation?
I don’t recall exactly what pyradiomics does, but I believe it resamples the segmentation to match the geometry of the source image (or maybe the other way around).
Keep in mind that medical images can be acquired in many different orientations, so you should not make assumptions about the relationship between world space and index space. In Slicer that information is in the ijkToRAS matrix and related ones. See this info: https://slicer.readthedocs.io/en/latest/user_guide/coordinate_systems.html
You’are right! This is exactly why I want to reorient all my images to the same orientation before calling pyradiomics. Please note that I’m calling pyradiomics from the CLI, not via Slicer.
I should have mentioned in my first comment what I meant by axial, coronal, and sagittal, so clarifying it now:
0 == x == axial == Superior-Inferior
1 == y == coronal == Anterior-Posterior
2 == z == sagittal == Right-Left
(source for numbers 0, 1, 2 and planes axial, coronal, saggital; source for x, y, z)
Which effectively translates into SAR (Superior-Anterior-Right) orientation, right?
Just to restate what I said earlier, the 0, 1, 2 and x, y, z in image space that you are referring to do not correspond to any particular world space direction or slicing plane. That mapping is defined by an affine matrix.
You’ll need to study the pyradiomics code, but as I recall it takes care of the resampling for you.
But if you want to make sure all your test data is anatomically aligned, you need to be sure to understand and apply the transformations I’ve described.