MCPcopy Create free account
hub / github.com/SimpleITK/SimpleITK / threaded_read_test

Function threaded_read_test

Wrapping/Python/tests/ConcurrentImageRead.py:44–49  ·  view source on GitHub ↗

Reads a list of files with thread parallelism, and verifies the hash of the resulting volume.

(files, expected_hash)

Source from the content-addressed store, hash-verified

42
43
44def threaded_read_test(files, expected_hash):
45 """Reads a list of files with thread parallelism, and verifies the hash of the resulting volume."""
46 p = ThreadPool()
47 img = sitk.JoinSeries(p.map(sitk.ReadImage, files))
48 assert img.GetSize()[2] == len(files)
49 assert sitk.Hash(img) == expected_hash
50
51
52# Test parameters: (extension, expected hash, image type)

Callers 1

test_threaded_readFunction · 0.85

Calls 1

GetSizeMethod · 0.45

Tested by 1

test_threaded_readFunction · 0.68