Skip to main content

makehomogeneous

Function makehomogeneous 

Source
pub fn makehomogeneous(
    mag: &[f64],
    grid: &Grid,
    sigma_mm: f64,
    nbox: usize,
) -> Result<Vec<f64>, InputError>
Expand description

Make magnitude homogeneous by dividing by bias field

This is the main entry point for bias field correction.

§Arguments

  • mag - Input magnitude data (nx * ny * nz)
  • grid - Dimensions and voxel sizes in mm
  • sigma_mm - Smoothing sigma in mm, used as given (MriResearchTools’ default is 7; no field-of-view cap is applied, see the module docs)
  • nbox - Number of boxes per dimension for segmentation (MriResearchTools’ default 15)

§Returns

Bias-corrected magnitude

§Errors

If nbox is 0 (see get_sensitivity).