imageio: imageio v3 api fails to read all frames in a MetaMorph stk file
The following zip file contains a single .stk image stack (https://support.moleculardevices.com/s/article/MetaMorph-Software-TIFF-and-STK-file-formats) with 2 frames: test.zip (I zipped it because github doesn’t support uploading stks but does support zips…) imageio v2 volread reads it fine, but the v3 API only sees the first frame:
In [17]: imageio.volread("test.stk").shape
Out[17]: (2, 290, 364)
In [18]: imageio.v3.imread("test.stk", index=...).shape
Out[18]: (1, 290, 364)
In [19]: len([*imageio.v3.imiter("test.stk")])
Out[19]: 1
(Note that stk files are explicitly listed as supported by the tifffile module.)
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (15 by maintainers)
Commits related to this issue
- Add STK test file A small STK file to test regression on a bug reported in https://github.com/imageio/imageio/issues/802 . This file was provided by @anntzer here https://github.com/imageio/imagei... — committed to imageio/test_images by FirefoxMetzger 2 years ago
- TEST: add regression test for #802 — committed to FirefoxMetzger/imageio by FirefoxMetzger 2 years ago
- TEST: add regression test for #802 (#864) — committed to imageio/imageio by FirefoxMetzger 2 years ago
Here is a small stk file that I hereby allow you to add to the test suite of imageio: movie.zip.
The Molecular Devices support said that they don’t believe that there is any licence that applies to the images and that they “make them available and assume that they will be used for positive applications”. I asked for clarification regarding the online terms of use that @cgohlke found.
In the interest of not stalling for too long, I will go ahead and merge #805 with a regression test that xfails until we have clarity about the applicable copyright.
Just a quick update, I’ve contacted Molecular Devices and asked if we can have some test images to avoid regression on this.
I will wait for about a week and - if I don’t hear anything - I will merge #805 without a regression test, but hopefully we will have some news before that 😃
FWIW, STK files are not regular TIFF. They store “frames” not in separate TIFF pages but contiguously after the image data of the first page, similar to some ImageJ hyperstacks. Use the tifffile series interface to read the image data from all STK frames.
https://github.com/cgohlke/tifffile/blob/525a9a89e74e136eee6f6ffed25825900399f969/tifffile/tifffile.py#L297-L299