Why per-frame transforms stored in .seq.mhd files are not converted from LPS to RAS?

When I load a .seq.mhd file, the IJKtoRAS matrix is unity:
image

I would expect the IJKtoRAS matrix to have -1 and -1 as the first two diagonal values from the top, because .mhd volumes are always in LPS coordinates. This is how non-sequence .mha’s load:
image

ElementSpacing is positive on both of these files.

Seq.mhd file stores per-frame transforms to specify image geometry (origin, spacing, axis directions) for each frame.

If you want to have store a 3D image sequence where all 3D images have the same geometry, which is specified in standard fields then you need to use nrrd file format. We switched to nrrd from mha format because does not have clear definition of image dimensions (which axis means what).

Each frame transform is unity in my .seq.mhd though, so shouldn’t the image data still be treated as LPS?

seq.mhd can store many transforms for each frame, each has a name, so you know exactly what coordinate systems it transforms between. There is no such assumptions like “world coordinate is LPS”, so there is nothing that the reader would need to modify when loading. It is up to you to name and interpret the transforms correctly.

The best the SlicerIGT importer could do is to detect …ToLPS and LPSTo… transforms and convert them to …ToRAS and RASTo… transforms but this would cause more problems than it would solve. If you want to have transforms to/from RAS coordinate system then you can either add them to the file when you create it; or you can add a diag([-1,-1,1,1]) transform in the transform hierarchy in Slicer to convert between LPS and RAS.

Since the patient-attached Reference marker typically does not move relative to the patient, we usually store all transforms relative to the Reference and compute and store ReferenceToRAS in Slicer.