Expand description
§QSM-Core
A Rust library for Quantitative Susceptibility Mapping (QSM) of the brain.
QSM-Core provides a complete set of algorithms for reconstructing magnetic susceptibility maps from MRI phase data, including brain extraction, phase unwrapping, background field removal, dipole inversion, and susceptibility source separation.
§Pipeline Overview
A typical QSM pipeline follows these steps:
- Brain extraction (
bet) — mask the brain region from magnitude images - Phase unwrapping (
unwrap) — remove 2π wraps from MRI phase data - Background field removal (
bgremove) — isolate the local field from background sources - Dipole inversion (
inversion) — reconstruct susceptibility from the local field
Additional processing modules:
- SWI (
swi) — Susceptibility Weighted Imaging (CLEAR-SWI) - Chi-separation (
separation) — decompose susceptibility into paramagnetic/diamagnetic components - Multi-echo processing (
utils) — R2*/T2* mapping, phase combination (MCPC-3D-S), bias correction
§Feature Flags
parallel— enables Rayon-based multi-threading for FFT and iterative solverssimd— enables SIMD acceleration via thewidecrate
§Algorithms
| Stage | Methods |
|---|---|
| Brain extraction | BET |
| Phase unwrapping | ROMEO, Laplacian |
| Background removal | V-SHARP, SHARP, PDF, iSMV, LBV, SDF |
| Dipole inversion | TKD, TSVD, Tikhonov, TV-ADMM, NLTV, RTS, MEDI, TGV, iLSQR |
| SWI | CLEAR-SWI |
| Separation | Chi-separation (MEDI-based) |
| Multi-echo | MCPC-3D-S, R2*/T2* (ARLO), bias correction |
| Utilities | Frangi vesselness, surface curvature, Otsu thresholding, QSMART |
Modules§
- bet
- BET (Brain Extraction Tool) Implementation
- bgremove
- Background field removal methods
- fft
- FFT wrapper for 3D transforms using rustfft
- inversion
- Dipole inversion methods for QSM
- kernels
- Kernel functions for QSM processing
- nifti_
io - NIfTI file I/O for WASM
- par
- Conditional parallelism macros.
- priority_
queue - region_
grow - separation
- Susceptibility source separation
- solvers
- Iterative solvers for QSM
- swi
- Susceptibility Weighted Imaging (SWI)
- unwrap
- Phase unwrapping methods
- utils
- Utility functions for QSM processing
Macros§
- maybe_
par_ chunks_ mut - Parallel or sequential chunks iterator.
- maybe_
par_ iter - Parallel or sequential immutable iterator over a slice.
- maybe_
par_ iter_ mut - Parallel or sequential mutable iterator over a slice.