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

Method test_spatial_axes

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

Source from the content-addressed store, hash-verified

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))
139 for p in TEST_NDARRAYS_ALL:
140 im = p(self.imt[0])
141 call_param = {"img": im}
142 rotated = rotate(**call_param)
143
144 # test lazy
145 test_resampler_lazy(rotate, rotated, call_param=call_param)
146 rotate.lazy = False
147
148 test_local_inversion(rotate, rotated, im)
149 expected = [np.rot90(channel, 1, (0, -1)) for channel in self.imt[0]]
150 expected = np.stack(expected)
151 assert_allclose(rotated, p(expected), rtol=1.0e-5, atol=1.0e-8, type_test="tensor")
152
153 def test_prob_k_spatial_axes(self):
154 rotate = Rotate90(k=2, 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