cyto_dl.image.transforms.pad module#

class cyto_dl.image.transforms.pad.PadZd(image_key: str, segmentation_key: str, pad_amount: Dict[str, int], pad_keys: str | ListConfig = [], segmentation_ch: int | None = None)[source]#

Bases: Transform

Transform for randomly padding top or bottom of crop by repeating first/last slice.

Only applied if no segmentation is present in first/last slice

Parameters:
  • image_key (str) – name of images to pad

  • segmentation_key (str) – name of segmentation. Used for checking whether top or bottom can be offset

  • pad_amount (int) – number of slices to pad

  • segmentation_ch (int) – channel of segmentation to check for presence of segmentation

  • allow_missing_keys (bool) – allow missing keys