code: def test_correct_results(
      self, im_type, angle, keep_size, mode, padding_mode, align_corners
  ):
      init_param = {
          "angle": [angle, 0, 0],
          "keep_size": keep_size,
          "mode": mode,
          "padding_mode": padding_mode,
          "align_corners": align_corners,
          "dtype": np.float64,
      }
      rotate_fn = Rotate(**init_param)
      call_param = {"img": im_type(self.imt[0])}
      rotated = rotate_fn(**call_param)
      test_resampler_lazy(rotate_fn, rotated, init_param, call_param)
      if keep_size:
          np.testing.assert_allclose(self.imt[0].shape, rotated.shape)
      _order = 0 if mode == "nearest" else 1
      if padding_mode == "border":
          _mode = "nearest"
      elif padding_mode == "reflection":
          _mode = "reflect"
      else:
          _mode = "constant"
  
      expected = []
      for channel in self.imt[0]:
          expected.append(
              scipy.ndimage.rotate(
                  channel,
                  -np.rad2deg(angle),
                  (1, 2),
                  not keep_size,
                  order=_order,
                  mode=_mode,
                  prefilter=False,
              )
          )
      expected = np.stack(expected).astype(np.float32)
      rotated = (
          rotated.cpu()
          if isinstance(rotated, torch.Tensor)
          else rotated
      )
      n_good = np.sum(np.isclose(expected, rotated, atol=1e-3))
      self.assertLessEqual(
          expected.size - n_good, 5, "diff at most 5 pixels"
      )
  
file_path: MONAI/tests/test_rotate.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, set_track_meta
  from monai.transforms import Rotate
  from tests.lazy_transforms_utils import test_resampler_lazy
  from tests.utils import HAS_CUPY, TEST_NDARRAYS_ALL, NumpyImageTestCase2D, NumpyImageTestCase3D, test_local_inversion
label_desc: Use image node_id 1 for calling the TestRotate3D 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