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

Method test_correct_results

tests/transforms/test_flip.py:50–61  ·  view source on GitHub ↗
(self, _, spatial_axis)

Source from the content-addressed store, hash-verified

48
49 @parameterized.expand(VALID_CASES)
50 def test_correct_results(self, _, spatial_axis):
51 for p in TEST_NDARRAYS_ALL:
52 im = p(self.imt[0])
53 init_param = {"spatial_axis": spatial_axis}
54 flip = Flip(**init_param)
55 expected = [np.flip(channel, spatial_axis) for channel in self.imt[0]]
56 expected = np.stack(expected)
57 call_param = {"img": im}
58 result = flip(**call_param)
59 test_resampler_lazy(flip, result, init_param, call_param)
60 assert_allclose(result, p(expected), type_test="tensor")
61 test_local_inversion(flip, result, im)
62
63 @parameterized.expand(TORCH_CASES)
64 def test_torch(self, spatial_axis, img: torch.Tensor, track_meta: bool, device):

Callers

nothing calls this directly

Calls 5

FlipClass · 0.90
test_resampler_lazyFunction · 0.90
assert_allcloseFunction · 0.90
test_local_inversionFunction · 0.90
flipFunction · 0.85

Tested by

no test coverage detected