cyto_dl.models.im2im.utils.postprocessing.act_thresh_label module#

class cyto_dl.models.im2im.utils.postprocessing.act_thresh_label.ActThreshLabel(activation: ~typing.Callable = Identity(), threshold: float | None = None, label: bool = False, dtype: ~numpy.dtype[~typing.Any] | None | ~typing.Type[~typing.Any] | ~numpy._typing._dtype_like._SupportsDType[~numpy.dtype[~typing.Any]] | str | ~typing.Tuple[~typing.Any, int] | ~typing.Tuple[~typing.Any, ~typing.SupportsIndex | ~typing.Sequence[~typing.SupportsIndex]] | ~typing.List[~typing.Any] | ~numpy._typing._dtype_like._DTypeDict | ~typing.Tuple[~typing.Any, ~typing.Any] = <class 'numpy.uint8'>, ch: int = -1, rescale_dtype: ~numpy.dtype[~typing.Any] | None | ~typing.Type[~typing.Any] | ~numpy._typing._dtype_like._SupportsDType[~numpy.dtype[~typing.Any]] | str | ~typing.Tuple[~typing.Any, int] | ~typing.Tuple[~typing.Any, ~typing.SupportsIndex | ~typing.Sequence[~typing.SupportsIndex]] | ~typing.List[~typing.Any] | ~numpy._typing._dtype_like._DTypeDict | ~typing.Tuple[~typing.Any, ~typing.Any] = None)[source]#

Bases: object

General-purpose postprocessing transform for applying any of an activation, threshold, labeling, and rescaling.

Parameters:
  • activation (Callable=torch.nn.Identity()) – activation to apply to image

  • threshold (float =None) – Threshold value, defaults to None, where no threshold is applied

  • label (bool=False) – whether to label image after thresholding

  • dtype (DTypeLike=np.uint8) – data type of output image, defaults to np.uint8

  • ch (int=-1) – channel of image to apply postprocessing to, default -1 for all channels

  • rescale_dtype=None – dtype to rescale intensity range to, defaults to no rescaling.