dcnum.segm.segmenter_sto ======================== .. py:module:: dcnum.segm.segmenter_sto Classes ------- .. autoapisummary:: dcnum.segm.segmenter_sto.STOSegmenter Module Contents --------------- .. py:class:: STOSegmenter(*, num_workers: int | None = None, kwargs_mask: dict | None = None, debug: bool = False, **kwargs) Bases: :py:obj:`dcnum.segm.segmenter.Segmenter`, :py:obj:`abc.ABC` Segmenter with single thread operation :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:: hardware_processor :value: 'gpu' Required hardware ("cpu" or "gpu") defined in first-level subclass. .. py:method:: segment_batch(images: numpy.ndarray, bg_off: numpy.ndarray | None = None) Perform batch segmentation of `images` Before segmentation, an optional background offset correction with ``bg_off`` is performed. After segmentation, mask postprocessing is performed according to the class definition. :param images: The time-series image data. First axis is time. :type images: 3d np.ndarray of shape (N, Y, X) :param bg_off: Optional 1D numpy array with background offset :type bg_off: 1D np.ndarray of length N .. rubric:: Notes - If the segmentation algorithm only accepts background-corrected images, then `images` must already be background-corrected, except for the optional `bg_off`. .. py:method:: segment_single(image, bg_off: float | None = None) This is a convenience-wrapper around `segment_batch`