diff options
Diffstat (limited to 'tests/make-input-multipage-readers')
-rwxr-xr-x | tests/make-input-multipage-readers | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/make-input-multipage-readers b/tests/make-input-multipage-readers new file mode 100755 index 0000000..a565122 --- /dev/null +++ b/tests/make-input-multipage-readers @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +import h5py +import numpy as np +import tifffile + + +base = np.ones((15, 128, 128), dtype=np.uint16) * np.arange(15, dtype=np.uint16)[:, np.newaxis, np.newaxis] +fmt = 'multipage-image-{:>02}.{}' + + +for i in range(4): + current = base + i * len(base) + tifffile.imsave(fmt.format(i, 'tif'), current) + with h5py.File(fmt.format(i, 'h5'), 'w') as f: + dset = f.create_dataset('images', data=current) + with open(fmt.format(i, 'raw'), 'wb') as f: + f.write(current.tostring()) |