Skip to main content

msmv

Function msmv 

Source
pub fn msmv(
    field: &[f64],
    mask: &[u8],
    grid: &Grid,
    params: &MsmvParams,
    progress: impl FnMut(usize, usize),
) -> (Vec<f64>, Vec<u8>)
Expand description

mSMV background field removal (SMV primary removal + boundary shadow correction).

§Arguments

  • field — Field in ppm (nx·ny·nz, column-major): the unwrapped total field when params.prefilter is true, or an already-local field (from a primary BFR) when false.
  • mask — Binary brain mask (nx·ny·nz, 1 = inside).
  • grid — Volume dimensions and voxel sizes.
  • params — See MsmvParams.
  • progress — Progress callback (iteration, max_iterations) over the boundary-correction loop.

§Returns

(local_field_ppm, mask) — the filtered local field in ppm restricted to mask, and the mask unchanged (mSMV preserves the brain edge; it does not erode). Same (field, eroded_mask) return shape as the other BFR methods.