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

Method test_patch_iterd

tests/data/test_grid_dataset.py:87–93  ·  view source on GitHub ↗
(self, in_type, input_parameters, image, expected, coords)

Source from the content-addressed store, hash-verified

85
86 @parameterized.expand(TEST_CASES_PATCH_ITER)
87 def test_patch_iterd(self, in_type, input_parameters, image, expected, coords):
88 image_key = "image"
89 input_dict = {image_key: in_type(image)}
90 patch_iterator = PatchIterd(keys=image_key, **input_parameters)(input_dict)
91 for (result_image_dict, result_loc), expected_patch, coord in zip(patch_iterator, expected, coords):
92 assert_allclose(result_image_dict[image_key], in_type(expected_patch), type_test=True, device_test=True)
93 assert_allclose(result_loc, coord, type_test=True, device_test=True)
94
95 def test_shape(self):
96 # test Iterable input data

Callers

nothing calls this directly

Calls 2

PatchIterdClass · 0.90
assert_allcloseFunction · 0.90

Tested by

no test coverage detected