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
-1and 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
onnxfeature).fieldis 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
onnxfeature +iqfmweights. - 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
onnxfeature +iqsmweights. - 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
onnxfeature). - run_
lpcnn 🔒 - Source the LPCNN proximal-CNN weights and run inference (requires the
onnxfeature). 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
onnxfeature). 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
onnxfeature). - run_
qsmnet 🔒 - Source a QSMnet-family model’s weights and run inference (requires the
onnxfeature).model_idselects the registry entry (qsmnet/qsmnet-plus),normsupplies that checkpoint’s normalization constants. - run_tgv
- Run TGV single-step QSM reconstruction.
- run_
xqsm 🔒 - Source the xQSM weights and run inference. Requires the
onnxfeature; weights come from the model registry (local$QSM_MODEL_DIR/cache, or thedownloadfeature).