Skip to main content

calculate_swi

Function calculate_swi 

Source
pub fn calculate_swi(
    phase: &[f64],
    magnitude: &[f64],
    mask: &[u8],
    nx: usize,
    ny: usize,
    nz: usize,
    _vsx: f64,
    _vsy: f64,
    _vsz: f64,
    hp_sigma: [f64; 3],
    scaling: PhaseScaling,
    strength: f64,
) -> Vec<f64>
Expand description

Calculate SWI from unwrapped phase and magnitude

Pipeline: high-pass filter phase → create phase mask → multiply with magnitude.

§Arguments

  • phase - Unwrapped phase (single echo or combined)
  • magnitude - Magnitude image (single echo or combined)
  • mask - Binary brain mask
  • nx, ny, nz - Array dimensions
  • vsx, vsy, vsz - Voxel sizes in mm (unused, reserved for consistency)
  • hp_sigma - High-pass filter sigma in voxels [x, y, z]
  • scaling - Phase scaling type
  • strength - Phase scaling strength

§Returns

SWI image (magnitude × phase mask)