(self)
| 43 | np.testing.assert_allclose(result["img"], np.array([[0, 1], [1, 2]])) |
| 44 | |
| 45 | def test_default_names(self): |
| 46 | input_data = {"img": np.array([[0, 1], [1, 2]]), "seg": np.array([[3, 4], [4, 5]])} |
| 47 | result = CopyItemsd(keys=["img", "seg"], times=2, names=None)(input_data) |
| 48 | for name in ["img_0", "seg_0", "img_1", "seg_1"]: |
| 49 | self.assertTrue(name in result) |
| 50 | |
| 51 | def test_tensor_values(self): |
| 52 | device = torch.device("cuda:0") if torch.cuda.is_available() else torch.device("cpu:0") |
nothing calls this directly
no test coverage detected