zoccoler / napari-flim-phasor-plotter

BSD 3-Clause "New" or "Revised" License
10 stars 1 forks source link

Open tif error #49

Closed baoyi-A closed 3 months ago

baoyi-A commented 9 months ago

I installed napari-flim-phasor as the steps, and type napari in the command line in this env, and try to open a tif image or stack in napari, there's error: TypeError: 'NoneType' object is not subscriptable No matter the tif is 2d or 3d, it both don't work. It's because of 'tif.shaped_metadata = None'. It seems like it can't read my tif's shape properly. What should I do? Also, when I try to drag in ptu file, the napari break down, the window closed itself.

baoyi-A commented 9 months ago

Ah, I directly modified the _reader.py in the napari-flim-phasor, it works now

zoccoler commented 7 months ago

Hi @baoyi-A ! I am glad you figured it out by yourself! Sorry for the late response, I was on leave. If you could explain what exactly was your solution in the _reader.py file, I could check whether I can have it fixed so other users don't run into the same problem in the future.

baoyi-A commented 7 months ago

I simply stop using .shaped_metadata to get the shape. I read the shape directly. I have trouble finding the _reader.py file now, could you tell me the directory of it?

zoccoler commented 7 months ago

Interesting! I am using the tifffile library to check the image shape like this before loading it to memory. Maybe your tif files have no such field in the metadata. If you have an example you could share, I'd like to test it and provide a workaround. Otherwise, the _reader.py file is here (under src/napari_flim_phasor_plotter).

baoyi-A commented 7 months ago

The tiff file is not suported by github, maybe I can send you by email?

zoccoler commented 7 months ago

Sure, please send it to marcelo.zoccoler@tu-dresden.de I will test to open it with the plugin and check what is not working and why

zoccoler commented 7 months ago

Thanks @baoyi-A , I got your data and merged a patch to fix that. Since tif formats are not standardized, it may happen that the full image may be read just to get its shape (this is what happens now with your image). That should be OK if images are not too large and fit into memory.

Please try updating the code, the instalaltion and re-opening the image.

zoccoler commented 3 months ago

I am closing due to inactivity, please re-open in case issue persists.