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 __call__(
      self, data: Mapping[Hashable, NdarrayOrTensor]
  ) -> dict[Hashable, NdarrayOrTensor]:
      d = dict(data)
      markers = d[self.markers_key] if self.markers_key else None
      mask = d[self.mask_key] if self.mask_key else None
  
      for key in self.key_iterator(d):
          d[key] = self.transform(d[key], mask, markers)
  
      return d
  
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 2 for calling the Watershedd obj's underlying member method code with example usage: obj.__call__(data) and returns: d