Skip to main content

This is nwbwidgets, widgets for viewing the contents of a NWB-file in Jupyter Notebooks using ipywidgets.

Project description

nwb-jupyter-widgets

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.

PyPI version codecov License

authors: Ben Dichter (bdichter@lbl.gov) and Matt McCormick (matt.mccormick@kitware.com)

Installation

pip install nwbwidgets

Usage

from pynwb import NWBHDF5IO
from nwbwidgets import nwb2widget

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

nwb2widget(nwb)

Demo

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

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

nwbwidgets-0.2.1.tar.gz (42.5 kB view details)

Uploaded Source

Built Distribution

nwbwidgets-0.2.1-py2.py3-none-any.whl (36.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file nwbwidgets-0.2.1.tar.gz.

File metadata

  • Download URL: nwbwidgets-0.2.1.tar.gz
  • Upload date:
  • Size: 42.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for nwbwidgets-0.2.1.tar.gz
Algorithm Hash digest
SHA256 550fbb4cd1687cff1a7725b3d3c8af59c76dc2488c2424d243fde0c6ac7e6835
MD5 d7ef9f6faad79983b2f86bbdb4170d24
BLAKE2b-256 0e0677da899394d99ad5957477b07bb637089d774a2c9e8c41884213378732fe

See more details on using hashes here.

File details

Details for the file nwbwidgets-0.2.1-py2.py3-none-any.whl.

File metadata

  • Download URL: nwbwidgets-0.2.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 36.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for nwbwidgets-0.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8e80ae0560b7f64fc13d053ce401f0a41f35a1c4a41c5a59697f03c0830a1605
MD5 5abd72a4929b27451c19feb7d4a53c2f
BLAKE2b-256 a926ea9fe51ad9e61d884b3bb7243631f477898be36cd440ea60d64a874a9b43

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page