dcnum.segm.segm_thresh ====================== .. py:module:: dcnum.segm.segm_thresh Classes ------- .. autoapisummary:: dcnum.segm.segm_thresh.SegmentThresh Module Contents --------------- .. py:class:: SegmentThresh(*, num_workers: int | None = None, kwargs_mask: dict | None = None, debug: bool = False, **kwargs) Bases: :py:obj:`dcnum.segm.segmenter_mpo.MPOSegmenter` Segmenter with multiprocessing operation :param num_workers: Number of workers (processes) to spawn :param kwargs_mask: Keyword arguments for mask post-processing (see `process_labels`) :type kwargs_mask: dict :param debug: Debugging parameters :type debug: bool :param kwargs: Additional, optional keyword arguments for ``segment_algorithm`` defined in the subclass. .. py:attribute:: mask_postprocessing :value: True Whether to enable mask post-processing. If disabled, you should make sure that your mask is properly defined and cleaned or you have to call `process_labels` in your ``segment_algorithm`` implementation. .. py:attribute:: mask_default_kwargs Default keyword arguments for mask post-processing. See `process_labels` for available options. .. py:attribute:: requires_background_correction :value: True Whether the segmenter requires a background-corrected image .. py:method:: segment_algorithm(image, *, thresh: float = -6) :staticmethod: Mask retrieval using basic thresholding :param image: Background-corrected frame image :type image: 2d ndarray :param thresh: Threshold value for creation of binary mask; a negative value means that pixels darker than the background define the threshold level. :type thresh: float :returns: **mask** -- Mask image for the given index :rtype: 2d boolean ndarray