(self)
| 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)) |
nothing calls this directly
no test coverage detected