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 = backgroundgrid- Volume dimensions and voxel sizesparams- LBV parameters (tolerance, optional max iterations)progress- Progress callback (iteration, max_iter)
§Returns
Tuple of (local_field, eroded_mask)