Skip to main content

sharp

Function sharp 

Source
pub fn sharp(
    field: &[f64],
    mask: &[u8],
    grid: &Grid,
    params: &SharpParams,
) -> (Vec<f64>, Vec<u8>)
Expand description

SHARP background field removal

Uses spherical mean value (SMV) filtering to remove background field. The local field is obtained by deconvolving the SMV-filtered field.

§Arguments

  • field - Unwrapped total field (nx * ny * nz)
  • mask - Binary mask (nx * ny * nz), 1 = inside ROI
  • grid - Volume dimensions and voxel sizes
  • params - SHARP parameters (threshold, radius in mm)

§Returns

(local_field, eroded_mask)