cyto_dl.image.io.polygon_loader module#

class cyto_dl.image.io.polygon_loader.PolygonLoaderd(keys: list | str, shape_reference_key: str, propagate_3d: bool = True, missing_key_mode: str = 'raise')[source]#

Bases: Transform

Convert numpy array of polygon vertices to a torch tensor.

Parameters:
  • keys (Union[list, str]) – keys containing polygon paths

  • shape_reference_key (str) – key to base mask shape on

  • propagate_3d (bool=True) – Whether to propagate 2D mask to 3D. Currently, only True is supported.

  • missing_key_mode (str=’raise’) – How to handle missing keys. Options are ‘raise’, ‘ignore’, and ‘create’. Raise will raise a KeyError, ignore will do nothing, and create will create a new key with a blank mask.