class_docstr: Dictionary-based wrapper of :py:class:`monai.apps.pathology.transforms.array.Watershed`.
  Use `skimage.segmentation.watershed` to get instance segmentation results from images.
  See: https://scikit-image.org/docs/stable/api/skimage.segmentation.html#skimage.segmentation.watershed.
  
  Args:
      keys: keys of the corresponding items to be transformed.
          See also: monai.transforms.MapTransform
      mask_key: keys of mask used in watershed. Only points at which mask == True will be labeled.
      markers_key: keys of markers used in watershed. If None (no markers given), the local minima of the image are
          used as markers.
      connectivity: An array with the same number of dimensions as image whose non-zero elements indicate neighbors
          for connection. Following the scipy convention, default is a one-connected array of the dimension of the
          image.
      dtype: target data content type to convert. Defaults to np.uint8.
      allow_missing_keys: don't raise exception if key is missing.
  
  Raises:
      ValueError: when the `image` shape is not [1, H, W].
      ValueError: when the `mask` shape is not [1, H, W].
code: def __init__(
      self,
      keys: KeysCollection,
      mask_key: str | None = "mask",
      markers_key: str | None = None,
      connectivity: int | None = 1,
      dtype: DtypeLike = np.uint8,
      allow_missing_keys: bool = False,
  ) -> None:
      super().__init__(keys, allow_missing_keys)
      self.mask_key = mask_key
      self.markers_key = markers_key
      self.transform = Watershed(connectivity=connectivity, dtype=dtype)
  
imports: from __future__ import annotations
  from collections.abc import Callable, Hashable, Mapping
  import numpy
  import torch
  from monai.apps.pathology.transforms.post.array import GenerateDistanceMap, GenerateInstanceBorder, GenerateInstanceCentroid, GenerateInstanceContour, GenerateInstanceType, GenerateSuccinctContour, GenerateWatershedMarkers, GenerateWatershedMask, HoVerNetInstanceMapPostProcessing, HoVerNetNuclearTypePostProcessing, Watershed
  from monai.config.type_definitions import DtypeLike, KeysCollection, NdarrayOrTensor
  from monai.transforms.transform import MapTransform, Transform
  from monai.utils import optional_import
  from monai.utils.enums import HoVerNetBranch
label_desc: Use image node_id 1 to create a new Watershedd object from inherited base classes: MapTransform with example: obj = Watershedd(keys, mask_key, markers_key, connectivity, dtype, allow_missing_keys)