Skip to main content

PyPI version codecov License Binder

NWB Widgets

Explore NWB data in Jupyter

Explore our documentation »

Table of Contents

About

A library of widgets for visualization NWB data in a Jupyter notebook (or lab). The widgets allow you to navigate through the hierarchical structure of the NWB file and visualize specific data elements. It is designed to work out-of-the-box with NWB 2.0 files and to be easy to extend.

Installation

nwbwidgets requires Python >= 3.7.

The latest published version can be installed by running:

pip install nwbwidgets

Note that there are some optional dependencies required for some widgets. If an NWB data file contains a data type that requires additional dependencies, you will see a list of extra modules needed for that specific widget. All other widgets in the file will still work.

Usage

Using Panel

The easiest way to use NWB widgets is with the interactive Panel:

from nwbwidgets.panel import Panel

Panel()

Using nwb2widget

If you’re working directly with a NWB file object in your Jupyter notebook, you can also explore it with NWB Widgets using

from pynwb import NWBHDF5IO
from nwbwidgets import nwb2widget

io = NWBHDF5IO('path/to/file.nwb', mode='r')
nwb = io.read()

nwb2widget(nwb)

Using Docker

You can also run the NWB Widgets Panel using Docker:

$ docker run -p 8866:8866 ghcr.io/NeurodataWithoutBorders/nwbwidgets-panel:latest

Demo

Documentation

See our ReadTheDocs page for full documentation, including a gallery of all supported formats.

How it works

All visualizations are controlled by the dictionary neurodata_vis_spec. The keys of this dictionary are pynwb neurodata types, and the values are functions that take as input that neurodata_type and output a visualization. The visualizations may be of type Widget or matplotlib.Figure. When you enter a neurodata_type instance into nwb2widget, it searches the neurodata_vis_spec for that instance's neurodata_type, progressing backwards through the parent classes of the neurodata_type to find the most specific neurodata_type in neurodata_vis_spec. Some of these types are containers for other types, and create accordian UI elements for its contents, which are then passed into the neurodata_vis_spec and rendered accordingly.

Instead of supplying a function for the value of the neurodata_vis_spec dict, you may provide a dict or OrderedDict with string keys and function values. In this case, a tab structure is rendered, with each of the key/value pairs as an individual tab. All accordian and tab structures are rendered lazily- they are only called with that tab is selected. As a result, you can provide may tabs for a single data type without a worry. They will only be run if they are selected.

Extending

To extend NWBWidgets, all you need to a function that takes as input an instance of a specific neurodata_type class, and outputs a matplotlib figure or a jupyter widget.

Used in

Release files for nwbwidgets 0.11.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nwbwidgets 0.11.3
File Size Uploaded
nwbwidgets-0.11.3.tar.gz 11.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for nwbwidgets 0.11.3
File Interpreter ABI Platform
nwbwidgets-0.11.3-py3-none-any.whl Python 3 none any Details

Total release size: 11.1 MB

Release files / nwbwidgets-0.11.3.tar.gz

Download URL nwbwidgets-0.11.3.tar.gz
Size 11.0 MB
Tags Source
SHA-256 checksum
How to use checksums
a562f60f2495819699c4f19768e79dc9f34b5c82e792908aab8826e784d9d9cd
BLAKE2b-256 checksum
How to use checksums
37c3a50fe984f0018d8861528692ec472a4aed6a863e7173813cf5062c4c1452
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release files / nwbwidgets-0.11.3-py3-none-any.whl

Download URL nwbwidgets-0.11.3-py3-none-any.whl
Size 73.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0128cb7dbf185ed32aef3ce1a164fb3383672ea3c7809a93734394aed9788702
BLAKE2b-256 checksum
How to use checksums
122925f2b8d01f21b7c9d4a0341647674ed3fcac2089349b89cb19f5fd2e25e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release history Release notifications | RSS feed

This release

0.11.3 This release

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.2

2 release files

0.10.0

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.8.0

1 release file

0.7.0

2 release files

0.6.0

2 release files

0.5.1

1 release file

0.5.0

1 release file

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.2

2 release files

0.0.1

2 release files

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