Expand description
Brain-mask thresholding and morphology.
Mask generation (otsu_threshold) plus
morphological operations (erode/dilate/close/fill-holes, signal-gated erosion) and sphere
masks.
Structs§
- Scanner
Masked Phase - Where a scanner wrote a fill value instead of a measured phase:
scanner_masked_phase. - Signal
Erosion Params - Signal-gated erosion parameters. The default is the QSM-CI harmonization setting.
Constants§
- SCANNER_
FILL_ MIN_ FRACTION - Smallest share of the volume a single exact phase value must cover to count as a scanner’s
fill value in
scanner_masked_phase: 5 %.
Functions§
- apply_
mask_ zero - Zero out elements where mask is 0.
- create_
sphere_ mask - Create a binary sphere mask on a 3D volume
- dilate_
mask - Dilate a binary mask by expanding into neighboring voxels (6-connectivity).
- erode_
mask - Erode a binary mask by removing boundary voxels (6-connectivity).
- fill_
holes - Fill holes in a binary mask
- morphological_
close - Morphological closing (dilation followed by erosion) with a spherical structuring element
of
radiusvoxels. - otsu_
threshold - Otsu’s method for automatic threshold selection
- scanner_
masked_ phase - Find the voxels where the scanner wrote no phase: a constant fill value, the same in every echo, covering a large part of the volume.
- signal_
gated_ erosion - Erode
maskonly where the signal is low (see the module docs).