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

Method test_iter_patch

tests/data/test_grid_dataset.py:68–76  ·  view source on GitHub ↗
(self, in_type, cb)

Source from the content-addressed store, hash-verified

66
67 @parameterized.expand(TEST_CASES_ITER_PATCH)
68 def test_iter_patch(self, in_type, cb):
69 shape = (10, 30, 30)
70 input_img = in_type(get_arange_img(shape))
71 for p, _ in iter_patch(input_img, patch_size=(None, 10, 30, None), copy_back=cb):
72 p += 1.0
73 assert_allclose(p, in_type(get_arange_img(shape)) + 1.0, type_test=True, device_test=True)
74 assert_allclose(
75 input_img, in_type(get_arange_img(shape)) + (1.0 if cb else 0.0), type_test=True, device_test=True
76 )
77
78 @parameterized.expand(TEST_CASES_PATCH_ITER)
79 def test_patch_iter(self, in_type, input_parameters, image, expected, coords):

Callers

nothing calls this directly

Calls 3

get_arange_imgFunction · 0.90
iter_patchFunction · 0.90
assert_allcloseFunction · 0.90

Tested by

no test coverage detected