Skip to main content

NGLui

Documentation

Please find documentation here.

Installation

To get the most out of NGLui (interacting with source info, uploading skeletons, and more), we suggest installing the full version of NGLui, which includes the cloud-volume dependency:

pip install nglui[full]

You can also install a more minimal version of NGLui without the cloud-volume dependency:

pip install nglui

However, note that cloud-volume is required for some features such as uploading skeletons and getting information about sources during state generation.

Quick Usage

Building a Neuroglancer state directly

Here, let's use the Hemibrain dataset information to build a Neuroglancer state.

from nglui import statebuilder

viewer_state = (
    statebuilder.ViewerState(dimensions=[8,8,8])
    .add_image_layer(
        source='precomputed://gs://neuroglancer-janelia-flyem-hemibrain/emdata/clahe_yz/jpeg',
        name='emdata'
    )
    .add_segmentation_layer(
        source='precomputed://gs://neuroglancer-janelia-flyem-hemibrain/v1.2/segmentation',
        name='seg',
        segments=[5813034571],
    )
    .add_annotation_layer(
        source='precomputed://gs://neuroglancer-janelia-flyem-hemibrain/v1.2/synapses',
        linked_segmentation={'pre_synaptic_cell': 'seg'},
        filter_by_segmentation=True,
        color='tomato',
    )
)
viewer_state.to_link(target_url='https://hemibrain-dot-neuroglancer-demo.appspot.com')

This will return the link: Neuroglancer link.

Additional features

NGLui also has additional features such as:

  • CAVE: Broad integrations with existing CAVE tooling.
  • Parser: Parse neuroglancer states to extract information about layers and annotations.
  • SegmentProperties: Easily build segment property lists from data to make segmentation views more discoverable.
  • SkeletonManager: Upload skeletons to cloud buckets and push quickly into neuroglancer (requires cloud-volume, see Installation).
  • Shaders: Support for better default shaders for neuroglancer layers.

Development

If you want to clone the repository and develop on NGLui, note that it uses uv for development and packaging, material for mkdocs for documentation, and pre-commit with ruff for code quality checks. Poe-the-poet is used to simplify repetitive tasks, and you can run poe help to see the available tasks.

Migration from older versions

If you are migrating from nglui v3.x to v4.0.0+, you will need to dramatically update your code.

First and foremost, nglui now only works with contemporary versions of neuroglancer, not the older Seung-lab version. If you still need to support the older deployment, do not upgrade.

Please read the new usage documentation! The main change is that it is now recommended to create states directly where possible, and there are now many more convenience functions. Instead of making a bunch of layer configs, now you make a ViewerState object and directly add layers and their information with functions like add_image_layer, add_segmentation_layer, and add_annotation_layer. Instead of always mapping annotation rules and data separately, you can now directly add annotation data through functions like add_points and then export with functions like to_url. You can still use the old pattern of rendering a state and mapping data with DataMap objects. A new "pipeline" pattern makes it more efficient to build complex states in a smaller number of lines of code.

Download files

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

Source Distribution

nglui-4.8.0.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

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

nglui-4.8.0-py3-none-any.whl (77.2 kB view details)

Uploaded Python 3

File details

Details for the file nglui-4.8.0.tar.gz.

File metadata

  • Download URL: nglui-4.8.0.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for nglui-4.8.0.tar.gz
Algorithm Hash digest
SHA256 de693e76c6ad855cdd66d731f40ccb1901e3cc36c7eebe9276920ad7eb314cb8
MD5 fd16c8b95be46cebad78bcda6c377b85
BLAKE2b-256 8f227795cd7768c24653c9b996c33e2822ebee950486ad976e39c4d7402a3f12

See more details on using hashes here.

File details

Details for the file nglui-4.8.0-py3-none-any.whl.

File metadata

  • Download URL: nglui-4.8.0-py3-none-any.whl
  • Upload date:
  • Size: 77.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for nglui-4.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 564fdd155acdb95646857070b7c9feb9a9a9bcfc70cf42075fc16cede521285e
MD5 00b189dfa4171d4707feba46867e6e4e
BLAKE2b-256 cd13c7bc1219b93dbf1dabf0e512922d3c56ebf3ee5881b37a3b5dbcb56b1111

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

4.8.0 This release

2 files

4.7.4

2 files

4.7.3

2 files

4.7.2

2 files

4.7.1

2 files

4.7.0

2 files

4.6.1

2 files

4.6.0

2 files

4.5.1

2 files

4.5.0

2 files

4.4.2

2 files

4.4.1

2 files

4.4.0

2 files

4.3.3

2 files

4.3.2

2 files

4.3.1

2 files

4.3.0

2 files

4.2.0

2 files

4.1.0

2 files

4.0.0

2 files

3.9.0

2 files

3.8.2

2 files

3.8.1

2 files

3.8.0

2 files

3.7.3

2 files

3.7.2

2 files

3.7.1

2 files

3.7.0

2 files

3.6.2

2 files

3.6.1

2 files

3.6.0

2 files

3.5.2

2 files

3.5.1

2 files

3.5.0

2 files

3.4.0

2 files

3.3.7

2 files

3.3.6

2 files

3.3.5

2 files

3.3.4

2 files

3.3.3

2 files

3.3.2

2 files

3.3.1

2 files

3.3.0

2 files

3.2.1

2 files

3.2.0

2 files

3.1.0

2 files

3.0.3

2 files

3.0.2

2 files

3.0.1

2 files

3.0.0

2 files

2.14.3

2 files

2.14.2

2 files

2.14.1

2 files

2.14.0

2 files

2.13.0

2 files

2.12.1

2 files

2.12.0

2 files

2.11.0

1 file

2.10.1

1 file

2.10.0

1 file

2.9.0

1 file

2.8.1

1 file

2.8.0

1 file

2.7.2

1 file

2.7.1

1 file

2.7.0

1 file

2.6.0

1 file

2.5.0

1 file

2.4.0

1 file

2.3.1

1 file

2.3.0

1 file

2.2.1

1 file

2.2.0

1 file

2.1.1

1 file

2.1.0

1 file

2.0.3

1 file

2.0.2

1 file

2.0.1

1 file

2.0.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page