Skip to main content

Launch a Neuroglancer viewer for 3D data stored in a Zarr file.

Project description

This repository contains scripts that launch a Neuroglancer viewer to visualize 3D data stored in a Zarr file, making it accessible via a web browser.

Using Neuroglancer with Zarr files is particularly useful for viewing very large datasets, because the lazy loading scheme prevents the entire array from being loaded into memory.

  • open-zarr-file-remote — run the viewer on a remote machine and view it locally via an SSH tunnel.
  • open-zarr-file_local — run the viewer on the same machine you'll view it on (no SSH tunnel needed).

Remote use: open-zarr-file-remote

In this example, I am using port 9090:

  1. Create the SSH tunnel
ssh -L 9090:localhost:9090 -Y my-remote-machine
  1. Run the script (the port must match the SSH tunnel port)
open-zarr-file-remote 9090 /path/to/file.zarr
  1. This script will print the URL where you can access the neuroglancer viewer on your local machine. It will look something like this: Open in browser: http://localhost:9090/v/14a31d6d2d4d11d95fa35f51daadc97da9100571/. Open the link in your browser on your local machine.

Local use: open-zarr-file-local

When the zarr file lives on the same machine you'll view it on, no SSH tunnel or port is needed — neuroglancer picks a free port itself:

open-zarr-file-local /path/to/file.zarr

The script will print a URL like Open in browser: http://127.0.0.1:46789/v/14a31d6d2d4d11d95fa35f51daadc97da9100571/. Open it in your browser.

Optional resolution argument

Both scripts accept an optional voxel resolution (in nanometers) as the last argument. For example:

open-zarr-file-remote 9090 /path/to/file.zarr 10
open-zarr-file-local /path/to/file.zarr 10

Input file types

This package expects data in the zarr format. Zarr version 3 and zarr version 2 are supported. If using zarr version 2, the data must be saved with name 'data'.

Example of how to save zarr v2 files:

import zarr
root = zarr.open_group("/path/to/file.zarr", mode='w', zarr_format=2)
root.create_array('data', data=array)

neuroglancer-volume-viewer works with zarr files saved using methods from the pyxalign package.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neuroglancer_volume_viewer-0.1.2.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neuroglancer_volume_viewer-0.1.2-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file neuroglancer_volume_viewer-0.1.2.tar.gz.

File metadata

File hashes

Hashes for neuroglancer_volume_viewer-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0b0c090d5076b5f98a6f6bb8dcaba5522e0f624de02b18c3ccb4e067978f3d4e
MD5 22c89d26384997cc8ff21b7cd80b5003
BLAKE2b-256 866d8de1e7909f87a87d59670f9e8cedc0f157bc69c9d4f39e952dfc340c1e55

See more details on using hashes here.

File details

Details for the file neuroglancer_volume_viewer-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for neuroglancer_volume_viewer-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 832ee0d6cd5283b876c058f9bdc079a695bbda2f3678af9703a0786b69029f47
MD5 09841eadb3d428524bdaf7e17cd28621
BLAKE2b-256 e5cfbc347d87a1d16ad2c8a8952d5c1c83a35445bd0bcdc076e7c4366d0e8c1f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page