Expand description
LPCNN dipole inversion (onnx feature).
LPCNN (Lai 2020) solves the dipole deconvolution by unrolling proximal
gradient descent (iter_num = 3): each iteration takes a k-space
data-consistency step with the dipole kernel D, then applies a learned 3D-CNN
proximal operator gen. Only gen is a network (exported ONNX, a plain
conv/BN/ReLU residual stack); the FFT data-consistency, the unroll, the learned
step size alpha, and the mean/std normalization live here in Rust.
Input is the background-removed local field in ppm (single orientation). The
authors’ Hz↔ppm round-trip (×tesla·γ then ÷tesla·γ) cancels, so the field is
consumed directly in ppm. Weights are not bundled; the caller passes lpcnn.onnx.
Constants§
- ITER_
NUM 🔒 - LPCNN_
ALPHA - Learned data-consistency step size (checkpoint
alpha, Bmodel). - LPCNN_
GT_ MEAN - Ground-truth normalization (ppm), baked into the training pipeline.
- LPCNN_
GT_ STD
Functions§
- dipole_
apply 🔒 D(v) = real(ifft3(fft3(v)·dk))withdkin fftfreq (unshifted) layout.- lpcnn
- Run LPCNN on a background-removed local field (ppm), column-major
(nx,ny,nz).bdiris the B0 direction (for the dipole kernel). Returns χ (ppm), masked. - lpcnn_
dipole_ 🔒kernel - LPCNN dipole kernel
D = 1/3 − (k·B̂)²/|k|²withkfromfftfreq(DC at the array corner,D[0,0,0]=0) — the convention the model’s ortho-FFT expects. - lpcnn_
tiled - Memory-bounded LPCNN via whole-algorithm overlap-tiling — the entire unrolled net is run on
each patch sub-volume so peak memory is bounded (for the 32-bit WASM heap). LPCNN’s k-space
data-consistency step is global, so tiling is strongly off-design and approximate; for
real work run whole-volume (e.g. in QSMxT). See
crate::inversion::tiled::tiled_volume_algorithm. - run_gen 🔒
- Run the single-in/single-out proximal CNN on a column-major volume.