(self)
| 32 | |
| 33 | class TestRotate90(NumpyImageTestCase2D): |
| 34 | def test_rotate90_default(self): |
| 35 | rotate = Rotate90() |
| 36 | for p in TEST_NDARRAYS_ALL: |
| 37 | im = p(self.imt[0]) |
| 38 | set_track_meta(True) |
| 39 | call_param = {"img": im} |
| 40 | rotated = rotate(**call_param) |
| 41 | |
| 42 | # test lazy |
| 43 | test_resampler_lazy(rotate, rotated, call_param=call_param) |
| 44 | rotate.lazy = False |
| 45 | |
| 46 | test_local_inversion(rotate, rotated, im) |
| 47 | expected = [np.rot90(channel, 1, (0, 1)) for channel in self.imt[0]] |
| 48 | expected = np.stack(expected) |
| 49 | assert_allclose(rotated, p(expected), rtol=1.0e-5, atol=1.0e-8, type_test="tensor") |
| 50 | set_track_meta(False) |
| 51 | rotated = rotate(im) |
| 52 | self.assertNotIsInstance(rotated, MetaTensor) |
| 53 | set_track_meta(True) |
| 54 | |
| 55 | def test_k(self): |
| 56 | rotate = Rotate90(k=2) |
nothing calls this directly
no test coverage detected