pub fn run_qsmart(
field_ppm: &[f64],
mask: &[u8],
reliability: Option<&[u8]>,
magnitude: Option<&[f64]>,
metadata: &ScanMetadata,
inversion_config: &InversionConfig,
reference: QsmReference,
observer: &mut dyn Observer,
) -> Result<Vec<f64>, PipelineError>Expand description
Run QSMART two-stage QSM reconstruction.
§Arguments
field_ppm- Total field in ppm (after field mapping)mask- Binary brain maskreliability- QSMART’s reliability mapR_0(1 = reliable), from its echo fit (qsmart_echofit). Both stages run onmask×R_0, asQSMART.mdoes; vasculature detection usesmaskalone.Nonemeans every voxel is reliable.magnitude- Combined magnitude (for vasculature detection and, when the inner inversion is MEDI, edge weighting; uniform if None)metadata- Scan metadatainversion_config- Inversion configuration. QSMART-specific settings (SDF, vasculature, iLSQR iteration cap and padding) come frominversion_config.qsmart; the inner dipole inversion algorithm is selected byinversion_config.qsmart.inversionand tuned via the matching per-algorithm field on this config. With the default iLSQR, the inversion is STI Suite’silsqrwith QSMART’s arguments (qsmart.ilsqr_max_iter,qsmart.ilsqr_pad_mm; the artefact tolerance comes frominversion_config.ilsqr).reference- QSM referencing methodobserver- Receives progress (step of 6) and the intermediates named inoutputsas they are produced, as borrowed slices. A plainFnMut(usize, usize)progress closure works here too and ignores the intermediates.
§Returns
Susceptibility map in ppm (referenced): the stage-1 and stage-2 χ combined by offset adjustment, zero outside the brain mask.