Skip to main content

hc_chisep

Function hc_chisep 

Source
pub fn hc_chisep(
    chi_total: &[f64],
    r2prime: &[f64],
    magnitude: &[f64],
    echo_times: &[f64],
    se_magnitude: Option<&[f64]>,
    mask: &[u8],
    grid: &Grid,
    params: &HcChisepParams,
    progress: impl FnMut(usize, usize),
) -> (Vec<f64>, Vec<f64>, Vec<f64>)
Expand description

HC-ChiSep source separation from a QSM, an R2’ map and multi-echo magnitude.

§Arguments

  • chi_total — Conventional QSM χ_total in ppm (nx·ny·nz, column-major).
  • r2prime — R2’ map in Hz (nx·ny·nz).
  • magnitude — Multi-echo GRE magnitude, flattened as (n_voxels, n_echoes) in row-major order (echo fastest per voxel). Normalised per voxel internally.
  • echo_times — GRE echo times in seconds (n_echoes).
  • se_magnitude — Optional multi-echo spin-echo magnitude, (n_voxels, n_se_echoes); used as soft MWF/pool-T2 evidence when present (with params.se_echo_times).
  • mask — Binary brain mask (nx·ny·nz, 1 = inside).
  • grid — Volume dimensions and voxel sizes.
  • params — See HcChisepParams.
  • progress — Progress callback (stage_done, stage_total).

§Returns

(chi_pos, chi_neg, chi_total) in ppm, restricted to mask — matching the χ-separation convention: chi_pos ≥ 0 (paramagnetic), chi_neg ≤ 0 (diamagnetic, signed), and chi_total = chi_pos + chi_neg.