linumpy.segmentation.brain#
Brain segmentation utilities.
Functions#
|
To segment an S-OCT brain in 3D using thresholding and morphological watershed. |
|
Fill holes in a 2D or 3D mask. |
|
Remove the bottom side of the mask. |
Module Contents#
- linumpy.segmentation.brain.segment_oct_3d(vol, k=5, use_log=True, threshold_method='otsu')[source]#
To segment an S-OCT brain in 3D using thresholding and morphological watershed.
- Parameters:
vol (numpy.ndarray) – The OCT brain to segment
k (int) – Median smoothing kernel size in pixel
use_log (bool) – Transform the pixel intensity with a log before computing mask
threshold_method (str) – ‘ostu’, ‘triangle’
- Returns:
The brain mask
- Return type:
ndarray
- linumpy.segmentation.brain.fill_holes_2d_and_3d(mask)[source]#
Fill holes in a 2D or 3D mask.
- Parameters:
mask (numpy.ndarray) – The mask to fill
- Returns:
The filled mask
- Return type:
ndarray
- linumpy.segmentation.brain.remove_bottom(mask, k=10, axis=2, inverse=False, fill_holes=False)[source]#
Remove the bottom side of the mask.
- Parameters:
mask (numpy.ndarray) – Mask to modify. The 3rd axis is assumed to be the dimension direction to modify.
k (int) – Number of pixel to erode
axis (int) – Axis to erode
inverse (bool) – Inverse the operation
fill_holes (bool) – Fill holes in the mask
- Returns:
Modified mask
- Return type:
ndarray