Skip to main content

run_bet

Function run_bet 

Source
pub fn run_bet<F>(
    data: &[f64],
    grid: &Grid,
    params: &BetParams,
    order: FslLeftRightOrder,
    progress: F,
) -> Vec<u8> ⓘ
where F: FnMut(usize, usize),
Expand description

Run BET brain extraction, as FSL’s bet2 (see the module docs).

§Arguments

  • data - 3D magnitude image data (nx * ny * nz, Fortran order)
  • grid - Volume grid (dimensions and voxel sizes)
  • params - BET parameters (intensity threshold, smoothness, gradient, iterations, subdivisions)
  • order - The image’s FslLeftRightOrder, from its header (FslLeftRightOrder::from_affine): bet2 runs on neurological images with x reversed.
  • progress - Progress callback: (iteration, total_iterations)

§Returns

Binary mask (1 = brain, 0 = background)