class_docstr: Generate distance map.
  In general, the instance map is calculated from the distance to the background.
  Here, we use 1 - "instance border map" to generate the distance map.
  Nuclei values form mountains so invert them to get basins.
  
  Args:
      smooth_fn: smoothing function for distance map, which can be any callable object.
          If not provided :py:class:`monai.transforms.GaussianSmooth()` is used.
      dtype: target data type to convert to. Defaults to np.float32.
class_docstr_tok: ["Generate","distance","map",".","In","general",",","the","instance","map","is","calculated","from","the","distance","to","the","background",".","Here",",","we","use","1","-","``","instance","border","map","''","to","generate","the","distance","map",".","Nuclei","values","form","mountains","so","invert","them","to","get","basins",".","Args",":","smooth_fn",":","smoothing","function","for","distance","map",",","which","can","be","any","callable","object",".","If","not","provided",":","py",":","class",":","`","monai.transforms.GaussianSmooth","(",")","`","is","used",".","dtype",":","target","data","type","to","convert","to",".","Defaults","to","np.float32","."]
docstr: Args:
      mask: binary segmentation map, the output of :py:class:`GenerateWatershedMask`.
          Shape must be [1, H, W] or [H, W].
      instance_border: instance border map, the output of :py:class:`GenerateInstanceBorder`.
          Shape must be [1, H, W].
docstr_tok: ["Args",":","mask",":","binary","segmentation","map",",","the","output","of",":","py",":","class",":","`","GenerateWatershedMask","`",".","Shape","must","be","[","1",",","H",",","W","]","or","[","H",",","W","]",".","instance_border",":","instance","border","map",",","the","output","of",":","py",":","class",":","`","GenerateInstanceBorder","`",".","Shape","must","be","[","1",",","H",",","W","]","."]
code: def __call__(self, mask: NdarrayOrTensor, instance_border: NdarrayOrTensor) -> NdarrayOrTensor:  # type: ignore
      """
      Args:
          mask: binary segmentation map, the output of :py:class:`GenerateWatershedMask`.
              Shape must be [1, H, W] or [H, W].
          instance_border: instance border map, the output of :py:class:`GenerateInstanceBorder`.
              Shape must be [1, H, W].
      """
      if len(mask.shape) == 3:
          if mask.shape[0] != 1:
              raise ValueError(
                  f"The mask should have only one channel, but got {mask.shape[0]}."
              )
      elif len(mask.shape) == 2:
          mask = mask[None]
      else:
          raise ValueError(
              f"The mask should have the shape of [1, H, W] or [H, W], but got {mask.shape}."
          )
      if instance_border.shape[0] != 1 or instance_border.ndim != 3:
          raise ValueError(
              f"Input instance_border should be with size of [1, H, W], but got {instance_border.shape}"
          )
  
      distance_map = (1.0 - instance_border) * mask
      distance_map = self.smooth_fn(distance_map)  # type: ignore
  
      return convert_to_dst_type(-distance_map, mask, dtype=self.dtype)[
          0
      ]
  
imports: from __future__ import annotations
  import warnings
  from typing import Callable, Sequence
  import numpy
  import torch
  from monai.config.type_definitions import DtypeLike, NdarrayOrTensor
  from monai.transforms import Activations, AsDiscrete, BoundingRect, FillHoles, GaussianSmooth, RemoveSmallObjects, SobelGradients
  from monai.transforms.transform import Transform
  from monai.transforms.utils_pytorch_numpy_unification import max, maximum, min, sum, unique
  from monai.utils import TransformBackends, convert_to_numpy, optional_import
  from monai.utils.misc import ensure_tuple_rep
  from monai.utils.type_conversion import convert_to_dst_type, convert_to_tensor
label_desc: Use image node_id 2 for calling the GenerateDistanceMap obj's underlying member method code with example usage: obj.__call__(mask, instance_border) and returns: convert_to_dst_type