question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect image dimensions after reading in 3D+c TIFF

See original GitHub issue

I’m trying to read the following file:

https://www.dropbox.com/s/0ynbscx4cmd5k91/E_z2_512_1um_CONTROL.tif?dl=1

skimage (ie tifffile) reads this correctly, but imageio doesn’t — even though I thought it also used tifffile as a backend for tiffs?

In [1]: import imageio
In [2]: from skimage import io
In [3]: im_iio = imageio.imread('E_z2_512_1um_CONTROL.tif')
In [4]: im_iio.shape
Out[4]: (159, 320, 512)

In [5]: im_ski = io.imread('E_z2_512_1um_CONTROL.tif')
In [6]: im_ski.shape
Out[6]: (53, 320, 512, 3)

What imageio is doing is reading the file in the array order present in the file (plane, channel, row, column), and squashing pln and ch dimensions together, while skimage is behaving as expected and producing two separate dimensions for pln and ch and (maybe a bit more than expected) moving ch to the last dimension, which is the dimension order expected by most scipy packages.

Any ideas about what is going wrong here?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:19 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
blink1073commented, Mar 2, 2017

I’d say adopt the skimage convention.

0reactions
almarkleincommented, May 21, 2017

Attempt at a fix: #255

Read more comments on GitHub >

github_iconTop Results From Across the Web

Big TIFF problem - Engineering - ITK Discourse
Hi, I want to be able to convert (to 8-bit) and compress large 16-bit grayscale 3D images. I've been sent a sample file,...
Read more >
Python image analysis: reading a multidimensional TIFF file ...
The image dimensions are 1024x1024. I can, in principle, read the file with skimage (which I plan to use to further analyse the...
Read more >
Can't load .tif images - Civil 3D Community - Autodesk Forums
I'm trying to import a .tif image into autocad 2013 this image I clipped in ArcMap 10.1 and reprojected. The size of the...
Read more >
"Invalid or Unsupported Image File" when trying to open tiff in ...
I am trying to open .tiff orthos created with Pix4D in AutoCad 2017. When I drag and drop, I have an “invalid or...
Read more >
Lazy loading of TIFF 3D - Usage & Issues - Image.sc Forum
Hello, I am working on a plugin for the previewing of different light sheet microscopes images, and I am trying to lazy load...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found