pub fn mip_geometry(
grid: &Grid,
affine: &[f64; 16],
window: usize,
) -> Result<(Grid, [f64; 16]), String>Expand description
Geometry of a sliding projection over window slices, without computing one.
Returns the projection’s grid and affine. Use it to size or place a projection ahead of time — to validate a window before doing the work, or to allocate an output file.
The slice axis loses window - 1 slices, since a sliding window of window slices has
nz - window + 1 positions. Each output slice represents the centre of its slab, so the
origin moves (window - 1) / 2 slices along the slice direction. That shift follows the
affine’s third column rather than world z, which keeps it correct for an oblique
acquisition; an even window lands the origin on a half-slice offset, as the convention
implies.
§Errors
If window is zero, or deeper than the volume.