pub fn whqsm(
local_field: &[f64],
mask: &[u8],
magnitude: Option<&[f64]>,
grid: &Grid,
bdir: (f64, f64, f64),
params: &WhQsmParams,
progress: impl FnMut(usize, usize),
) -> Vec<f64>Expand description
Weak-Harmonic QSM dipole inversion.
Jointly estimates the susceptibility map and a residual harmonic
background field, returning the susceptibility map (out.x).
§Arguments
local_field- Local field in ppm (nx * ny * nz).mask- Binary mask (nx * ny * nz), 1 = inside ROI.magnitude- Magnitude image, for a magnitude data weight (WhQsmParams::weight); ignored by the default flat weight, which weights every voxel in the mask by 1.grid- Volume grid (dimensions and voxel sizes).bdir- B0 field direction.params- WH-QSM parameters.progress- Progress callback(iteration, max_iter).
§Returns
Susceptibility map in ppm.
§Panics
If params.weight needs the magnitude and magnitude is None, or if params.te cannot
be resolved from params.echo_times.