Skip to main content

Module mask

Module mask 

Source
Expand description

Brain-mask thresholding and morphology.

Mask generation (otsu_threshold) plus morphological operations (erode/dilate/close/fill-holes) and sphere masks.

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)
otsu_threshold
Otsu’s method for automatic threshold selection