Skip to main content

Module separation

Module separation 

Source
Expand description

Susceptibility source-separation stage.

Config-driven dispatcher over the χ-separation methods (χ+ / χ−). Unlike the main phase→field→BFR→inversion pipeline, separation is a downstream stage that needs extra inputs (a conventional QSM plus a relaxometry map / multi-echo magnitude), so it is invoked explicitly with a SeparationInputs bundle rather than folded into the top-level runner.

Units follow the library convention: local field & QSM in ppm, R2’/R2* in Hz, echo times in seconds. Output is (chi_pos ≥ 0, chi_neg ≤ 0, chi_total) in ppm.

§Reference pipelines

Each method’s module docs have a “Reference pipeline” section: the masking, unwrapping, background removal and QSM method its authors fed it, and where this stage’s inputs differ from theirs. The main differences, all recorded there with sources:

  • Decompose takes a QSM per echo (SeparationInputs::qsm_per_echo), as its authors do (a STAR-QSM per echo); producing those is the caller’s.
  • The analytic methods’ D_r is calibrated at 3 T only. ChiSepMedi and ChiSepIlsqr default to the χ-separation toolbox’s 137·(B0/2.9) (from the authors’ code). WaveSep keeps 137 Hz/ppm at every field, while R2starQsm and HcChisep scale theirs by B0/3; those choices do not come from the authors.
  • ChiSepNet runs the authors’ route by default (ChiSepNetRoute::Toolbox): its own QSMnetME QSM (so SeparationInputs::qsm is not read), R2′ from a measured map or R2PRIMEnet on R2*, in the 3 T, 1 mm training frame.

Structs§

SeparationInputs
Inputs for run_separation. Provide whatever the chosen algorithm needs; the dispatcher errors if a required input is missing.
SeparationResult
Result of run_separation: paramagnetic / diamagnetic / total maps in ppm.

Functions§

check_inputs 🔒
Check what the separation algorithms would otherwise assert! on, so bad input is an error rather than a panic: map sizes, the multi-echo magnitude’s echo count, Decompose’s minimum of three echoes, and an empty mask.
need 🔒
Require an optional input, or return an InvalidInput error naming it.
run_chi_sepnet 🔒
Source the χ-sepnet weights and run inference (requires the onnx feature).
run_chi_sepnet_toolbox 🔒
Source the weights and run χ-sepnet by the authors’ route (crate::separation::chisepnet_toolbox).
run_separation
Run the configured χ-separation algorithm.
run_susep_net 🔒
Source the SUSEP-Net weights and run inference (requires the onnx feature).