neuro_morpho.model.breaks_analyzer ================================== .. py:module:: neuro_morpho.model.breaks_analyzer .. autoapi-nested-parse:: Analyzes and patches breaks in predicted binary images. Attributes ---------- .. autoapisummary:: neuro_morpho.model.breaks_analyzer.MAX_FIXABLE_DISTANCE Classes ------- .. autoapisummary:: neuro_morpho.model.breaks_analyzer.BreaksAnalyzer Module Contents --------------- .. py:data:: MAX_FIXABLE_DISTANCE :value: 6 .. py:class:: BreaksAnalyzer 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. .. py:method:: masked_max(image: numpy.ndarray, point: tuple[int, int], kernel: numpy.ndarray) -> tuple[int, int] Find the maximum value and its coordinate in a masked region of an image. :param image: The input image. :type image: np.ndarray :param point: The center of the mask. :type point: tuple[int, int] :param kernel: The mask to apply. :type kernel: np.ndarray :returns: The coordinate of the maximum value. :rtype: tuple[int, int] .. py:method:: 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 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. :param line_mask: The mask to draw the line on. :type line_mask: np.ndarray :param pt1: The starting point of the line. :type pt1: tuple[int, int] :param pt2: The ending point of the line. :type pt2: tuple[int, int] :param pred_bin_img: The binary prediction image. :type pred_bin_img: np.ndarray :param pred_img: The probability map prediction image. :type pred_img: np.ndarray :returns: True if the line was successfully connected, False otherwise. :rtype: bool .. py:method:: analyze_breaks(pred_bin_img: numpy.ndarray, pred_img: numpy.ndarray) -> numpy.ndarray Find and patch potential breaks in the predicted binary image. :param pred_bin_img: The binary prediction image. :type pred_bin_img: np.ndarray :param pred_img: The probability map prediction image. :type pred_img: np.ndarray :returns: The patched binary image. :rtype: np.ndarray