pynwb.ecephys module
- class pynwb.ecephys.ElectrodeGroup(name, description, location, device, position=None)[source]
Bases:
NWBContainer
Defines a related group of electrodes.
- Parameters:
name (
str
) – the name of this electrode groupdescription (
str
) – description of this electrode grouplocation (
str
) – description of location of this electrode groupdevice (
Device
) – the device that was used to record from this electrode groupposition (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
) – Compound dataset with stereotaxic position of this electrode group (x, y, z). The data array must have three elements or the dtype of the array must be(float, float, float)
- property description
description of this electrode group
- property device
the device that was used to record from this electrode group
- property location
description of location of this electrode group
- namespace = 'core'
- neurodata_type = 'ElectrodeGroup'
- property position
Compound dataset with stereotaxic position of this electrode group (x, y, z). The data array must have three elements or the dtype of the array must be
(float, float, float)
- class pynwb.ecephys.ElectricalSeries(name, data, electrodes, channel_conversion=None, filtering=None, resolution=-1.0, conversion=1.0, timestamps=None, starting_time=None, rate=None, comments='no comments', description='no description', control=None, control_description=None, offset=0.0)[source]
Bases:
TimeSeries
Stores acquired voltage data from extracellular recordings. The data field of an ElectricalSeries is an int or float array storing data in Volts. TimeSeries::data array structure: [num times] [num channels] (or [num_times] for single electrode).
- Parameters:
name (
str
) – The name of this TimeSeries datasetdata (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
orTimeSeries
) – The data values. Can be 1D or 2D. The first dimension must be time. The second dimension represents electrodes/channels.electrodes (
DynamicTableRegion
) – the table region corresponding to the electrodes from which this series was recordedchannel_conversion (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
) – Channel-specific conversion factor. Multiply the data in the ‘data’ dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the ‘conversion’ attribute of ‘data’ to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.filtering (
str
) – Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be ‘High-pass 4-pole Bessel filter at 500 Hz’. If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be ‘Low-pass filter at 300 Hz’. If a non-standard filter type is used, provide as much detail about the filter properties as possible.resolution (
float
) – The smallest meaningful difference (in specified unit) between values in dataconversion (
float
) – Scalar to multiply each element in data to convert it to the specified unittimestamps (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
orTimeSeries
) – Timestamps for samples stored in datastarting_time (
float
) – The timestamp of the first samplerate (
float
) – Sampling rate in Hzcomments (
str
) – Human-readable comments about this TimeSeries datasetdescription (
str
) – Description of this TimeSeries datasetcontrol (
Iterable
) – Numerical labels that apply to each element in datacontrol_description (
Iterable
) – Description of each control valueoffset (
float
) – Scalar to add to each element in the data scaled by ‘conversion’ to finish converting it to the specified unit.
- property channel_conversion
Channel-specific conversion factor. Multiply the data in the ‘data’ dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the ‘conversion’ attribute of ‘data’ to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.
- property electrodes
the electrodes that generated this electrical series
- property filtering
Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be ‘High-pass 4-pole Bessel filter at 500 Hz’. If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be ‘Low-pass filter at 300 Hz’. If a non-standard filter type is used, provide as much detail about the filter properties as possible.
- namespace = 'core'
- neurodata_type = 'ElectricalSeries'
- class pynwb.ecephys.SpikeEventSeries(name, data, timestamps, electrodes, resolution=-1.0, conversion=1.0, comments='no comments', description='no description', control=None, control_description=None, offset=0.0)[source]
Bases:
ElectricalSeries
Stores “snapshots” of spike events (i.e., threshold crossings) in data. This may also be raw data, as reported by ephys hardware. If so, the TimeSeries::description field should describing how events were detected. All SpikeEventSeries should reside in a module (under EventWaveform interface) even if the spikes were reported and stored by hardware. All events span the same recording channels and store snapshots of equal duration. TimeSeries::data array structure: [num events] [num channels] [num samples] (or [num events] [num samples] for single electrode).
- Parameters:
name (
str
) – The name of this TimeSeries datasetdata (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
orTimeSeries
) – The data values. Can be 1D or 2D. The first dimension must be time. The second dimension represents electrodes/channels.timestamps (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
orTimeSeries
) – Timestamps for samples stored in dataelectrodes (
DynamicTableRegion
) – the table region corresponding to the electrodes from which this series was recordedresolution (
float
) – The smallest meaningful difference (in specified unit) between values in dataconversion (
float
) – Scalar to multiply each element in data to convert it to the specified unitcomments (
str
) – Human-readable comments about this TimeSeries datasetdescription (
str
) – Description of this TimeSeries datasetcontrol (
Iterable
) – Numerical labels that apply to each element in datacontrol_description (
Iterable
) – Description of each control valueoffset (
float
) – Scalar to add to each element in the data scaled by ‘conversion’ to finish converting it to the specified unit.
- namespace = 'core'
- neurodata_type = 'SpikeEventSeries'
- class pynwb.ecephys.EventDetection(detection_method, source_electricalseries, source_idx, times, name='EventDetection')[source]
Bases:
NWBDataInterface
Detected spike events from voltage trace(s).
- Parameters:
detection_method (
str
) – Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.source_electricalseries (
ElectricalSeries
) – The source electrophysiology datasource_idx (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
) – Indices (zero-based) into source ElectricalSeries::data array corresponding to time of event. Module description should define what is meant by time of event (e.g., .25msec before action potential peak, zero-crossing time, etc). The index points to each event from the raw datatimes (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
) – Timestamps of events, in Secondsname (
str
) – the name of this container
- property detection_method
Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.
- namespace = 'core'
- neurodata_type = 'EventDetection'
- property source_electricalseries
The source electrophysiology data
- property source_idx
Indices (zero-based) into source ElectricalSeries::data array corresponding to time of event. Module description should define what is meant by time of event (e.g., .25msec before action potential peak, zero-crossing time, etc). The index points to each event from the raw data
- property times
Timestamps of events, in Seconds
- class pynwb.ecephys.EventWaveform(spike_event_series={}, name='EventWaveform')[source]
Bases:
MultiContainerInterface
Spike data for spike events detected in raw data stored in this NWBFile, or events detect at acquisition
- Parameters:
spike_event_series (
list
ortuple
ordict
orSpikeEventSeries
) – SpikeEventSeries to store in this interfacename (
str
) – the name of this container
- __getitem__(name=None)
Get a SpikeEventSeries from this EventWaveform
- Parameters:
name (
str
) – the name of the SpikeEventSeries- Returns:
the SpikeEventSeries with the given name
- Return type:
- add_spike_event_series(spike_event_series)
Add one or multiple SpikeEventSeries objects to this EventWaveform
- Parameters:
spike_event_series (
list
ortuple
ordict
orSpikeEventSeries
) – one or multiple SpikeEventSeries objects to add to this EventWaveform
- create_spike_event_series(name, data, timestamps, electrodes, resolution=-1.0, conversion=1.0, comments='no comments', description='no description', control=None, control_description=None, offset=0.0)
Create a SpikeEventSeries object and add it to this EventWaveform
- Parameters:
name (
str
) – The name of this TimeSeries datasetdata (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
orTimeSeries
) – The data values. Can be 1D or 2D. The first dimension must be time. The second dimension represents electrodes/channels.timestamps (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
orTimeSeries
) – Timestamps for samples stored in dataelectrodes (
DynamicTableRegion
) – the table region corresponding to the electrodes from which this series was recordedresolution (
float
) – The smallest meaningful difference (in specified unit) between values in dataconversion (
float
) – Scalar to multiply each element in data to convert it to the specified unitcomments (
str
) – Human-readable comments about this TimeSeries datasetdescription (
str
) – Description of this TimeSeries datasetcontrol (
Iterable
) – Numerical labels that apply to each element in datacontrol_description (
Iterable
) – Description of each control valueoffset (
float
) – Scalar to add to each element in the data scaled by ‘conversion’ to finish converting it to the specified unit.
- Returns:
the SpikeEventSeries object that was created
- Return type:
- get_spike_event_series(name=None)
Get a SpikeEventSeries from this EventWaveform
- Parameters:
name (
str
) – the name of the SpikeEventSeries- Returns:
the SpikeEventSeries with the given name
- Return type:
- namespace = 'core'
- neurodata_type = 'EventWaveform'
- property spike_event_series
a dictionary containing the SpikeEventSeries in this EventWaveform
- class pynwb.ecephys.Clustering(description, num, peak_over_rms, times, name='Clustering')[source]
Bases:
NWBDataInterface
DEPRECATED in favor of
Units
. Specifies cluster event times and cluster metric for maximum ratio of waveform peak to RMS on any channel in cluster.- Parameters:
description (
str
) – Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc).num (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
) – Cluster number of each event.peak_over_rms (
Iterable
) – Maximum ratio of waveform peak to RMS on any channel in the cluster(provides a basic clustering metric).times (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
) – Times of clustered events, in seconds.name (
str
) – the name of this container
- property description
Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc).
- namespace = 'core'
- neurodata_type = 'Clustering'
- property num
Cluster number of each event.
- property peak_over_rms
Maximum ratio of waveform peak to RMS on any channel in the cluster(provides a basic clustering metric).
- property times
Times of clustered events, in seconds.
- class pynwb.ecephys.ClusterWaveforms(clustering_interface, waveform_filtering, waveform_mean, waveform_sd, name='ClusterWaveforms')[source]
Bases:
NWBDataInterface
DEPRECATED. ClusterWaveforms was deprecated in Oct 27, 2018 and will be removed in a future release. Please use the Units table to store waveform mean and standard deviation e.g. NWBFile.units.add_unit(…, waveform_mean=…, waveform_sd=…)
Describe cluster waveforms by mean and standard deviation for at each sample.
- Parameters:
clustering_interface (
Clustering
) – the clustered spike data used as input for computing waveformswaveform_filtering (
str
) – filter applied to data before calculating mean and standard deviationwaveform_mean (
Iterable
) – the mean waveform for each clusterwaveform_sd (
Iterable
) – the standard deviations of waveforms for each clustername (
str
) – the name of this container
- property clustering_interface
the clustered spike data used as input for computing waveforms
- namespace = 'core'
- neurodata_type = 'ClusterWaveforms'
- property waveform_filtering
filter applied to data before calculating mean and standard deviation
- property waveform_mean
the mean waveform for each cluster
- property waveform_sd
the standard deviations of waveforms for each cluster
- class pynwb.ecephys.LFP(electrical_series={}, name='LFP')[source]
Bases:
MultiContainerInterface
LFP data from one or more channels. The electrode map in each published ElectricalSeries will identify which channels are providing LFP data. Filter properties should be noted in the ElectricalSeries description or comments field.
- Parameters:
electrical_series (
list
ortuple
ordict
orElectricalSeries
) – ElectricalSeries to store in this interfacename (
str
) – the name of this container
- __getitem__(name=None)
Get an ElectricalSeries from this LFP
- Parameters:
name (
str
) – the name of the ElectricalSeries- Returns:
the ElectricalSeries with the given name
- Return type:
- add_electrical_series(electrical_series)
Add one or multiple ElectricalSeries objects to this LFP
- Parameters:
electrical_series (
list
ortuple
ordict
orElectricalSeries
) – one or multiple ElectricalSeries objects to add to this LFP
- create_electrical_series(name, data, electrodes, channel_conversion=None, filtering=None, resolution=-1.0, conversion=1.0, timestamps=None, starting_time=None, rate=None, comments='no comments', description='no description', control=None, control_description=None, offset=0.0)
Create an ElectricalSeries object and add it to this LFP
- Parameters:
name (
str
) – The name of this TimeSeries datasetdata (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
orTimeSeries
) – The data values. Can be 1D or 2D. The first dimension must be time. The second dimension represents electrodes/channels.electrodes (
DynamicTableRegion
) – the table region corresponding to the electrodes from which this series was recordedchannel_conversion (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
) – Channel-specific conversion factor. Multiply the data in the ‘data’ dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the ‘conversion’ attribute of ‘data’ to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.filtering (
str
) – Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be ‘High-pass 4-pole Bessel filter at 500 Hz’. If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be ‘Low-pass filter at 300 Hz’. If a non-standard filter type is used, provide as much detail about the filter properties as possible.resolution (
float
) – The smallest meaningful difference (in specified unit) between values in dataconversion (
float
) – Scalar to multiply each element in data to convert it to the specified unittimestamps (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
orTimeSeries
) – Timestamps for samples stored in datastarting_time (
float
) – The timestamp of the first samplerate (
float
) – Sampling rate in Hzcomments (
str
) – Human-readable comments about this TimeSeries datasetdescription (
str
) – Description of this TimeSeries datasetcontrol (
Iterable
) – Numerical labels that apply to each element in datacontrol_description (
Iterable
) – Description of each control valueoffset (
float
) – Scalar to add to each element in the data scaled by ‘conversion’ to finish converting it to the specified unit.
- Returns:
the ElectricalSeries object that was created
- Return type:
- property electrical_series
a dictionary containing the ElectricalSeries in this LFP
- get_electrical_series(name=None)
Get an ElectricalSeries from this LFP
- Parameters:
name (
str
) – the name of the ElectricalSeries- Returns:
the ElectricalSeries with the given name
- Return type:
- namespace = 'core'
- neurodata_type = 'LFP'
- class pynwb.ecephys.FilteredEphys(electrical_series={}, name='FilteredEphys')[source]
Bases:
MultiContainerInterface
Ephys data from one or more channels that has been subjected to filtering. Examples of filtered data include Theta and Gamma (LFP has its own interface). FilteredEphys modules publish an ElectricalSeries for each filtered channel or set of channels. The name of each ElectricalSeries is arbitrary but should be informative. The source of the filtered data, whether this is from analysis of another time series or as acquired by hardware, should be noted in each’s TimeSeries::description field. There is no assumed 1::1 correspondence between filtered ephys signals and electrodes, as a single signal can apply to many nearby electrodes, and one electrode may have different filtered (e.g., theta and/or gamma) signals represented.
- Parameters:
electrical_series (
list
ortuple
ordict
orElectricalSeries
) – ElectricalSeries to store in this interfacename (
str
) – the name of this container
- __getitem__(name=None)
Get an ElectricalSeries from this FilteredEphys
- Parameters:
name (
str
) – the name of the ElectricalSeries- Returns:
the ElectricalSeries with the given name
- Return type:
- add_electrical_series(electrical_series)
Add one or multiple ElectricalSeries objects to this FilteredEphys
- Parameters:
electrical_series (
list
ortuple
ordict
orElectricalSeries
) – one or multiple ElectricalSeries objects to add to this FilteredEphys
- create_electrical_series(name, data, electrodes, channel_conversion=None, filtering=None, resolution=-1.0, conversion=1.0, timestamps=None, starting_time=None, rate=None, comments='no comments', description='no description', control=None, control_description=None, offset=0.0)
Create an ElectricalSeries object and add it to this FilteredEphys
- Parameters:
name (
str
) – The name of this TimeSeries datasetdata (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
orTimeSeries
) – The data values. Can be 1D or 2D. The first dimension must be time. The second dimension represents electrodes/channels.electrodes (
DynamicTableRegion
) – the table region corresponding to the electrodes from which this series was recordedchannel_conversion (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
) – Channel-specific conversion factor. Multiply the data in the ‘data’ dataset by these values along the channel axis (as indicated by axis attribute) AND by the global conversion factor in the ‘conversion’ attribute of ‘data’ to get the data values in Volts, i.e, data in Volts = data * data.conversion * channel_conversion. This approach allows for both global and per-channel data conversion factors needed to support the storage of electrical recordings as native values generated by data acquisition systems. If this dataset is not present, then there is no channel-specific conversion factor, i.e. it is 1 for all channels.filtering (
str
) – Filtering applied to all channels of the data. For example, if this ElectricalSeries represents high-pass-filtered data (also known as AP Band), then this value could be ‘High-pass 4-pole Bessel filter at 500 Hz’. If this ElectricalSeries represents low-pass-filtered LFP data and the type of filter is unknown, then this value could be ‘Low-pass filter at 300 Hz’. If a non-standard filter type is used, provide as much detail about the filter properties as possible.resolution (
float
) – The smallest meaningful difference (in specified unit) between values in dataconversion (
float
) – Scalar to multiply each element in data to convert it to the specified unittimestamps (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
orTimeSeries
) – Timestamps for samples stored in datastarting_time (
float
) – The timestamp of the first samplerate (
float
) – Sampling rate in Hzcomments (
str
) – Human-readable comments about this TimeSeries datasetdescription (
str
) – Description of this TimeSeries datasetcontrol (
Iterable
) – Numerical labels that apply to each element in datacontrol_description (
Iterable
) – Description of each control valueoffset (
float
) – Scalar to add to each element in the data scaled by ‘conversion’ to finish converting it to the specified unit.
- Returns:
the ElectricalSeries object that was created
- Return type:
- property electrical_series
a dictionary containing the ElectricalSeries in this FilteredEphys
- get_electrical_series(name=None)
Get an ElectricalSeries from this FilteredEphys
- Parameters:
name (
str
) – the name of the ElectricalSeries- Returns:
the ElectricalSeries with the given name
- Return type:
- namespace = 'core'
- neurodata_type = 'FilteredEphys'
- class pynwb.ecephys.FeatureExtraction(electrodes, description, times, features, name='FeatureExtraction')[source]
Bases:
NWBDataInterface
Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEvent TimeSeries or other source.
- Parameters:
electrodes (
DynamicTableRegion
) – the table region corresponding to the electrodes from which this series was recordeddescription (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
) – A description for each feature extractedtimes (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
) – The times of events that features correspond tofeatures (
ndarray
orlist
ortuple
orDataset
orArray
orStrDataset
orHDMFDataset
orAbstractDataChunkIterator
orDataIO
) – Features for each channelname (
str
) – the name of this container
- property electrodes
the table region corresponding to the electrodes from which this series was recorded
- property description
A description for each feature extracted
- property times
The times of events that features correspond to
- property features
Features for each channel
- namespace = 'core'
- neurodata_type = 'FeatureExtraction'