Skip to main content

Module masking

Module masking 

Source
Expand description

Masking stage

Generates a binary brain mask from magnitude/phase data using a configurable sequence of operations (threshold, BET, morphological ops). Multiple mask sections can be OR’d together.

Functions§

apply_mask_ops
Apply mask operations to an existing mask, in order.
build_mask_section
Build a mask from a single section (generator + refinements).
resolve_masking_input
Resolve masking input data based on the MaskingInput type.
run_hd_bet 🔒
Source the HD-BET weights and run it. Requires the onnx feature; weights come from the model registry (local $QSM_MODEL_DIR/cache, or the download feature).
run_masking
Build a mask from multiple sections, OR’d together.