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

Function create_data

Wrapping/Python/tests/ConcurrentImageRead.py:27–41  ·  view source on GitHub ↗

Method to create the many temporary images for reading.

(tmp_path, img_extension, img_type)

Source from the content-addressed store, hash-verified

25
26
27def create_data(tmp_path, img_extension, img_type):
28 """Method to create the many temporary images for reading."""
29 n = 64
30 s = 128
31 t = img_type
32
33 files = []
34
35 for i in range(0, n):
36 img = sitk.GaussianSource(t, [s, s], mean=[256 * (i + 1)] * 2)
37 fname = tmp_path / f"g_{i}.{img_extension}"
38 files.append(str(fname))
39 sitk.WriteImage(img, files[-1])
40
41 return files
42
43
44def threaded_read_test(files, expected_hash):

Callers 1

test_threaded_readFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_threaded_readFunction · 0.68