ome / napari-ome-zarr

A napari plugin for zarr backed OME-NGFF images
https://www.napari-hub.org/plugins/napari-ome-zarr
BSD 3-Clause "New" or "Revised" License
27 stars 21 forks source link

Fail to read multi-image.ome.zarr from local filesystem #63

Closed jkh1 closed 2 years ago

jkh1 commented 2 years ago

Napari fails to open the local file multi-image.ome.zarr obtained from the OME NGFF prototypes with the error:

shape = image[0].shape
AttributeError: 'list' object has no attribute 'shape'

Steps to reproduce: Download and unzip the ome-ngff prototypes from https://oc.embl.de/index.php/s/0TPPw4CUt0G6nng

conda create -y -n napari-env -c conda-forge python=3.9  
conda activate napari-env  
conda install -c conda-forge napari  
pip install napari-ome-zarr  
napari './ome-ngff-prototypes/v0.4/multi-image.ome.zarr'   

However, it works over s3:

napari 'https://s3.embl.de/i2k-2020/ngff-example-data/v0.4/multi-image.ome.zarr'

So not sure if it's a napari plugin problem or a problem with the downloaded files.

sbesson commented 2 years ago

@jkh1 for me, both napari https://s3.embl.de/i2k-2020/ngff-example-data/v0.4/multi-image.ome.zarr and napari ~/Downloads/v0.4/multi-image.ome.zarr work without issues with a fresh download.

I have the following environment

``

(napari) sbesson@sebastiens-mbp ~ % napari --version                            
napari version 0.4.16
(napari) sbesson@sebastiens-mbp ~ % pip freeze | grep zarr                      
napari-ome-zarr==0.5.2
ome-zarr==0.5.2
zarr @ file:///home/conda/feedstock_root/build_artifacts/zarr_1655999983354/work

Does that match your versions?

jkh1 commented 2 years ago

Minor version difference for napari:

~ > napari --version
napari version 0.4.14
~ > pip freeze | grep zarr 
napari-ome-zarr==0.5.2
ome-zarr==0.5.2
zarr @ file:///home/conda/feedstock_root/build_artifacts/zarr_1655999983354/work

I removed the napari conda package (because conda update napari didn't update it) and installed via pip which gave me version 0.4.16. Now napari asks me if I want to use the ome-zarr plugin and if I do it now works and if I don't I get the previous error again.

So it seems that version 0.4.14 doesn't know when to use the plugin for local files and defaults to its built-in reader whereas version 0.4.16 asks the first time which reader to use.

jkh1 commented 2 years ago

Closing as fixed by upgrading napari to 0.4.16