class_docstr: FlattenLabeld creates labels per closed object contour (defined by a connectivity). For e.g if there are
  12 small regions of 1's it will delineate them into 12 different label classes
  
  Args:
      connectivity: Max no. of orthogonal hops to consider a pixel/voxel as a neighbor. Refer skimage.measure.label
      allow_missing_keys: don't raise exception if key is missing.
class_docstr_tok: ["FlattenLabeld","creates","labels","per","closed","object","contour","(","defined","by","a","connectivity",")",".","For","e.g","if","there","are","12","small","regions","of","1","'s","it","will","delineate","them","into","12","different","label","classes","Args",":","connectivity",":","Max","no",".","of","orthogonal","hops","to","consider","a","pixel\/voxel","as","a","neighbor",".","Refer","skimage.measure.label","allow_missing_keys",":","do","n't","raise","exception","if","key","is","missing","."]
code: def __call__(self, data):
      d = dict(data)
      for key in self.keys:
          img = (
              convert_to_numpy(d[key])
              if isinstance(d[key], torch.Tensor)
              else d[key]
          )
          d[key] = measure.label(
              img, connectivity=self.connectivity
          ).astype(np.uint8)
      return d
  
imports: from __future__ import annotations
  import math
  from typing import Any
  import numpy
  import torch
  from monai.config import KeysCollection, NdarrayOrTensor
  from monai.networks.layers import GaussianFilter
  from monai.transforms import MapTransform, Randomizable, SpatialPad
  from monai.utils import StrEnum, convert_to_numpy, optional_import
label_desc: Use image node_id 2 for calling the FlattenLabeld obj's underlying member method code with example usage: obj.__call__(data) and returns: d