Error when read 3d tiff image stack with skimage.io.imread()

Hi everyone,
I have the following error when I read my tiff image stack with io.imread(). But I still can print the shape and ndim of my images. I am wondering why this happens.

TiffPage 0: TypeError: read_bytes() missing 3 required positional arguments: ‘dtype’, ‘count’, and ‘offsetsize’

Thanks so much.
Peng

1 Like

Hi Peng and welcome to the forum,

Can you please provide a test image and the code that you are using?

Thanks!

Hi Stefanv,
thanks so much. Apparently, tiff image is not authorized for uploading. I am wondering if there is any other way I can share my test tiff image file
The code is just one line to read image. Here is the code:
from skimage import io
img = io.imread(“test.tif”)

Thanks again.

I think you can upload a .zip, so you can zip your tiff file and upload the zip?

I’ve now enabled tiff attachments, so could you please try again?

Thanks so much @stefanv , it’s no longer said tiff is not authorized. But it said new user can not send attachment. :joy:Processing: test.tif…

.zip file is also not authorized. But Stefanv has enabled tiff attachments. thanks

Thanks for bearing with me. New users were barred from uploading images. I updated that limit to 1, and also increased your user level; so, please try again.

thanks so much. test.tif (56.7 KB)

It looks like this error is generated by older versions of tifffile. After doing pip install --upgrade tifffile the error disappears.

thanks so much. it worked. I am wondering how did you find the problem. thanks

I first tried to load the image with imageio and tifffile. I noticed the same problem in both, but realised that imageio must use tifffile under the hood. Then, I was about to file a bug against tifffile, but thought I should at least check whether it had been fixed in the latest version. And, indeed, it has!

1 Like

See also TypeError using imagej_metadata · Issue #103 · cgohlke/tifffile · GitHub.

1 Like

thanks a lot. good to know the thought process.

1 Like