AllenCellModeling / napari-aicsimageio

Multiple file format reading directly into napari using pure Python
GNU General Public License v3.0
33 stars 10 forks source link

Problem with reading 2D dataset - Scale vector of length 3 to 2d data #54

Closed sebi06 closed 1 year ago

sebi06 commented 2 years ago

The bug is decribed here:

https://forum.image.sc/t/napari-napari-aicsimageio-faild-to-open-ome-tiff/68942?u=sebi06

evamaxfield commented 2 years ago

Will look at this maybe next week.

toloudis commented 2 years ago

I believe this is an issue for the napari plugin and not aicsimageio - is that correct?

evamaxfield commented 2 years ago

I believe it to be an issue with the plugin not aicsimageio-core

psobolewskiPhD commented 2 years ago

This issue relates to the fact that the original data looks like this:

In [4]: img = aicsimageio.AICSImage(path)
In [5]: img.shape
Out[5]: (1, 1, 1, 2755, 3675)

the plugin squeezes the singletons and returns a 2D array. But the metadata used for the scale info is:

In [9]: img.physical_pixel_sizes
Out[9]: PhysicalPixelSizes(Z=1.0, Y=0.227, X=0.227)

Edit: in contrast, the test files report Z=None in these types of cases, so then it's handled here: https://github.com/AllenCellModeling/napari-aicsimageio/blob/a7aad09296f0e3c9d434112e083bf46e21bb8280/napari_aicsimageio/core.py#L93-L95

I think I have an idea how to fix, will try a PR.

psobolewskiPhD commented 1 year ago

Should be fixed with #60 which has been released. Feel free to re-open if this pops up again.