Skip to content

StardistTransform

Bases: OnlyInstMapTransform

available_keys property

available_keys: set[str]

Returns set of available keys.

__init__

__init__(n_rays: int = 32, deduplicate: bool = True, **kwargs)

Generate radial distance maps from a label mask.

https://arxiv.org/abs/1806.03535

Parameters:

Name Type Description Default
n_rays int, default=32

Number of rays used for computing distance maps.

32
deduplicate bool, default=True

Whether to fix duplicate values in the mask before transforming. This adds overhead, so use only if you know that the mask has duplicates.

True

__call__

__call__(inst: ndarray, **kwargs) -> np.ndarray

Fix duplicate values and generate radial distance maps.

Parameters inst (np.ndarray): Instance labelled mask. Shape (H, W).

Returns np.ndarray: Pixelwise radial distance maps. Shape: (n_rays, H, W). Dtype: float64.