Neuroglancer (web-based)
Neuroglancer
Neuroglancer is a powerful web-based viewer for large image datasets. (Multiple) images can be visualized by simply including URLs to the image data in a neuroglancer link (example), no installation required.
Neuroglancer support in multiview-stitcher
Neuroglancer supports visualizing multiple OME-Zarr files and reads their corresponding scale and translation metadata. Additionally, neuroglancer supports attaching affine transformations to each image. This allows visualizing spatial images (sims
) together with the transforms attached in a given transform_key
.
multiview-stitcher provides the utility function vis_utils.view_neuroglancer
that:
- creates a neuroglancer link given a list of OME-Zarr paths
- serves the OME-Zarrs over http in case they represent local files
- optionally includes transforms from a given transform_key
in the sims
in the neuroglancer link
- opens the neuroglancer link in the browser
Examples
Viewing a list of OME-Zarrs
from multiview_stitcher import vis_utils
ome_zarr_paths = [
"https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.4/idr0101A/13457537.zarr",
"https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.4/idr0101A/13457227.zarr"
]
vis_utils.view_neuroglancer(
ome_zarr_paths=ome_zarr_paths,
)
Viewing a list of spatial images with attached transforms
from multiview_stitcher import ngff_utils, vis_utils
# if not already existing, write sims to OME-Zarrs
# (or "persist" sims to OME-Zarr)
ome_zarr_paths = [f"/tmp/ome_zarr_{isim}.zarr"
for isim in range(len(sims))]
sims = [ngff_utils.write_sim_to_ome_zarr(sim, path)
for zip(path, ome_zarr_paths)]
# view transform_key "registered" using neuroglancer
vis_utils.view_neuroglancer(
ome_zarr_paths=ome_zarr_paths,
sims=sims,
transform_key="registered",
)
Limitation: Both OME-Zarr and neuroglancer currently don't allow assigning different transforms to different time points or channels.
More examples
See the usage of view_neuroglancer
in the NGFF notebooks.