pub fn heidi_cone_fill(
local_field: &[f64],
mask: &[u8],
chi_seed: &[f64],
grid: &Grid,
bdir: (f64, f64, f64),
params: &HeidiParams,
progress: impl FnMut(usize, usize),
) -> Vec<f64>Expand description
HEIDI’s cone fill on any seed χ map: streaking reduction after a dipole inversion, as the
authors’ computesusceptibility_heidi(suscInterim, …) and SEPIA’s Wrapper_QSM_HEIDI4all.
The well-conditioned coefficients (|D(k)| > cone_threshold) of chi_seed are kept as exact
constraints and the dipole cone is refilled under HEIDI’s homogeneity-weighted TV, exactly as
heidi does to its LSQR seed. See the module docs, Any seed, for which seeds suit it.
The grid is upstream’s: the field, the mask and the seed are cropped to the mask’s bounding
box and given LSQR’s 40-voxel anti-aliasing frame (odd extents), as Wrapper_QSM_HEIDI4all
does with zealouscrop(mask) and prepareforconvolution(…, 40) on every input, the seed
included. A seed is whatever its method returned, normally masked; the frame around it is 0.
§Arguments
local_field- Local field in ppm (nx * ny * nz, Fortran order), the one the seed was inverted from: HEIDI’s homogeneity weights come from itmask- Binary brain maskchi_seed- The seed χ map in ppmgrid- Volume gridbdir- B0 directionparams- HEIDI parameters (HeidiParams::b0andHeidiParams::echo_timesare the scan’s)progress- Progress callback(iteration, total_iterations)
§Returns
Susceptibility map in ppm, masked (as Wrapper_QSM_HEIDI4all’s chi .* mask).