Create an online web viewer with napari

hello everyone! this is my first post here on image.sc and my question is in relation to deploying napari as a web viewer. is this possible? i would basically want to have an interactive web viewer for spatial gene expression from our HybISS experiment. this would mean close to a million reads (from 119 genes) and potentially a DAPI
image. it would be great to be able to share the data interactively and i really like the napari viewer.

2 Likes

Hi @Christoffer_Langseth! We love hearing that you like napari!

Having said that it’s not really possible to set it up as a web viewer, since it is a native application that runs locally on your machine, not in a web browser.

However, it’s totally possible to use napari to view remote data, see for example this thread. So if you could serve up your data as an ome-zarr volume, users could install napari and ome-zarr locally and do: napari https://awesome-hybiss-data.org/dataset938293.zarr to view your dataset. If ome-zarr is not the right format, you can create an IO plugin specific for your data type, then users who install napari and your plugin can do napari https://awesome-hybiss-data.org/dataset938293.hybiss to view it. (Though fair warning, it is not trivial to use custom formats over the web.)

If you want to display your data in the browser, though, probably starting from viv is a better bet. This twitter thread gives a good overview.

@manzt might have much more to say on this topic… =)

5 Likes

Napari can be containerized with a VNC-based virtual desktop. See this repository for an example/starting point. The repo uses a modified version of Napari that EMBL used to annotate a Sars-CoV-2 immunofluorescence assay.

(This can also be done with other image analysis software, for example with QuPath).

1 Like

Thanks for pinging me @jni.

We have been working on a web-based viewer specifically for spatial single-cell datasets called vitessce that might be of interest. The imaging component is built on viv, which supports for Zarr and OME-TIFF images, and the spatial component allows the layering of non-image layers (Points, Polygons) in the same coordinate system. Here is an example of an cyclic smFISH experiment with ~2M reads (from 39 genes). If the interactivity is suitable for you desired use case, please reach out! @ilan-gold is currently working on making it easier to configure Vitessce.

One thing to keep in mind is that all derived data (e.g. t-SNE or UMAP projections) must be precomputed. I’d say if your primary goal is to create a (web) sharable “viewer”, give vitessce a shot – we’d love to get more feedback! But if the target audience are individuals who may want the option to tap into the rich python scientific stack, inspect the underlying data, perform clustering on their own, etc, – definitely focus on remote usage of napari because it’s super powerful.

@ngehlenborg @ilan-gold – let me know if I missed anything.

5 Likes

See https://github.com/hms-dbmi/viv for the library and http://avivator.gehlenborglab.org for an OME-TIFF/Bioformats Zarr viewer based on it.

2 Likes

Thank you all so much for all of the suggestions. I will keep you updated on how it goes and hopefully I can share some data soon!

1 Like

Hi @Christoffer_Langseth You may want to also want to take a look at Kaibu which is in early development but the goal is to implement an api similar to napari. We use itk-vtk-viewer by @thewtex et. al. under the hood, and there is also an ongoing PR to integrate viv.

If you feel like you cannot use these online image viewer (viv, kaibu, or itk-vtk-viewer) as is for your deployment, and you need to extend or combine viewers. For example: Launch ImJoy

Also, you may also want to consider using Binder and Google Colab as deployment options.

For Kaibu, we have both supported:
Binder Open In Colab

You may also want to take a look vizarr made by @manzt @ngehlenborg et. al. which works in ImJoy and notebooks.
launch ImJoy Binder Open In Colab

2 Likes