squidpy.im.SegmentationCustom.segment
- SegmentationCustom.segment(img, **kwargs)
Segment an image.
- Parameters:
img (
ndarray
[Any
,dtype
[Any
]] |ImageContainer
) – High-resolution image.layer – Image layer in
img
that should be processed. If None and only 1 layer is present, it will be selected. Only used whenimg
issquidpy.im.ImageContainer
.kwargs (
Any
) – Keyword arguments for the underlyingmodel
.
- Return type:
ndarray
[Any
,dtype
[Any
]] |ImageContainer
- Returns:
: 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.