docstr: xform cls testing itk consistency
docstr_tok: ["xform","cls","testing","itk","consistency"]
code: def test_linear_consistent_dict(self, xform_cls, input_dict, atol):
      """xform cls testing itk consistency"""
      img = LoadImaged(keys, image_only=True, simple_keys=True)(
          {keys[0]: FILE_PATH, keys[1]: FILE_PATH_1}
      )
      img = EnsureChannelFirstd(keys)(img)
      ref_1 = {
          k: _create_itk_obj(img[k][0], img[k].affine) for k in keys
      }
      output = self.run_transform(img, xform_cls, input_dict)
      ref_2 = {
          k: _create_itk_obj(output[k][0], output[k].affine)
          for k in keys
      }
      expected = {
          k: _resample_to_affine(ref_1[k], ref_2[k]) for k in keys
      }
      # compare ref_2 and expected results from itk
      diff = {
          k: np.abs(
              itk.GetArrayFromImage(ref_2[k])
              - itk.GetArrayFromImage(expected[k])
          )
          for k in keys
      }
      avg_diff = {k: np.mean(diff[k]) for k in keys}
      for k in keys:
          self.assertTrue(
              avg_diff[k] < atol,
              f"{xform_cls} avg_diff: {avg_diff}, tol: {atol}",
          )
  
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 4 for calling the TestAffineConsistencyITK obj's underlying member method code with example usage: obj.test_linear_consistent_dict(xform_cls, input_dict, atol) without return types