pub fn alignment_to(
affine: &[f64; 16],
target: [AxisCode; 3],
) -> ([usize; 3], [bool; 3])Expand description
The axis permutation and per-axis flips that take a volume into target orientation.
Returns (perm, flip) where target axis i is the source volume’s axis perm[i], reversed
when flip[i]. Feed the pair to reorient; invert_alignment gives the pair that
undoes it.
This resolves only the 48 cardinal flips and permutations, which is all a learned model
needs: it says nothing about obliquity. An oblique acquisition still has to be resampled
(resample_to_axial) — this picks the nearest cardinal relabelling of its axes.