Skip to main content

tfi

Function tfi 

Source
pub fn tfi(
    total_field: &[f64],
    n_std: &[f64],
    magnitude: &[f64],
    mask: &[u8],
    grid: &Grid,
    bdir: (f64, f64, f64),
    params: &TfiParams,
    progress: impl FnMut(usize, usize),
) -> Vec<f64>
Expand description

Preconditioned Total Field Inversion (TFI).

§Arguments

  • total_field - Total field (before background removal) in ppm — same units convention as NDI and the other inversions (NOT MEDI’s radians). Do not pre-scale to radians: the total field is large and would wrap in the exp(i·field) data term.
  • n_std - Noise standard deviation map (same size as total_field)
  • magnitude - Magnitude image for gradient weighting
  • mask - Binary brain mask (1 = brain)
  • grid - Volume grid (dimensions and voxel sizes)
  • bdir - B0 field direction
  • params - TFI parameters
  • progress - Progress callback (current_step, total_steps)

§Returns

Susceptibility map χ (same units as input field), zeroed outside the brain mask. The solve itself runs over the whole FOV (to absorb the background into out-of-brain susceptibility), but that region is unconstrained/artefacty, so only the brain is returned.