code: def test_correct_results(
      self, im_type, angle, keep_size, mode, padding_mode, align_corners
  ):
      rotate_fn = Rotated(
          ("img", "seg"),
          [0, 0, angle],
          keep_size,
          (mode, "nearest"),
          padding_mode,
          align_corners,
          dtype=np.float64,
      )
      rotated = rotate_fn(
          {"img": im_type(self.imt[0]), "seg": im_type(self.segn[0])}
      )
      if keep_size:
          np.testing.assert_allclose(
              self.imt[0].shape, rotated["img"].shape
          )
      _order = 0 if mode == "nearest" else 1
      if padding_mode == "border":
          _mode = "nearest"
      elif padding_mode == "reflection":
          _mode = "reflect"
      else:
          _mode = "constant"
      expected = scipy.ndimage.rotate(
          self.imt[0, 0],
          -np.rad2deg(angle),
          (0, 1),
          not keep_size,
          order=_order,
          mode=_mode,
          prefilter=False,
      )
      for k, v in rotated.items():
          rotated[k] = v.cpu() if isinstance(v, torch.Tensor) else v
      good = np.sum(np.isclose(expected, rotated["img"][0], atol=1e-3))
      self.assertLessEqual(
          np.abs(good - expected.size), 5, "diff at most 5 voxels"
      )
  
      expected = scipy.ndimage.rotate(
          self.segn[0, 0],
          -np.rad2deg(angle),
          (0, 1),
          not keep_size,
          order=0,
          mode=_mode,
          prefilter=False,
      )
      expected = np.stack(expected).astype(int)
      if isinstance(rotated["seg"], MetaTensor):
          rotated["seg"] = rotated[
              "seg"
          ].as_tensor()  # pytorch 1.7 compatible
      self.assertLessEqual(
          np.count_nonzero(expected != rotated["seg"][0]), 160
      )
  
file_path: MONAI/tests/test_rotated.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import scipy.ndimage
  import torch
  from parameterized import parameterized
  from monai.config import USE_COMPILED
  from monai.data import MetaTensor
  from monai.transforms import Rotated
  from tests.lazy_transforms_utils import test_resampler_lazy
  from tests.utils import TEST_NDARRAYS_ALL, NumpyImageTestCase2D, NumpyImageTestCase3D, test_local_inversion
label_desc: Use image node_id 1 for calling the TestRotated3DXY obj's underlying member method code with example usage: obj.test_correct_results(im_type, angle, keep_size, mode, padding_mode, align_corners) without return types