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

Method test_k

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

Source from the content-addressed store, hash-verified

53 set_track_meta(True)
54
55 def test_k(self):
56 rotate = Rotate90(k=2)
57 for p in TEST_NDARRAYS_ALL:
58 im = p(self.imt[0])
59 call_param = {"img": im}
60 rotated = rotate(**call_param)
61
62 # test lazy
63 test_resampler_lazy(rotate, rotated, call_param=call_param)
64 rotate.lazy = False
65
66 test_local_inversion(rotate, rotated, im)
67 expected = [np.rot90(channel, 2, (0, 1)) for channel in self.imt[0]]
68 expected = np.stack(expected)
69 assert_allclose(rotated, p(expected), rtol=1.0e-5, atol=1.0e-8, type_test="tensor")
70
71 def test_spatial_axes(self):
72 rotate = Rotate90(spatial_axes=(0, -1))

Callers

nothing calls this directly

Calls 5

Rotate90Class · 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