MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / test_rotate90_default

Method test_rotate90_default

tests/transforms/test_rotate90.py:34–53  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

32
33class 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)

Callers

nothing calls this directly

Calls 6

Rotate90Class · 0.90
set_track_metaFunction · 0.90
test_resampler_lazyFunction · 0.90
test_local_inversionFunction · 0.90
assert_allcloseFunction · 0.90
rotateFunction · 0.85

Tested by

no test coverage detected