dcnum.segm.segmenter_sto
Classes
Segmenter with single thread operation |
Module Contents
- class dcnum.segm.segmenter_sto.STOSegmenter(*, num_workers: int | None = None, kwargs_mask: dict | None = None, debug: bool = False, **kwargs)[source]
Bases:
dcnum.segm.segmenter.Segmenter,abc.ABCSegmenter with single thread operation
- Parameters:
kwargs_mask (dict) – Keyword arguments for mask post-processing (see process_labels)
debug (bool) – Debugging parameters
kwargs – Additional, optional keyword arguments for
segment_algorithmdefined in the subclass.
- hardware_processor = 'gpu'
Required hardware (“cpu” or “gpu”) defined in first-level subclass.
- segment_batch(images: numpy.ndarray, bg_off: numpy.ndarray | None = None)[source]
Perform batch segmentation of images
Before segmentation, an optional background offset correction with
bg_offis performed. After segmentation, mask postprocessing is performed according to the class definition.- Parameters:
images (3d np.ndarray of shape (N, Y, X)) – The time-series image data. First axis is time.
bg_off (1D np.ndarray of length N) – Optional 1D numpy array with background offset
Notes
If the segmentation algorithm only accepts background-corrected images, then images must already be background-corrected, except for the optional bg_off.