Skip to main content

chi_sep_ilsqr

Function chi_sep_ilsqr 

Source
pub fn chi_sep_ilsqr<F>(
    local_field: &[f64],
    r2prime: &[f64],
    magnitude: &[f64],
    qsm: &[f64],
    mask: &[u8],
    grid: &Grid,
    bdir: (f64, f64, f64),
    params: &ChiSepIlsqrParams,
    progress: F,
) -> (Vec<f64>, Vec<f64>, Vec<f64>)
where F: FnMut(usize, usize),
Expand description

χ-separation (Shin 2021, projected Gauss-Newton/CG).

§Arguments

  • local_field - Local (tissue) field map in ppm [nx*ny*nz] (same units convention as the dipole-inversion algorithms; converted to Hz internally via params.cf)
  • r2prime - R2’ map in Hz [nx*ny*nz]
  • magnitude - GRE magnitude (echo-combined) for the SNR weight and edge mask
  • qsm - Conventional QSM in ppm for initialization (use [crate::inversion::ilsqr] on the same local field — see module docs)
  • mask - Binary brain mask [nx*ny*nz]
  • grid - Volume grid
  • bdir - B0 direction unit vector
  • params - Algorithm parameters (see ChiSepIlsqrParams)
  • progress - Progress callback (iteration, max_iterations)

§Returns

(chi_pos, chi_neg, chi_total) in ppm; chi_neg is ≤ 0.

Volumes whose dimensions are not FFT-friendly (2ᵃ·3ᵇ·5ᶜ) are transparently zero-padded to the next fast size for the internal FFTs and cropped back — awkward prime factors (e.g. 41 in a 164×205×205 acquisition) otherwise dominate the runtime, and the padding also increases the circular-wrap margin of the dipole convolution.