class_docstr: This provides Inference Engine for pre-trained Segmentation (SegResNet) model.
code: def post_transforms(self, data=None) -> Sequence[Callable]:
      t = [
          EnsureTyped(
              keys="image", device=data.get("device") if data else None
          ),
          Activationsd(keys="pred", softmax=True),
          AsDiscreted(keys="pred", argmax=True),
      ]
  
      if data and data.get("largest_cc", False):
          t.append(KeepLargestConnectedComponentd(keys="pred"))
      t.extend(
          [
              Restored(
                  keys="pred",
                  ref_image="image",
                  config_labels=self.labels
                  if data.get("restore_label_idx", False)
                  else None,
              ),
              GetCentroidsd(keys="pred", centroids_key="centroids"),
          ]
      )
      return t
  
file_path: MONAILabel/sample-apps/radiology/lib/infers/segmentation.py
imports: from typing import Callable, Sequence
  from lib.transforms.transforms import GetCentroidsd
  from monai.inferers import Inferer, SlidingWindowInferer
  from monai.transforms import Activationsd, AsDiscreted, EnsureChannelFirstd, EnsureTyped, GaussianSmoothd, KeepLargestConnectedComponentd, LoadImaged, NormalizeIntensityd, Orientationd, ScaleIntensityd, Spacingd
  from monailabel.interfaces.tasks.infer_v2 import InferType
  from monailabel.tasks.infer.basic_infer import BasicInferTask
  from monailabel.transform.post import Restored
label_desc: Use image node_id 5 for calling the Segmentation obj's underlying member method code with example usage: obj.post_transforms(data) and returns: t