(self, arguments, image, expected_data, _)
| 101 | class 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): |
nothing calls this directly
no test coverage detected