diff options
author | Tomas Farago <sensej007@email.cz> | 2021-12-01 16:31:45 +0100 |
---|---|---|
committer | Tomas Farago <sensej007@email.cz> | 2021-12-01 17:15:03 +0100 |
commit | 9d37808d929b69d1526362ddc17f60774c08ac54 (patch) | |
tree | aa0070093494a79bb356d43f89d2b1e7a89e88ab /tests/make-input-multipage-readers | |
parent | 32f25d2f2095c13110640f27c99d0c95f2d49255 (diff) | |
download | ufo-filters-9d37808d929b69d1526362ddc17f60774c08ac54.tar.gz ufo-filters-9d37808d929b69d1526362ddc17f60774c08ac54.tar.bz2 ufo-filters-9d37808d929b69d1526362ddc17f60774c08ac54.tar.xz ufo-filters-9d37808d929b69d1526362ddc17f60774c08ac54.zip |
Test multi-image readers
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()) |