squidpy.im.SegmentationCustom

class squidpy.im.SegmentationCustom(func)[source]

Segmentation model based on a user-defined function.

Parameters

func (Callable[..., ndarray[Any, dtype[Any]]]) – Segmentation function to use. Can be any callable(), as long as it has the following signature: numpy.ndarray (height, width, channels) -> numpy.ndarray (height, width[, 1]). The segmentation must be of numpy.uint32 type, where 0 marks background.

Methods

segment(img, **kwargs)

Segment an image.