code: def __call__(self, data):
      for k in self.keys:
          i = data[k].long()
          # one hot if necessary
          is_onehot = i.shape[0] > 1
          if is_onehot:
              out = torch.zeros_like(i)
          else:
              out = torch.nn.functional.one_hot(
                  i, len(self.label_names) + 1
              )  # plus background
              out = torch.movedim(out[0], -1, 0)
              out.fill_(0.0)
              out = out.float()
  
          # loop over all segmentation classes
          for seg_class in torch.unique(i):
              # skip background
              if seg_class == 0:
                  continue
              # get CoM for given segmentation class
              centre = [
                  np.average(indices.cpu()).astype(int)
                  for indices in torch.where(i[0] == seg_class)
              ]
              label_num = seg_class.item()
              centre.insert(0, label_num)
              out[tuple(centre)] = 1.0
              sigma = 1.6 + (label_num - 1.0) * 0.1
              # Gaussian smooth
              out[label_num] = GaussianSmooth(sigma)(
                  out[label_num].cuda()
              ).cpu()
              # Normalize to [0,1]
              out[label_num] = ScaleIntensity()(out[label_num])
              out[label_num] = out[label_num] * self.gamma
  
          # TO DO: Keep the centroids in the data dictionary?
  
          data[k] = out
  
      return data
  
imports: import copy
  import logging
  from typing import Dict, Hashable, Mapping
  import numpy
  import torch
  from monai.config import KeysCollection, NdarrayOrTensor
  from monai.transforms import CropForeground, GaussianSmooth, Randomizable, Resize, ScaleIntensity, SpatialCrop
  from monai.transforms.transform import MapTransform, Transform
label_desc: Use image node_id 2 for calling the VertHeatMap obj's underlying member method code with example usage: obj.__call__(data) and returns: data