Skip to main content

gibbs_unring_masked

Function gibbs_unring_masked 

Source
pub fn gibbs_unring_masked(
    data: &[f64],
    dims: (usize, usize, usize),
    n_vols: usize,
    mask: &[u8],
    margin: usize,
) -> Vec<f64>
Expand description

Gibbs-unring multi-volume data within a mask bounding box (fast path).

Only the axis-aligned bounding box of mask, expanded by margin voxels, is unrung; voxels outside are copied through unchanged. This skips air/background lines and shrinks the per-line FFT length, which is much faster on data where the region of interest fills a fraction of the FOV.

Because the FFT is taken over the cropped extent rather than the full FOV, the result differs slightly from gibbs_unring near the crop border, but with a sufficient margin the interior of the mask is essentially identical (the ringing there is driven by edges inside the box). Intended for relaxometry where downstream fitting is masked to the brain anyway.

§Arguments

  • data - Interleaved (n_voxels, n_vols), same layout as gibbs_unring.
  • dims - Volume dimensions (nx, ny, nz).
  • n_vols - Number of volumes.
  • mask - Binary mask [nx*ny*nz]; the bounding box of mask != 0 is unrung.
  • margin - Voxels to expand the bounding box on every side.