hms-dbmi / vizarr

A minimal Zarr image viewer based on Viv.
https://hms-dbmi.github.io/vizarr/?source=https://minio-dev.openmicroscopy.org/idr/v0.3/idr0062-blin-nuclearsegmentation/6001240.zarr
MIT License
114 stars 16 forks source link

Getting TypeError: e.store.get is not a function #184

Closed fercer closed 1 month ago

fercer commented 1 month ago

Hi vizarr team, thanks for this amazing work!

I just started getting the following error early this week when trying to visualize Zarr files (stored localy or even remotely e.g. from IDR).

ERROR:RPC:Error in method Error: TypeError: e.store.get is not a function
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/imjoy_rpc/rpc.py", line 404, in _wait
    result = await result
  File "/content/vizarr/example/imjoy_plugin.py", line 23, in run
    await viewer.add_image(img)
Exception: Error: TypeError: e.store.get is not a function

The viewer shows, but the image is not being loaded.

I've reproduced the error by cloning the most recent version of vizarr from this repository and following the steps from the IDR example (vizarr/example/IDR_example.ipynb).

Here are the versions of the packages that I'm using:

python: 3.10.12
imjoy: 0.11.20
imjoy_rpc: 0.5.57
zarr: 2.18.2
fsspec: 2023.6.0
manzt commented 1 month ago

Hi there, thanks for trying out vizarr. I need to update the examples but the preferred way to use vizarr is through the custom Widget (not imJoy) https://github.com/hms-dbmi/vizarr/issues/174#issuecomment-1771739245

manzt commented 1 month ago

I'll work on updating the examples. In the meantime, you should be able to get started with the following (no need to clone this repo, just pip install vizarr)

from fsspec import get_mapper
import zarr

# Create a remote mapping to the data
url = "https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.1/6001240.zarr/"
store = get_mapper(url)
z_grp = zarr.open(store, mode='r')
z_grp
import vizarr # make sure to pip install vizarr
viewer = vizarr.Viewer()
viewer.add_image(source=z_grp)
viewer
fercer commented 1 month ago

Thanks for the prompt answer @manzt!

I installed vizarr from pip and used it as normal python package as you suggested, and it works nicely without issues on my PC.

For some reason it is still not loading when used on colab; however, that might be related to a different reason. Unfortunately the colab notebook does not display any errors, so I can't elaborate on what is failing in the environment.

Thank you!

manzt commented 1 month ago

hmm, I just tried with the link in the readme. I'm not sure what's happen in google colab:

image
manzt commented 1 month ago

I installed vizarr from pip and used it as normal python package as you suggested, and it works nicely without issues on my PC.

Glad it's working for you! I needed a kick to update the notebook materials :) #186

fercer commented 1 month ago

I just tested again in colab and now is working completely. Probably some issue on the environment not related to vizarr.

For completeness, I tested with zarr images stored remotely from IDR, and stored locally, both worked without issues.

Thanks again for your help!

manzt commented 1 month ago

great!