(self)
| 24 | |
| 25 | class TestRandRotate90d(NumpyImageTestCase2D): |
| 26 | def test_default(self): |
| 27 | key = "test" |
| 28 | rotate = RandRotate90d(keys=key) |
| 29 | for p in TEST_NDARRAYS_ALL: |
| 30 | rotate.set_random_state(1323) |
| 31 | im = {key: p(self.imt[0])} |
| 32 | call_param = {"data": im} |
| 33 | rotated = rotate(**call_param) |
| 34 | |
| 35 | # test lazy |
| 36 | test_resampler_lazy(rotate, rotated, call_param=call_param, seed=1323, output_key=key) |
| 37 | rotate.lazy = False |
| 38 | |
| 39 | test_local_inversion(rotate, rotated, im, key) |
| 40 | expected = [np.rot90(channel, 0, (0, 1)) for channel in self.imt[0]] |
| 41 | expected = np.stack(expected) |
| 42 | assert_allclose(rotated[key], p(expected), type_test="tensor") |
| 43 | |
| 44 | set_track_meta(False) |
| 45 | rotated = rotate(im)[key] |
| 46 | self.assertNotIsInstance(rotated, MetaTensor) |
| 47 | self.assertIsInstance(rotated, torch.Tensor) |
| 48 | set_track_meta(True) |
| 49 | |
| 50 | def test_k(self): |
| 51 | key = "test" |
nothing calls this directly
no test coverage detected