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 | type[typing.Any] | ~numpy._typing._dtype_like._SupportsDType[~numpy.dtype[~typing.Any]] | str | tuple[typing.Any, int] | tuple[typing.Any, typing.Union[typing.SupportsIndex, collections.abc.Sequence[typing.SupportsIndex]]] | list[typing.Any] | ~numpy._typing._dtype_like._DTypeDict | tuple[typing.Any, typing.Any] = <class 'numpy.uint8'>, ch: int = -1, rescale_dtype: ~numpy.dtype[~typing.Any] | None | type[typing.Any] | ~numpy._typing._dtype_like._SupportsDType[~numpy.dtype[~typing.Any]] | str | tuple[typing.Any, int] | tuple[typing.Any, typing.Union[typing.SupportsIndex, collections.abc.Sequence[typing.SupportsIndex]]] | list[typing.Any] | ~numpy._typing._dtype_like._DTypeDict | 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.