Skip to main content

iharperella_with_weights

Function iharperella_with_weights 

Source
pub fn iharperella_with_weights(
    phase: &[f64],
    mask: &[u8],
    grid: &Grid,
    max_iter: usize,
    tol: f64,
    w_brain: &[f64],
    progress: impl FnMut(usize, usize),
) -> (Vec<f64>, Vec<u8>)
Expand description

iHARPERELLA with custom W_Brain weighting

Allows specifying an arbitrary weighting function for the phase minimization. The weighting should be non-negative and defined over the full volume (nxnynz).

§Arguments

  • phase - Wrapped phase in radians (nx * ny * nz)
  • mask - Binary brain mask (nx * ny * nz), 1 = inside
  • grid - Volume dimensions and voxel sizes
  • max_iter - Maximum CG iterations
  • tol - CG convergence tolerance
  • w_brain - Weighting function for phase minimization
  • progress - Progress callback (iteration, max_iter)

§Returns

(tissue_phase, mask)