For the TransformMatrix / Orientation / Rotation tags - which are storing the image rotation in the MetaIO (MHD/MHA) format - the actual serialization convention (row-major vs. column major) does not seem to be documented anywhere (at least I could not really find anything beyond https://itk.org/Wiki/ITK/MetaIO/Documentation#Associated_transformations).
As far as I could see from MetaIO/metaObject.cxx at 5e87f062ea796204b84fc3e5e9100cd3ead2e015 · Kitware/MetaIO · GitHub and MetaIO/metaObject.cxx at 5e87f062ea796204b84fc3e5e9100cd3ead2e015 · Kitware/MetaIO · GitHub the reference implementation seems to store it row-major (assuming that
_i refer to rows and
_j to columns respectively in
TransformMatrix(int _i, int _j).
On the other hand, experiments with a mesh and an associated image (TransformMatrix = 0 0 1 1 0 0 0 1 0 - i.e. not invariant to transposition) in 3D Slicer suggest that the orientation is actually stored / interpreted as a column-major.
Finally, I actually wanted to do the same experiment with ParaView, which unfortunately seems to completely ignore the image orientation.
Would anyone be able to confirm what is the standard convention and where this is documented? I did find 22_Transforms saying that “Matrices are represented by vector-like data types in row major order” but I am unsure whether this applies for the MetaIO/MHD/MHA file format or is only internal to SimpleITK? I guess this should be highly relevant for registration topics, no?