itkwidgets icon indicating copy to clipboard operation
itkwidgets copied to clipboard

Open Zarr File on M1

Open jburel opened this issue 3 years ago • 10 comments

  • Create a conda environment with the required dependencies
  • Run the example below
from zarr.storage import FSStore
from itkwidgets import view
import zarr
fsstore = FSStore('https://dandiarchive.s3.amazonaws.com/zarr/7723d02f-1f71-4553-a7b0-47bda1ae8b42')
brainstem = zarr.open_group(fsstore, mode='r')

view(brainstem)
  • The following message pops up. The git command requires the command line developer tools The tools is not installed.

jburel avatar Oct 05 '22 17:10 jburel

Hi @jburel, thanks for the report!

Currently, itkwidgets 1.X pre-releases provide M1 support. The 1.X refactor is architected on top of NGFF-Zarr.

The example notebook needed a slight update to install fsspec[http] with zsh in #553 .

The 1.X pre-releases are currently only available on PyPI. However, please try this environment.yml, which worked on my M1:

name: itkwidgets-zarr-demo
channels:
  - conda-forge
dependencies:
  - python
  - jupyterlab
  - pip
  - fsspec[http]
  - pip:
    - itkwidgets[lab]>=1.0a15

thewtex avatar Oct 10 '22 17:10 thewtex

Hi @thewtex - thanks for that. I tried with that environment.yml and the image at https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.4/idr0062A/6001240.zarr but didn't get anything to show up, using your demo at https://github.com/ome/ngff/pull/139#issuecomment-1273619930 as an example:

Screenshot 2022-10-13 at 13 46 24

Maybe OME-NGFF images aren't yet supported directly by itkwidgets?

will-moore avatar Oct 13 '22 12:10 will-moore

Hi @will-moore , thanks for testing!

There is a tweak required in your case -- itkwidgets[lab] -> itkwidgets[notebook] for Jupyter Lab vs Jupyter Notebook.

Here is what results (note -- the data does take a while to load from the USA at least -- and we are working on better feedback in the viewer that data is loading).

Untitled_ Oct 13, 2022 10_08 AM.webm

Maybe OME-NGFF images aren't yet supported directly by itkwidgets?

itkwidgets is built around OME-NGFF and will load it directly! :sparkler: If the data is not OME-NGFF, it is dynamically generated on the fly. Details:

https://github.com/InsightSoftwareConsortium/itkwidgets/blob/339b0eef0733675cfb5beb5e307649fa4468680f/itkwidgets/integrations/init.py#L41-L129

thewtex avatar Oct 13 '22 14:10 thewtex

Thanks - that works great!

I also tried a v0.3 OME-NGFF as part of filling out the growing table at https://github.com/will-moore/ngff/blob/ngff_tools_table/ngff-tools.md

https://hms-dbmi.github.io/vizarr/?source=https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.3/idr0079A/9836998.zarr

I got some strange behaviour (don't know if this is v0.3-specific or not)..

To start with I got a low resolution view of the whole image, but as I was viewing it (just rotating and panning, no other settings changed) the higher resolution levels loaded but only showed a cropped part of the image...

Screenshot 2022-10-13 at 16 09 29

Screenshot 2022-10-13 at 16 10 21

Screenshot 2022-10-13 at 16 10 58

Screenshot 2022-10-13 at 16 12 03

Just another thought... I wonder if it would be possible to configure a page like with vizarr above so that I can open an image directly in itkwidgets without needing to run a notebook etc? It would make testing easier and we could then link from all our samples at https://idr.github.io/ome-ngff-samples/ directly to view in itkwidgets!

will-moore avatar Oct 13 '22 15:10 will-moore

Hi @will-moore

I'm helping with this project. Your right, not a great experience with datasets that the viewer does not find scale metadata for. Higher resolution images grow in size as each voxel is 1 unit and the camera does not reset to encompass the new resolution. Then it takes a while to build the portion of the image in view of the camera. Appreciate any advice you have.

I like your link idea. Satisfaction: https://kitware.github.io/itk-vtk-viewer/app/?rotate=false&fileToLoad=https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.4/idr0062A/6001240.zarr

PaulHax avatar Oct 13 '22 22:10 PaulHax

Thanks @PaulHax that's great. I opened a PR to add itk-vtk-viewer links to all the v0.4 Images in https://idr.github.io/ome-ngff-samples/

will-moore avatar Oct 14 '22 10:10 will-moore

Sorry for not responding earlier, I was on annual leave. I will adjust some of my notebooks cc @will-moore

jburel avatar Oct 20 '22 08:10 jburel

@PaulHax @thewtex we are having our community meeting over the next few weeks [1] We have sessions on the 10 of November going over the viewers currently opening zarr files. We will encourage people developing viewers to present their tools (~10mins) and discuss what's needed from the specification point of views. Will you interested to join us? The meeting is free

[1] https://www.openmicroscopy.org/events/ome-community-meeting-2022/

jburel avatar Nov 01 '22 11:11 jburel

@jburel that's fantastic! We are excited to participate!

thewtex avatar Nov 01 '22 14:11 thewtex

Great. Registration closes on Friday 04/11. We will send zoom link and info to the participants

jburel avatar Nov 02 '22 16:11 jburel