pub fn tgv_qsm(
input: TgvInput<'_>,
mask: &[u8],
grid: &Grid,
params: &TgvParams,
b0_dir: (f64, f64, f64),
progress: impl FnMut(usize, usize),
) -> Result<Vec<f64>, InputError>Expand description
Main TGV-QSM reconstruction
§Arguments
input- Field in ppm or one wrapped echo in rad (seeTgvInput)mask- Binary maskgrid- Volume grid (dimensions and voxel sizes)params- TGV parameters (α in the reference’s rad units)b0_dir- B0 field directionprogress- Progress callback(iteration, total_iterations)
Returns χ in ppm.
§Errors
If the input or mask length does not match grid, if the echo time (te_s, or the one
TgvParams::te picks from echo_times) or b0_t is not positive and finite, or if the
mask is empty after params.erosions erosions.
The reconstruction runs in single precision internally; inputs and
outputs use f64 to match the rest of the crate’s API.