Running NWB widgets on Jupyter
Using Panel
The easiest way to use NWB widgets is with the interactive Panel
:
from nwbwidgets.panel import Panel
Panel()
With Panel
you can easily browser through local files as well as stream remote datasets from DANDI archive.
For data streaming the default mode is fsspec. If you would like to use ROS3 instead, you can do so with:
Panel(stream_mode='ros3')
If you intend to you Panel
only for local storage (no streaming), you can instantiate it as:
Panel(enable_dandi_source=False, enable_s3_source=False)
If you intend to you Panel
only for streaming data (no local storage), you can instantiate it as:
Panel(enable_local_source=False)
Using nwb2widget
If you’re working with a nwb file object in your Jupyter notebook, you can also explore it with NWB Widgets using nwb2widget
:
from pynwb import NWBHDF5IO
from nwbwidgets import nwb2widget
io = NWBHDF5IO('path/to/file.nwb', mode='r')
nwbfile = io.read()
nwb2widget(nwbfile)
This option will also work if the nwbfile
object is streaming data from a remote source.