Skip to content

Commit

Permalink
add code for FeatureExtraction
Browse files Browse the repository at this point in the history
  • Loading branch information
bendichter committed Nov 20, 2024
1 parent 2eeeee6 commit 3cc1ed9
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions docs/gallery/domain/ecephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,26 @@

ecephys_module.add(event_detection)

#######################
# # If you do not want to store the raw voltage traces and only the waveform 'snippets' surrounding spike events,
# # you should use :py:class:`~pynwb.ecephys.SpikeEventSeries` objects.
######################################
# If you do not want to store the raw voltage traces and only the waveform 'snippets' surrounding spike events,
# you should use :py:class:`~pynwb.ecephys.SpikeEventSeries` objects.
#
# NWB also provides a way to store features of spikes, such as principal components, using the
# :py:class:`~pynwb.misc.FeatureExtraction` class.

from pynwb.ecephys import FeatureExtraction

feature_extraction = FeatureExtraction(
name="PCA_features",
electrodes=all_table_region,
description=["PC1", "PC2", "PC3", "PC4"],
times=[.033, .066, .099],
features=np.random.rand(3, 12, 4), # time, channel, feature
)

ecephys_module.add(feature_extraction)

#####################################
# Designating electrophysiology data
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# As mentioned above, :py:class:`~pynwb.ecephys.ElectricalSeries` objects
Expand Down

0 comments on commit 3cc1ed9

Please sign in to comment.