code: def test_correct_results(self, spatial_size, mode, anti_aliasing):
      init_param = {
          "keys": "img",
          "spatial_size": spatial_size,
          "mode": mode,
          "anti_aliasing": anti_aliasing,
          "dtype": np.float32,
      }
      resize = Resized(**init_param)
      _order = 0
      if mode.endswith("linear"):
          _order = 1
      if spatial_size == (32, -1):
          spatial_size = (32, 64)
      expected = [
          skimage.transform.resize(
              channel,
              spatial_size,
              order=_order,
              clip=False,
              preserve_range=False,
              anti_aliasing=anti_aliasing,
          )
          for channel in self.imt[0]
      ]
  
      expected = np.stack(expected).astype(np.float32)
      for p in TEST_NDARRAYS_ALL:
          im = p(self.imt[0])
          call_param = {"data": {"img": im}}
          out = resize(**call_param)
          lazy_resize = Resized(**init_param)
          if init_param["mode"] in ("bilinear", "nearest"):
              test_resampler_lazy(
                  lazy_resize,
                  out,
                  init_param,
                  call_param,
                  output_key="img",
                  atol=1e-5,
              )
          test_local_inversion(resize, out, {"img": im}, "img")
          assert_allclose(
              out["img"], expected, type_test=False, atol=1.0
          )
  
file_path: MONAI/tests/test_resized.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import skimage.transform
  import torch
  from parameterized import parameterized
  from monai.data import MetaTensor, set_track_meta
  from monai.transforms import Invertd, Resize, Resized
  from tests.lazy_transforms_utils import test_resampler_lazy
  from tests.utils import TEST_NDARRAYS_ALL, NumpyImageTestCase2D, assert_allclose, test_local_inversion
label_desc: Use image node_id 3 for calling the TestResized obj's underlying member method code with example usage: obj.test_correct_results(spatial_size, mode, anti_aliasing) without return types