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

Method test_default

tests/transforms/test_rand_rotate90.py:26–40  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

24
25class TestRandRotate90(NumpyImageTestCase2D):
26 def test_default(self):
27 rotate = RandRotate90()
28 for p in TEST_NDARRAYS_ALL:
29 rotate.set_random_state(123)
30 im = p(self.imt[0])
31 call_param = {"img": im}
32 rotated = rotate(**call_param)
33 test_local_inversion(rotate, rotated, im)
34 expected = [np.rot90(channel, 0, (0, 1)) for channel in self.imt[0]]
35 expected = np.stack(expected)
36 assert_allclose(rotated, p(expected), rtol=1.0e-5, atol=1.0e-8, type_test="tensor")
37
38 # test lazy
39 test_resampler_lazy(rotate, rotated, call_param=call_param, seed=123)
40 rotate.lazy = False
41
42 def test_k(self):
43 init_param = {"max_k": 2}

Callers

nothing calls this directly

Calls 6

RandRotate90Class · 0.90
test_local_inversionFunction · 0.90
assert_allcloseFunction · 0.90
test_resampler_lazyFunction · 0.90
rotateFunction · 0.85
set_random_stateMethod · 0.45

Tested by

no test coverage detected