|
49 | 49 | np.array([[[0, 0, 0, 0, 0], [0, 1, 2, 1, 0], [0, 2, 3, 2, 0], [0, 0, 0, 0, 0]]]), |
50 | 50 | ] |
51 | 51 |
|
| 52 | +TEST_CASE_5 = [ |
| 53 | + {"keys": ["img"], "source_key": "img", "select_fn": lambda x: x > 0, "channel_indices": None, "margin": [2, 1]}, |
| 54 | + {"img": np.array([[[0, 0, 0, 0, 0], [0, 1, 2, 1, 0], [0, 2, 3, 2, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]])}, |
| 55 | + np.array([[[0, 0, 0, 0, 0], [0, 1, 2, 1, 0], [0, 2, 3, 2, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]]), |
| 56 | +] |
| 57 | + |
52 | 58 |
|
53 | 59 | class TestCropForegroundd(unittest.TestCase): |
54 | | - @parameterized.expand([TEST_CASE_1, TEST_CASE_2, TEST_CASE_3, TEST_CASE_4]) |
| 60 | + @parameterized.expand([TEST_CASE_1, TEST_CASE_2, TEST_CASE_3, TEST_CASE_4, TEST_CASE_5]) |
55 | 61 | def test_value(self, argments, image, expected_data): |
56 | 62 | result = CropForegroundd(**argments)(image) |
57 | 63 | np.testing.assert_allclose(result["img"], expected_data) |
|
0 commit comments