code: def run_transform(self, img, xform_cls, args_dict):
      if isinstance(xform_cls, Transform):
          xform = xform_cls
          output = xform(img, **args_dict)
      else:
          if isinstance(xform_cls, str):
              xform_cls, _ = optional_import(
                  "monai.transforms", name=xform_cls
              )
          if issubclass(xform_cls, MapTransform):
              args_dict.update({"keys": keys})
          xform = xform_cls(**args_dict)
          if isinstance(xform, Randomizable):
              xform.set_random_state(5)
          output = xform(img)
      return output
  
file_path: MONAI/tests/test_meta_affine.py
imports: from __future__ import annotations
  import os
  import unittest
  from copy import deepcopy
  import numpy
  from parameterized import parameterized
  from monai.data.image_writer import ITKWriter
  from monai.transforms import Compose, EnsureChannelFirst, EnsureChannelFirstd, LoadImage, LoadImaged, MapTransform, Orientation, Orientationd, Randomizable, Spacing, Spacingd, Transform
  from monai.utils import convert_data_type, optional_import
  from tests.utils import assert_allclose, download_url_or_skip_test, testing_data_config
label_desc: Use image node_id 2 for calling the TestAffineConsistencyITK obj's underlying member method code with example usage: obj.run_transform(img, xform_cls, args_dict) and returns: output