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.
authors: Ben Dichter (ben.dichter@catalystneuro.com) 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file nwbwidgets-0.6.0.tar.gz
.
File metadata
- Download URL: nwbwidgets-0.6.0.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.2 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.6.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 765b9399886902fe138e8392685248ef0f7c10c793467ae7746b123d384ad145 |
|
MD5 | e7c4e07f478e7be74fd3a549cd1edec2 |
|
BLAKE2b-256 | 8d600d3a402e576e52e47794c86412aff923bece80313f39d0c14190db046ae3 |
File details
Details for the file nwbwidgets-0.6.0-py3-none-any.whl
.
File metadata
- Download URL: nwbwidgets-0.6.0-py3-none-any.whl
- Upload date:
- Size: 54.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.2 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.6.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78a1f7db335842a82147912982af72528f0317f4d112e0ff699e50870c9edba4 |
|
MD5 | 5045c697df7edc37e65f8cfcfd0dd22c |
|
BLAKE2b-256 | d958334fbc3fa6e6ecea2b748c694014b85864c98dfb5b6b6b1eaf9d18acdc6f |