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

Method test_default_names

tests/transforms/test_copy_itemsd.py:45–49  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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")

Callers

nothing calls this directly

Calls 2

CopyItemsdClass · 0.90
arrayMethod · 0.80

Tested by

no test coverage detected