Skip to main content

lbv

Function lbv 

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

LBV background field removal

Solves nabla^2 b = 0 inside mask with b = f on boundary to find background field, then computes local field as l = f - b.

§Arguments

  • field - Total field (nx * ny * nz)
  • mask - Binary mask (nx * ny * nz), 1 = brain, 0 = background
  • grid - Volume dimensions and voxel sizes
  • params - LBV parameters (tolerance, optional max iterations)
  • progress - Progress callback (iteration, max_iter)

§Returns

Tuple of (local_field, eroded_mask)