Skip to main content

A JupyterLab extension for viewing NIfTI files with Niivue

Project description

JupyterLab NiiVue

WebGL 2.0 medical image viewer for JupyterLab

A JupyterLab extension that uses NiiVue to display neuroimaging files directly in JupyterLab. View NIfTI files, meshes, tractography, and DICOM images with an interactive, hardware-accelerated viewer integrated into your JupyterLab environment.

Installation

Install the extension using pip:

pip install jupyterlab-niivue

Usage

Opening Files

  1. File Browser: Simply double-click any supported neuroimaging file in the JupyterLab file browser
  2. Right-click Menu: Right-click on a file and select "Open With" → "NiiVue Viewer"
  3. Compare Multiple Files: Select multiple files (2 or more), right-click, and choose "Compare in NiiVue" to view them side-by-side in a multi-panel layout

Screenshots

Default view showing a brain volume opened in JupyterLab with the NiiVue viewer

Multiple images opened in compare view

Keyboard Shortcuts

Mouse Controls

  • Right Mouse: Drag to adjust contrast/brightness (windowing); when Zoom button is pressed, drag to zoom
  • Middle Mouse: Drag to pan
  • Mouse Scroll: Change slice in currently hovered image
  • Shift + Mouse: 2D dragging and 3D viewplane rotation

Navigation

  • ← →: Change volume in 4D image
  • V: Cycle through view modes
  • C: Cycle through clip plane orientations in 3D render

Crosshair Movement

  • H: Move crosshair to R (Right)
  • L: Move crosshair to L (Left)
  • J: Move crosshair to P (Posterior)
  • K: Move crosshair to A (Anterior)
  • Ctrl+U: Move crosshair to S (Superior)
  • Ctrl+D: Move crosshair to I (Inferior)

Supported Formats

NiiVue can open several formats popular with brain imaging:

Requirements

  • JupyterLab >= 4.0.0
  • A modern web browser with WebGL 2.0 support (Chrome, Firefox, Edge, Safari)

Troubleshooting

Extension not appearing

If the extension doesn't appear after installation, try:

jupyter labextension list

You should see jupyterlab-niivue in the list. If not, try rebuilding JupyterLab:

jupyter lab build

Files not opening

If files don't open when double-clicked:

  1. Check that the file format is supported (see list above)
  2. Try right-clicking the file and selecting "Open With" → "NiiVue Viewer"
  3. Check the browser console for any error messages

Development

This extension is part of the NiiVue monorepo. Contributions are welcome!

If you encounter issues or have feature requests, please open an issue on GitHub.

Support This Project

If you find this extension useful, please consider supporting its development through a financial contribution:

License

BSD-2-Clause

Credits

  • Built with NiiVue
  • Part of Neurodesk, a flexible and scalable data analysis environment for reproducible neuroimaging
  • Part of the NiiVue ecosystem for neuroimaging visualization

Related Projects

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

jupyterlab_niivue-0.2.8.dev56.tar.gz (3.7 MB view details)

Uploaded Source

Built Distribution

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

jupyterlab_niivue-0.2.8.dev56-py3-none-any.whl (6.7 MB view details)

Uploaded Python 3

File details

Details for the file jupyterlab_niivue-0.2.8.dev56.tar.gz.

File metadata

  • Download URL: jupyterlab_niivue-0.2.8.dev56.tar.gz
  • Upload date:
  • Size: 3.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for jupyterlab_niivue-0.2.8.dev56.tar.gz
Algorithm Hash digest
SHA256 4f1b5cca3213ea8b08bab0839938a7a3a9c57ff7814724a14f946a0cef04e60c
MD5 da4e5e255c7cb5cf51d74d0a2223a6d8
BLAKE2b-256 ae64d2cce633f0732ca5f373f15ed3512ccc69bc2464d79bf0c61dc4b6af99c9

See more details on using hashes here.

File details

Details for the file jupyterlab_niivue-0.2.8.dev56-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyterlab_niivue-0.2.8.dev56-py3-none-any.whl
Algorithm Hash digest
SHA256 32ba8b6e85e0684e5dd3b6e88c0db0a8cf56f60aaaa9f93c7a6564ea5904c216
MD5 5cf431183a96b202f15e4709eb36a657
BLAKE2b-256 6d505b6b22b0380b443e891c2279656ff5fc9e638c2a7df4a92ef26ed125d323

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