An open API service indexing awesome lists of open source software.

https://github.com/google/neuroglancer

WebGL-based viewer for volumetric data
https://github.com/google/neuroglancer

Last synced: 14 days ago
JSON representation

WebGL-based viewer for volumetric data

Awesome Lists containing this project

README

        

## Neuroglancer: Web-based volumetric data visualization

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![PyPI](https://img.shields.io/pypi/v/neuroglancer)](https://pypi.org/project/neuroglancer)
![Build](https://github.com/google/neuroglancer/actions/workflows/build.yml/badge.svg)
[![DOI](https://zenodo.org/badge/59798355.svg)](https://zenodo.org/badge/latestdoi/59798355)

Neuroglancer is a WebGL-based viewer for volumetric data. It is capable of displaying arbitrary (non axis-aligned) cross-sectional views of volumetric data, as well as 3-D meshes and line-segment based models (skeletons).

Refer to the documentation website at https://neuroglancer-docs.web.app for more details.

This is not an official Google product.

# Examples

A live demo is hosted at . (The prior link opens the viewer without any preloaded dataset.) Use the viewer links below to open the viewer preloaded with an example dataset.

The four-pane view consists of 3 orthogonal cross-sectional views as well as a 3-D view (with independent orientation) that displays 3-D models (if available) for the selected objects. All four views maintain the same center position. The orientation of the 3 cross-sectional views can also be adjusted, although they maintain a fixed orientation relative to each other. (Try holding the shift key and either dragging with the left mouse button or pressing an arrow key.)

- [FlyEM Hemibrain](https://www.janelia.org/project-team/flyem/hemibrain) (8x8x8 cubic nanometer resolution). Open viewer

- [FAFB-FFN1 Full Adult Fly Brain Automated Segmentation](https://fafb-ffn1.storage.googleapis.com/landing.html) (4x4x40 cubic nanometer resolution). Open viewer

- Kasthuri et al., 2014. Mouse somatosensory cortex (6x6x30 cubic nanometer resolution). Open viewer.

This dataset was copied from and is made available under the [Open Data Common Attribution License](http://opendatacommons.org/licenses/by/1.0/). Paper: Kasthuri, Narayanan, et al. "Saturated reconstruction of a volume of neocortex." Cell 162.3 (2015): 648-661.

- Janelia FlyEM FIB-25. 7-column Drosophila medulla (8x8x8 cubic nanometer resolution). Open viewer.

This dataset was copied from , and is made available under the [Open Data Common Attribution License](http://opendatacommons.org/licenses/by/1.0/). Paper: Takemura, Shin-ya et al. "Synaptic Circuits and Their Variations within Different Columns in the Visual System of Drosophila." Proceedings of the National Academy of Sciences of the United States of America 112.44 (2015): 13711-13716.

- Example of viewing 2D microscopy (coronal section of rat brain at 325 nanometer resolution). Open viewer. (Use Ctrl+MouseWheel to zoom out)

This image is part of: Olsen et al., 2020. Anterogradely labeled axonal projections from the posterior parietal cortex in rat [Data set]. EBRAINS.

# Supported data sources

Neuroglancer itself is purely a client-side program, but it depends on data being accessible via HTTP in a suitable format. It is designed to easily support many different data sources, and there is existing support for the following data APIs/formats:

- [Neuroglancer precomputed format](src/datasource/precomputed)
- [N5](src/datasource/n5)
- [Zarr v2/v3](src/datasource/zarr)
- [Python in-memory volumes](python/README.md) (with automatic mesh generation)
- BOSS
- DVID
- Render
- Single NIfTI files
- [Deep Zoom images](src/datasource/deepzoom)

# Supported browsers

- Chrome >= 51
- Firefox >= 46
- Safari >= 15.0

# Keyboard and mouse bindings

For the complete set of bindings, see
[src/ui/default_input_event_bindings.ts](src/ui/default_input_event_bindings.ts),
or within Neuroglancer, press `h` or click on the button labeled `?` in the upper right corner.

- Click on a layer name to toggle its visibility.

- Double-click on a layer name to edit its properties.

- Hover over a segmentation layer name to see the current list of objects shown and to access the opacity sliders.

- Hover over an image layer name to access the opacity slider and the text editor for modifying the [rendering code](src/sliceview/image_layer_rendering.md).

# Troubleshooting

- Neuroglancer doesn't appear to load properly.

Neuroglancer requires WebGL (2.0) and the `EXT_color_buffer_float` extension.

To troubleshoot, check the developer console, which is accessed by the keyboard shortcut `control-shift-i` in Firefox and Chrome. If there is a message regarding failure to initialize WebGL, you can take the following steps:

- Chrome

Check `chrome://gpu` to see if your GPU is blacklisted. There may be a flag you can enable to make it work.

- Firefox

Check `about:support`. There may be webgl-related properties in `about:config` that you can change to make it work. Possible settings:

- `webgl.disable-fail-if-major-performance-caveat = true`
- `webgl.force-enabled = true`
- `webgl.msaa-force = true`

- Failure to access a data source.

As a security measure, browsers will in many prevent a webpage from accessing the true error code associated with a failed HTTP request. It is therefore often necessary to check the developer tools to see the true cause of any HTTP request error.

There are several likely causes:

- [Cross-origin resource sharing (CORS)](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)

Neuroglancer relies on cross-origin requests to retrieve data from third-party servers. As a security measure, if an appropriate `Access-Control-Allow-Origin` response header is not sent by the server, browsers prevent webpages from accessing any information about the response from a cross-origin request. In order to make the data accessible to Neuroglancer, you may need to change the cross-origin request sharing (CORS) configuration of the HTTP server.

- Accessing an `http://` resource from a Neuroglancer client hosted at an `https://` URL

As a security measure, recent versions of Chrome and Firefox prohibit webpages hosted at `https://` URLs from issuing requests to `http://` URLs. As a workaround, you can use a Neuroglancer client hosted at a `http://` URL, e.g. the demo client running at http://neuroglancer-demo.appspot.com, or one running on localhost. Alternatively, you can start Chrome with the `--disable-web-security` flag, but that should be done only with extreme caution. (Make sure to use a separate profile, and do not access any untrusted webpages when running with that flag enabled.)

# Multi-threaded architecture

In order to maintain a responsive UI and data display even during rapid navigation, work is split between the main UI thread (referred to as the "frontend") and a separate WebWorker thread (referred to as the "backend"). This introduces some complexity due to the fact that current browsers:

- do not support any form of _shared_ memory or standard synchronization mechanism (although they do support relatively efficient _transfers_ of typed arrays between threads);
- require that all manipulation of the DOM and the WebGL context happens on the main UI thread.

The "frontend" UI thread handles user actions and rendering, while the "backend" WebWorker thread handle all queuing, downloading, and preprocessing of data needed for rendering.

# Documentation Index

- [Image Layer Rendering](src/sliceview/image_layer_rendering.md)
- [Cross-sectional view implementation architecture](src/sliceview/README.md)
- [Compressed segmentation format](src/sliceview/compressed_segmentation/README.md)
- [Data chunk management](src/chunk_manager/)
- [On-GPU hashing](src/gpu_hash/)

# Building

node.js is required to build the viewer.

1. First install NVM (node version manager) per the instructions here:

https://github.com/creationix/nvm

2. Install a recent version of Node.js if you haven't already done so:

`nvm install stable`

3. Install the dependencies required by this project:

(From within this directory)

`npm i`

Also re-run this any time the dependencies listed in [package.json](package.json) may have
changed, such as after checking out a different revision or pulling changes.

4. To run a local server for development purposes:

`npm run dev-server`

This will start a server on .

5. To run the unit test suite on Chrome:

`npm test`

6. See [package.json](package.json) for other commands available.

# Discussion Group

There is a Google Group/mailing list for discussion related to Neuroglancer:
.

# Related Projects

- [Panel-Neuroglancer](https://github.com/panel-extensions/panel-neuroglancer) - Integrate Neuroglancer into Jupyter notebook workflows and Python web apps with this HoloViz Panel extension.
- [TensorStore](https://github.com/google/tensorstore) - C++ and Python library for efficiently
reading and writing multi-dimensional arrays in formats supported by Neuroglancer.
- [4Quant/neuroglancer-docker](https://github.com/4Quant/neuroglancer-docker) - Example setup for
Docker deployment of the [Neuroglancer Python integration](python/README.md).
- [FZJ-INM1-BDA/neuroglancer-scripts](https://github.com/FZJ-INM1-BDA/neuroglancer-scripts) -
Scripts for converting the [BigBrain](https://bigbrain.loris.ca) dataset to the
Neuroglancer [precomputed data format](src/datasource/precomputed), which may serve
as a useful example for converting other datasets.
- [BigArrays.jl](https://github.com/seung-lab/BigArrays.jl) - Julia interface of neuroglancer precomputed data format.
- [cloudvolume](https://github.com/seung-lab/cloud-volume) - Python interface of neuroglancer precomputed data format.
- [multiresolution-mesh-creator](https://github.com/janelia-cosem/multiresolution-mesh-creator) - Python tool for creating [multi-resolution meshes](https://github.com/google/neuroglancer/blob/master/src/datasource/precomputed/meshes.md#multi-resolution-mesh-format) from single resolution - or multiscale - meshes.
- [Igneous](https://github.com/seung-lab/igneous) - Python pipeline for scalable meshing, skeletonizing, downsampling, and managment of large 3d images focusing on Neuroglancer Precomputed format.

# Contributing

Want to contribute? Great! First, read [CONTRIBUTING.md](CONTRIBUTING.md).

# License

Copyright 2016 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this software except in compliance with the License.
You may obtain a copy of the License at .

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.