cyto_dl.image.transforms.crop_to_seg module#

class cyto_dl.image.transforms.crop_to_seg.CentroidCrop(crop_size: Sequence[str], remove_edge: bool = True)[source]#

Bases: object

Class for cropping patches around passed centroids in an image.

centroid_to_slice(centroid: Sequence[int])[source]#
class cyto_dl.image.transforms.crop_to_seg.CentroidCropd(keys: Sequence[str], crop_size: Sequence[int], centroid_key: str = 'centroid', label_key: str = 'label', remove_edge: bool = True)[source]#

Bases: CentroidCrop, Transform

Transform for cropping patches around dictionary of images and corresponding centroids.

class cyto_dl.image.transforms.crop_to_seg.SegCropd(raw_keys: str | Sequence[str], seg_key: str, crop_size: Sequence[int], remove_edge: bool = True, limit: int | None = None)[source]#

Bases: RandomizableTransform

Monai-style transform to crop a given size patch from an input image centered around each of the objects in an instance segmentation image.

get_centroids(seg)[source]#