Reads a list of files with thread parallelism, and verifies the hash of the resulting volume.
(files, expected_hash)
| 42 | |
| 43 | |
| 44 | def 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) |