neuro_morpho.model.breaks_analyzer
Analyzes and patches breaks in predicted binary images.
Attributes
Classes
Analyzes and patches breaks in predicted binary images. |
Module Contents
- neuro_morpho.model.breaks_analyzer.MAX_FIXABLE_DISTANCE = 6
- class neuro_morpho.model.breaks_analyzer.BreaksAnalyzer[source]
Analyzes and patches breaks in predicted binary images.
This class provides methods to identify and fix breaks in the dendrite segmentation of the predicted binary images.
- masked_max(image: numpy.ndarray, point: tuple[int, int], kernel: numpy.ndarray) tuple[int, int][source]
Find the maximum value and its coordinate in a masked region of an image.
- create_connecting_line(line_mask: numpy.ndarray, pt1: tuple[int, int], pt2: tuple[int, int], pred_bin_img: numpy.ndarray, pred_img: numpy.ndarray) bool[source]
Draw a line on the mask connecting two points.
The line is drawn with respect to the predicted image, following the path of highest probability.
- Parameters:
- Returns:
True if the line was successfully connected, False otherwise.
- Return type:
- analyze_breaks(pred_bin_img: numpy.ndarray, pred_img: numpy.ndarray) numpy.ndarray[source]
Find and patch potential breaks in the predicted binary image.
- Parameters:
pred_bin_img (np.ndarray) – The binary prediction image.
pred_img (np.ndarray) – The probability map prediction image.
- Returns:
The patched binary image.
- Return type:
np.ndarray