
Convert a dicom_volume Between DICOM LPS and NIfTI RAS World Coordinates
Source: R/dicom-volume.R
to_ras.RdTransforms the 4x4 physical world affine and direction cosines of a
dicom_volume between the DICOM Patient Coordinate System ("LPS":
Left-Posterior-Superior) and the neuroimaging NIfTI standard ("RAS":
Right-Anterior-Superior) via diag(c(-1, -1, 1, 1)) %*% affine.
Value
A dicom_volume object in the target coordinate system ("RAS" for
to_ras(), "LPS" for to_lps()).
Details
Because det(diag(-1, -1, 1)) == +1 (a 180-degree rotation around the
Superior z axis), right-handedness of (d_row, d_col, normal) is strictly
preserved without permuting in-memory voxel indices. Both functions are
idempotent when vol is already in the target coordinate system.