Skip to main content

ilsqr

Function ilsqr 

Source
pub fn ilsqr(
    field: &[f64],
    mask: &[u8],
    grid: &Grid,
    bdir: (f64, f64, f64),
    params: &IlsqrParams,
    progress: impl FnMut(usize, usize),
) -> (Vec<f64>, Vec<f64>, Vec<f64>, Vec<f64>)
Expand description

iLSQR as in STI Suite 3.0 (QSM_iLSQR), padded by params.pad_mm.

See the module docs for the algorithm. field is the local field (any linear unit; QSM.rs passes ppm), bdir the B0 direction in voxel axes (normalised here).

§Returns

(chi, streaking_artifacts, fast_qsm, initial_lsqr) on the input grid, all masked. initial_lsqr is STI’s second output (the step-3 LSQR solution).

§Panics

If params fails IlsqrParams::validate (the pipeline checks this first and returns InvalidConfig).