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

Method test_k

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

Source from the content-addressed store, hash-verified

119 assert_allclose(rotated, p(expected), rtol=1.0e-5, atol=1.0e-8, type_test="tensor")
120
121 def test_k(self):
122 rotate = Rotate90(k=2)
123 for p in TEST_NDARRAYS_ALL:
124 im = p(self.imt[0])
125 call_param = {"img": im}
126 rotated = rotate(**call_param)
127
128 # test lazy
129 test_resampler_lazy(rotate, rotated, call_param=call_param)
130 rotate.lazy = False
131
132 test_local_inversion(rotate, rotated, im)
133 expected = [np.rot90(channel, 2, (0, 1)) for channel in self.imt[0]]
134 expected = np.stack(expected)
135 assert_allclose(rotated, p(expected), rtol=1.0e-5, atol=1.0e-8, type_test="tensor")
136
137 def test_spatial_axes(self):
138 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