pynwb.ecephys module

class pynwb.ecephys.ElectrodeGroup(name, description, location, device, position=None)[source]

Bases: pynwb.core.NWBContainer

Parameters:
  • name (str) – the name of this electrode
  • description (str) – description of this electrode group
  • location (str) – description of location of this electrode group
  • device (Device) – the device that was used to record from this electrode group
  • position (ndarray or list or tuple or Dataset or HDMFDataset or AbstractDataChunkIterator) – stereotaxic position of this electrode group (x, y, z)
description

description of this electrode group

location

description of location of this electrode group

device

the device that was used to record from this electrode group

position

stereotaxic position of this electrode group (x, y, z)

namespace = 'core'
neurodata_type = 'ElectrodeGroup'
class pynwb.ecephys.ElectricalSeries(name, data, electrodes, channel_conversion=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)[source]

Bases: pynwb.base.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 dataset
  • data (ndarray or list or tuple or Dataset or HDMFDataset or AbstractDataChunkIterator or DataIO or TimeSeries) – 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 recorded
  • channel_conversion (ndarray or list or tuple or Dataset or HDMFDataset or AbstractDataChunkIterator or DataIO) – 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.
  • resolution (str or float) – The smallest meaningful difference (in specified unit) between values in data
  • conversion (str or float) – Scalar to multiply each element in data to convert it to the specified unit
  • timestamps (ndarray or list or tuple or Dataset or HDMFDataset or AbstractDataChunkIterator or DataIO or TimeSeries) – Timestamps for samples stored in data
  • starting_time (float) – The timestamp of the first sample
  • rate (float) – Sampling rate in Hz
  • comments (str) – Human-readable comments about this TimeSeries dataset
  • description (str) – Description of this TimeSeries dataset
  • control (Iterable) – Numerical labels that apply to each element in data
  • control_description (Iterable) – Description of each control value
electrodes

the electrodes that generated this electrical series

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.

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)[source]

Bases: pynwb.ecephys.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 dataset
  • data (ndarray or list or tuple or Dataset or HDMFDataset or AbstractDataChunkIterator or DataIO or TimeSeries) – The data values. Can be 1D or 2D. The first dimension must be time. The second dimension represents electrodes/channels.
  • timestamps (ndarray or list or tuple or Dataset or HDMFDataset or AbstractDataChunkIterator or DataIO or TimeSeries) – Timestamps for samples stored in data
  • electrodes (DynamicTableRegion) – the table region corresponding to the electrodes from which this series was recorded
  • resolution (str or float) – The smallest meaningful difference (in specified unit) between values in data
  • conversion (str or float) – Scalar to multiply each element in data to convert it to the specified unit
  • comments (str) – Human-readable comments about this TimeSeries dataset
  • description (str) – Description of this TimeSeries dataset
  • control (Iterable) – Numerical labels that apply to each element in data
  • control_description (Iterable) – Description of each control value
namespace = 'core'
neurodata_type = 'SpikeEventSeries'
class pynwb.ecephys.EventDetection(detection_method, source_electricalseries, source_idx, times, name='EventDetection')[source]

Bases: pynwb.core.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 data
  • source_idx (ndarray or list or tuple or Dataset or HDMFDataset or AbstractDataChunkIterator or DataIO) – 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
  • times (ndarray or list or tuple or Dataset or HDMFDataset or AbstractDataChunkIterator or DataIO) – Timestamps of events, in Seconds
  • name (str) – the name of this container
detection_method

Description of how events were detected, such as voltage threshold, or dV/dT threshold, as well as relevant values.

source_electricalseries

The source electrophysiology data

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

times

Timestamps of events, in Seconds

namespace = 'core'
neurodata_type = 'EventDetection'
class pynwb.ecephys.EventWaveform(spike_event_series={}, name='EventWaveform')[source]

Bases: pynwb.core.MultiContainerInterface

Spike data for spike events detected in raw data stored in this NWBFile, or events detect at acquisition

Parameters:
__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:SpikeEventSeries
add_spike_event_series(spike_event_series)

Add a SpikeEventSeries to this EventWaveform

Parameters:spike_event_series (list or tuple or dict or SpikeEventSeries) – the SpikeEventSeries to add
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)

Create a SpikeEventSeries and add it to this EventWaveform

Parameters:
  • name (str) – The name of this TimeSeries dataset
  • data (ndarray or list or tuple or Dataset or HDMFDataset or AbstractDataChunkIterator or DataIO or TimeSeries) – The data values. Can be 1D or 2D. The first dimension must be time. The second dimension represents electrodes/channels.
  • timestamps (ndarray or list or tuple or Dataset or HDMFDataset or AbstractDataChunkIterator or DataIO or TimeSeries) – Timestamps for samples stored in data
  • electrodes (DynamicTableRegion) – the table region corresponding to the electrodes from which this series was recorded
  • resolution (str or float) – The smallest meaningful difference (in specified unit) between values in data
  • conversion (str or float) – Scalar to multiply each element in data to convert it to the specified unit
  • comments (str) – Human-readable comments about this TimeSeries dataset
  • description (str) – Description of this TimeSeries dataset
  • control (Iterable) – Numerical labels that apply to each element in data
  • control_description (Iterable) – Description of each control value
Returns:

the SpikeEventSeries object that was created

Return type:

SpikeEventSeries

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:SpikeEventSeries
namespace = 'core'
neurodata_type = 'EventWaveform'
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: pynwb.core.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

Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc).

num

Cluster number of each event.

peak_over_rms

Maximum ratio of waveform peak to RMS on any channel in the cluster(provides a basic clustering metric).

times

Times of clustered events, in seconds.

namespace = 'core'
neurodata_type = 'Clustering'
class pynwb.ecephys.ClusterWaveforms(clustering_interface, waveform_filtering, waveform_mean, waveform_sd, name='ClusterWaveforms')[source]

Bases: pynwb.core.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 waveforms
  • waveform_filtering (str) – filter applied to data before calculating mean and standard deviation
  • waveform_mean (Iterable) – the mean waveform for each cluster
  • waveform_sd (Iterable) – the standard deviations of waveforms for each cluster
  • name (str) – the name of this container
clustering_interface

the clustered spike data used as input for computing waveforms

waveform_filtering

filter applied to data before calculating mean and standard deviation

waveform_mean

the mean waveform for each cluster

waveform_sd

the standard deviations of waveforms for each cluster

namespace = 'core'
neurodata_type = 'ClusterWaveforms'
class pynwb.ecephys.LFP(electrical_series={}, name='LFP')[source]

Bases: pynwb.core.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:
__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:ElectricalSeries
add_electrical_series(electrical_series)

Add an ElectricalSeries to this LFP

Parameters:electrical_series (list or tuple or dict or ElectricalSeries) – the ElectricalSeries to add
create_electrical_series(name, data, electrodes, channel_conversion=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)

Create an ElectricalSeries and add it to this LFP

Parameters:
  • name (str) – The name of this TimeSeries dataset
  • data (ndarray or list or tuple or Dataset or HDMFDataset or AbstractDataChunkIterator or DataIO or TimeSeries) – 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 recorded
  • channel_conversion (ndarray or list or tuple or Dataset or HDMFDataset or AbstractDataChunkIterator or DataIO) – 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.
  • resolution (str or float) – The smallest meaningful difference (in specified unit) between values in data
  • conversion (str or float) – Scalar to multiply each element in data to convert it to the specified unit
  • timestamps (ndarray or list or tuple or Dataset or HDMFDataset or AbstractDataChunkIterator or DataIO or TimeSeries) – Timestamps for samples stored in data
  • starting_time (float) – The timestamp of the first sample
  • rate (float) – Sampling rate in Hz
  • comments (str) – Human-readable comments about this TimeSeries dataset
  • description (str) – Description of this TimeSeries dataset
  • control (Iterable) – Numerical labels that apply to each element in data
  • control_description (Iterable) – Description of each control value
Returns:

the ElectricalSeries object that was created

Return type:

ElectricalSeries

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:ElectricalSeries
namespace = 'core'
neurodata_type = 'LFP'
class pynwb.ecephys.FilteredEphys(electrical_series={}, name='FilteredEphys')[source]

Bases: pynwb.core.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:
__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:ElectricalSeries
add_electrical_series(electrical_series)

Add an ElectricalSeries to this FilteredEphys

Parameters:electrical_series (list or tuple or dict or ElectricalSeries) – the ElectricalSeries to add
create_electrical_series(name, data, electrodes, channel_conversion=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)

Create an ElectricalSeries and add it to this FilteredEphys

Parameters:
  • name (str) – The name of this TimeSeries dataset
  • data (ndarray or list or tuple or Dataset or HDMFDataset or AbstractDataChunkIterator or DataIO or TimeSeries) – 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 recorded
  • channel_conversion (ndarray or list or tuple or Dataset or HDMFDataset or AbstractDataChunkIterator or DataIO) – 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.
  • resolution (str or float) – The smallest meaningful difference (in specified unit) between values in data
  • conversion (str or float) – Scalar to multiply each element in data to convert it to the specified unit
  • timestamps (ndarray or list or tuple or Dataset or HDMFDataset or AbstractDataChunkIterator or DataIO or TimeSeries) – Timestamps for samples stored in data
  • starting_time (float) – The timestamp of the first sample
  • rate (float) – Sampling rate in Hz
  • comments (str) – Human-readable comments about this TimeSeries dataset
  • description (str) – Description of this TimeSeries dataset
  • control (Iterable) – Numerical labels that apply to each element in data
  • control_description (Iterable) – Description of each control value
Returns:

the ElectricalSeries object that was created

Return type:

ElectricalSeries

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:ElectricalSeries
namespace = 'core'
neurodata_type = 'FilteredEphys'
class pynwb.ecephys.FeatureExtraction(electrodes, description, times, features, name='FeatureExtraction')[source]

Bases: pynwb.core.NWBDataInterface

Features, such as PC1 and PC2, that are extracted from signals stored in a SpikeEvent TimeSeries or other source.

Parameters:
electrodes

the table region corresponding to the electrodes from which this series was recorded

description

A description for each feature extracted

times

The times of events that features correspond to

features

Features for each channel

namespace = 'core'
neurodata_type = 'FeatureExtraction'