Skip to main content

calculate_b0_weighted

Function calculate_b0_weighted 

Source
pub fn calculate_b0_weighted(
    unwrapped_phases: &[impl AsRef<[f64]>],
    mags: &[impl AsRef<[f64]>],
    tes: &[f64],
    mask: &[u8],
    weight_type: B0WeightType,
    n_total: usize,
) -> Vec<f64>
Expand description

Calculate B0 field from unwrapped phase using weighted averaging

Implements calculateB0_unwrapped from MriResearchTools.jl

Formula: B0 = (1000 / 2π) * Σ(phase / TE * weight) / Σ(weight)

§Arguments

  • unwrapped_phases - Unwrapped phase for each echo [n_echoes][nxnynz]
  • mags - Magnitude for each echo (used for some weighting types)
  • tes - Echo times in ms
  • mask - Binary mask
  • weight_type - Type of weighting to use
  • n_total - Total number of voxels

§Returns

B0 field in Hz