Skip to main content

Module inversion

Module inversion 

Source
Expand description

Dipole inversion stage

Dispatcher for standard dipole inversion algorithms. Also contains TGV and QSMART pipeline runners which combine multiple stages internally.

MEDI Hz↔radians conversion is handled internally — the caller passes ppm fields and receives ppm results.

Constants§

IQSM_ERODED_RAD 🔒
IQSM_PHASE_SIGN 🔒
The authors’ fixed inference conventions for the iQSM/iQFM LoT-Unet family: phase sign -1 and a 3-voxel mask-erosion radius. These are training-time constants, not user knobs, so the pipeline runners bake them in.

Functions§

run_autoqsm 🔒
Source the AutoQSM weights and run inference (requires the onnx feature). field is the total field (AutoQSM does its own background removal).
run_dipole_inversion
Run standard dipole inversion on a local field.
run_iqfm
Run iQFM: joint unwrapping + background removal from wrapped phase in one network (the tissue-field head of the iQSM LoT-Unet). Returns the local (background-removed) field in ppm — feed it to any dipole inversion. This is a deep-learning replacement for the unwrap + BFR stages, not an inversion. Requires the onnx feature + iqfm weights.
run_iqsm
Run iQSM single-step reconstruction from wrapped phase (joint unwrap + background removal + dipole inversion). Multi-echo inputs are reconstructed per echo and magnitude·TE²-combined. Requires the onnx feature + iqsm weights.
run_iqsm_plus
Run iQSM+ single-step reconstruction from wrapped phase (orientation-adaptive variant; the B0 direction is a genuine network input). See run_iqsm.
run_ir2qsm 🔒
Source the IR2QSM weights and run inference (requires the onnx feature).
run_lpcnn 🔒
Source the LPCNN proximal-CNN weights and run inference (requires the onnx feature). LPCNN’s k-space data-consistency step uses the B0 direction.
run_modl_qsm 🔒
Source the MoDL-QSM prior-CNN weights and run inference (requires the onnx feature). Output is the STI χ33 component.
run_nextqsm
Run NeXtQSM end-to-end from the total field (it does its own background removal), sourcing both weight files from the registry. Unlike the entries in InversionAlgorithm, NeXtQSM spans BFR + dipole inversion, so it is exposed as a standalone reconstruction rather than a dipole-inversion-stage option.
run_qsmgan 🔒
Source the QSMGAN generator weights and run inference (requires the onnx feature).
run_qsmnet 🔒
Source a QSMnet-family model’s weights and run inference (requires the onnx feature). model_id selects the registry entry (qsmnet / qsmnet-plus), norm supplies that checkpoint’s normalization constants.
run_tgv
Run TGV single-step QSM reconstruction.
run_xqsm 🔒
Source the xQSM weights and run inference. Requires the onnx feature; weights come from the model registry (local $QSM_MODEL_DIR/cache, or the download feature).