Skip to main content

Module xqsm

Module xqsm 

Source
Expand description

xQSM deep-learning dipole inversion (onnx feature).

xQSM is an octave-convolution U-Net (with a global residual) that maps a local tissue field (ppm) to susceptibility (ppm). It is orientation-agnostic and takes no dipole kernel — the field goes in, χ comes out. This mirrors the authors’ pure-Python inference (sunhongfu/xQSM): centered zero-pad each dimension to a multiple of 8, run the net, crop back, and multiply the output by the mask. No normalization.

Weights are not bundled; the caller passes the exported xqsm.onnx bytes (see crate::models).

Functions§

xqsm
Run xQSM dipole inversion.
xqsm_tiled
Memory-bounded xQSM via overlap-tiling — the same fully-convolutional net run patch-by- patch so peak memory is bounded by one patch (for 32-bit WASM, where the whole-volume xqsm overflows the 4 GB heap on clinical-size data). Results approximate whole-volume xQSM up to tile-boundary error; see crate::inversion::tiled.