SegmentationModel.segment#
- SegmentationModel.segment(img, **kwargs)[source]#
- SegmentationModel.segment(img: NDArray[Any], **kwargs: Any) NDArray[Any] | Array
- SegmentationModel.segment(img: Array, chunks: str | int | tuple[int, ...] | None = None, **kwargs: Any) NDArray[Any]
- SegmentationModel.segment(img: ImageContainer, layer: str, library_id: str | Sequence[str], channel: int | None = None, fn_kwargs: Mapping[str, Any] = mappingproxy({}), **kwargs: Any) ImageContainer
Segment an image.
- Parameters:
- img
NDArray[Any] |ImageContainer High-resolution image.
- layer
Image layer in
imgthat should be processed. If None and only 1 layer is present, it will be selected. Only used whenimgissquidpy.im.ImageContainer.- kwargs
Any Keyword arguments for the underlying
model.
- img
- Returns:
NDArray[Any] |ImageContainer– Segmentation mask for the high-resolution image of shape(height, width, z, 1).- Raises:
ValueError – If the number of dimensions is neither 2 nor 3.
NotImplementedError – If trying to segment a type for which the segmentation has not been registered.