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

Method test_value

tests/transforms/test_crop_foreground.py:103–112  ·  view source on GitHub ↗
(self, arguments, image, expected_data, _)

Source from the content-addressed store, hash-verified

101class TestCropForeground(unittest.TestCase):
102 @parameterized.expand(TEST_COORDS + TESTS)
103 def test_value(self, arguments, image, expected_data, _):
104 cropper = CropForeground(**arguments)
105 result = cropper(image)
106 assert_allclose(result, expected_data, type_test=False)
107 self.assertIsInstance(result, MetaTensor)
108 self.assertEqual(len(result.applied_operations), 1)
109 inv = cropper.inverse(result)
110 self.assertIsInstance(inv, MetaTensor)
111 self.assertEqual(inv.applied_operations, [])
112 self.assertTupleEqual(inv.shape, image.shape)
113
114 @parameterized.expand(TEST_COORDS)
115 def test_return_coords(self, arguments, image, _expected_data, _align_corners):

Callers

nothing calls this directly

Calls 3

inverseMethod · 0.95
CropForegroundClass · 0.90
assert_allcloseFunction · 0.90

Tested by

no test coverage detected