Skip to main content

run_masking

Function run_masking 

Source
pub fn run_masking(
    sections: &[MaskSection],
    phases: &[&[f64]],
    magnitudes: &[&[f64]],
    metadata: &ScanMetadata,
) -> Result<Vec<u8>, PipelineError>
Expand description

Build a mask from multiple sections, OR’d together.

Each section specifies an input source, a generator (threshold/BET), and optional refinements (erode, dilate, close, fill holes, smooth). Each builds its own input from the echoes, so sections with different inputs do not affect each other.

§Arguments

  • sections - Mask section configs
  • phases - Per-echo wrapped phase (for MaskingInput::PhaseQuality)
  • magnitudes - Per-echo magnitude, all echoes (optionally homogeneity-corrected)
  • metadata - Scan metadata