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.0.tar.gz (5.4 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.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for neuroglancer_volume_viewer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bf31aa91fd982146c3af7a9b3b2be23601b08114c356ea7cdc7561b07b436c5a
MD5 1d72b91ce16ecadf109f9d49b9654089
BLAKE2b-256 0cce9fdc877feaf64d6bdf76e417a371d9897ef105e03e81d4f1431e1d354f2a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for neuroglancer_volume_viewer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed705468e681db823ae7223f25cc4fe75ab6dcf563fda3ddd0bc7d30710857c0
MD5 05009018c9b7f39939566b3961d78aa8
BLAKE2b-256 d177694bf444f0d24d343505ed994102a9282250db93f512aaa73c12f7145b77

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