liom_toolkit.segmentation.volume_segmentation module
- liom_toolkit.segmentation.volume_segmentation.fill_holes_2d_3d(mask: ndarray) ndarray
Fill holes in a 2D and 3D mask. Source: https://github.com/linum-uqam/sbh-reconstruction/blob/51271c84347afccb21483cfd3fcbde77d537929c/slicercode/segmentation/brainMask.py
- Parameters:
mask (np.ndarray) – The mask to fill holes in.
- Returns:
The mask with holes filled.
- Return type:
np.ndarray
- liom_toolkit.segmentation.volume_segmentation.segment_3d_brain(volume: ndarray, k: int = 5, use_log: bool = True, threshold_method: str = 'otsu') ndarray
Segment a 3D brain volume using a watershed algorithm. Source: https://github.com/linum-uqam/sbh-reconstruction/blob/51271c84347afccb21483cfd3fcbde77d537929c/slicercode/segmentation/brainMask.py
- Parameters:
volume (ants.ANTsImage) – The volume to segment.
k (int) – The size of the median filter.
use_log (bool) – Whether to use the log of the volume.
threshold_method (str) – The threshold method to use. Either “otsu” or “triangle”.
- Returns:
The segmented mask
- Return type:
np.ndarray