From 3cc1ed92f3a96485c3ca91920e6efd939d249c1c Mon Sep 17 00:00:00 2001 From: Ben Dichter Date: Wed, 20 Nov 2024 14:27:38 +0100 Subject: [PATCH] add code for FeatureExtraction --- docs/gallery/domain/ecephys.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/docs/gallery/domain/ecephys.py b/docs/gallery/domain/ecephys.py index ee2d69a16..c2fed9804 100644 --- a/docs/gallery/domain/ecephys.py +++ b/docs/gallery/domain/ecephys.py @@ -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