MCPcopy Index your code
hub / github.com/Project-MONAI/MONAI / test_npz1

Method test_npz1

tests/data/test_numpy_reader.py:39–49  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

37 np.testing.assert_allclose(result[0], test_data)
38
39 def test_npz1(self):
40 test_data1 = np.random.randint(0, 256, size=[3, 4, 4])
41 with tempfile.TemporaryDirectory() as tempdir:
42 filepath = os.path.join(tempdir, "test_data.npy")
43 np.save(filepath, test_data1)
44
45 reader = NumpyReader()
46 result = reader.get_data(reader.read(filepath))
47 np.testing.assert_allclose(result[1]["spatial_shape"], test_data1.shape)
48 np.testing.assert_allclose(result[0].shape, test_data1.shape)
49 np.testing.assert_allclose(result[0], test_data1)
50
51 def test_npz2(self):
52 test_data1 = np.random.randint(0, 256, size=[3, 4, 4])

Callers

nothing calls this directly

Calls 4

get_dataMethod · 0.95
readMethod · 0.95
NumpyReaderClass · 0.90
saveMethod · 0.80

Tested by

no test coverage detected