Skip to main content

adjust_offset

Function adjust_offset 

Source
pub fn adjust_offset(
    removed_voxels: &[f64],
    lfs_sdf: &[f64],
    chi_1: &[f64],
    chi_2: &[f64],
    nx: usize,
    ny: usize,
    nz: usize,
    vsx: f64,
    vsy: f64,
    vsz: f64,
    b0_dir: (f64, f64, f64),
    ppm: f64,
) -> Vec<f64>
Expand description

Adjust offset between two-stage QSMART susceptibility maps

Combines chi_1 (whole ROI) and chi_2 (tissue only) with offset adjustment to ensure consistency with the original field data.

§Arguments

  • removed_voxels - Mask of removed voxels (mask * R_0 - vasc_only), indicates where stage 1 but not stage 2 was applied
  • lfs_sdf - Local field shift from stage 1 SDF (in ppm, will be scaled back)
  • chi_1 - Susceptibility from stage 1 (whole ROI)
  • chi_2 - Susceptibility from stage 2 (tissue only)
  • nx, ny, nz - Volume dimensions
  • vsx, vsy, vsz - Voxel sizes in mm
  • b0_dir - B0 field direction (unit vector)
  • ppm - PPM conversion factor (to scale lfs_sdf back)

§Returns

Combined and offset-adjusted susceptibility map