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

Method test_spatial_axes

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

Source from the content-addressed store, hash-verified

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))
73 for p in TEST_NDARRAYS_ALL:
74 im = p(self.imt[0])
75 call_param = {"img": im}
76 rotated = rotate(**call_param)
77
78 # test lazy
79 test_resampler_lazy(rotate, rotated, call_param=call_param)
80 rotate.lazy = False
81
82 test_local_inversion(rotate, rotated, im)
83 expected = [np.rot90(channel, 1, (0, -1)) for channel in self.imt[0]]
84 expected = np.stack(expected)
85 assert_allclose(rotated, p(expected), rtol=1.0e-5, atol=1.0e-8, type_test="tensor")
86
87 def test_prob_k_spatial_axes(self):
88 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