Skip to content

Commit

Permalink
have read tutorial link out to NWB Overview and rename with plot_ prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
bendichter committed Aug 15, 2023
1 parent b96e7f8 commit fbd41a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,13 @@
# Open the file in read mode "r",
io = NWBHDF5IO(filepath, mode="r", load_namespaces=True)
nwbfile = io.read()
nwbfile

#######################################
# :py:class:`~pynwb.NWBHDF5IO` can also be used as a context manager:

with NWBHDF5IO(filepath, mode="r", load_namespaces=True) as io:
nwbfile = io.read()
with NWBHDF5IO(filepath, mode="r", load_namespaces=True) as io2:
nwbfile2 = io2.read()

# data accessible here

Expand Down Expand Up @@ -311,7 +312,7 @@
stim_on_times_landscapes = trials_df[
trials_df.category_name == "landscapes"
].stim_on_time
for time in stim_on_times_landscapes[:3]:
for time in stim_on_times_landscapes.iloc[:3]:
img = np.squeeze(
stimulus_presentation.data[
np.where(stimulus_presentation.timestamps[:] == time)
Expand All @@ -333,46 +334,5 @@
# ----------------------
# So far we have explored the NWB file by printing the :py:class:`~pynwb.file.NWBFile`
# object and accessing its attributes, but it may be useful to explore the data in a
# more interactive, visual way.
#
# You can use `NWBWidgets <https://github.com/NeurodataWithoutBorders/nwbwidgets>`_,
# a package containing interactive widgets for visualizing NWB data,
# or you can use the `HDFView <https://www.hdfgroup.org/downloads/hdfview>`_
# tool, which can open any generic HDF5 file, which an NWB file is.
#
# NWBWidgets
# ^^^^^^^^^^
# Install NWBWidgets using pip install:
#
# .. code-block:: bash
#
# $ pip install -U nwbwidgets
#
# Then import the :py:mod:`nwbwidgets` package and run the :py:func:`~nwbwidgets.view.nwb2widget` function on
# the :py:class:`~pynwb.file.NWBFile` object.


from nwbwidgets import nwb2widget

nwb2widget(nwbfile)


####################
#
# .. image:: ../../_static/demo_nwbwidgets.png
# :width: 700
# :alt: inspect nwb file with nwbwidgets
# :align: center
#
#
# HDFView
# ^^^^^^^
# To use `HDFView <https://www.hdfgroup.org/downloads/hdfview>`_ to inspect and explore the NWB file,
# download and install HDFView from `here <https://www.hdfgroup.org/downloads/hdfview>`_
# and then open the NWB file using the application.
#
# .. image:: ../../_static/demo_hdfview.png
# :width: 700
# :alt: inspect nwb file with hdfview
# :align: center
#
# more interactive, visual way. See :ref:`analysistools-explore` for an updated list of programs for
# exploring NWB files.
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ def __call__(self, filename):
'dandi': ('https://dandi.readthedocs.io/en/stable/', None),
'fsspec': ("https://filesystem-spec.readthedocs.io/en/latest/", None),
'nwbwidgets': ("https://nwb-widgets.readthedocs.io/en/latest/", None),
'nwb-overview': ("https://nwb-overview.readthedocs.io/en/latest/", None),
}

extlinks = {
Expand Down

0 comments on commit fbd41a8

Please sign in to comment.