Skip to main content

cosmos

Function cosmos 

Source
pub fn cosmos<F: AsRef<[f64]>>(
    local_fields: &[F],
    bdirs: &[(f64, f64, f64)],
    mask: &[u8],
    grid: &Grid,
    params: &CosmosParams,
) -> Vec<f64>
Expand description

COSMOS dipole inversion, closed form.

§Arguments

  • local_fields - One local (tissue) field map per orientation, ppm, all resampled onto the same grid.
  • bdirs - B0 direction for each orientation, in the voxel frame of that shared grid.
  • mask - Binary mask (1 = inside ROI).
  • grid - The shared volume grid.
  • params - See CosmosParams; only lambda applies here.

§Returns

Susceptibility map in ppm, zero outside mask.

§Panics

If no orientations are given, if the field and direction counts differ, or if any field map does not match grid.