Skip to main content

vsharp

Function vsharp 

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

V-SHARP background field removal

Uses multiple SMV kernel radii, starting from largest and decreasing. At each voxel, uses the smallest radius that doesn’t touch the boundary.

§Arguments

  • field - Unwrapped total field (nx * ny * nz)
  • mask - Binary mask (nx * ny * nz), 1 = inside ROI
  • grid - Volume dimensions and voxel sizes
  • params - V-SHARP parameters (threshold, min/max radius in mm)
  • progress - Progress callback (radius_index, total_radii)

§Returns

(local_field, eroded_mask)