pynwb.ecephys module

class pynwb.ecephys.Device(name, source, parent=None)

Bases: pynwb.core.NWBContainer

Parameters:
  • name (str) – the name of this device
  • source (str) – the source of the data
  • parent (NWBContainer) – The parent NWBContainer for this NWBContainer
namespace = 'core'
neurodata_type = 'Device'
class pynwb.ecephys.ElectrodeGroup(name, source, description, location, device, parent=None)

Bases: pynwb.core.NWBContainer

Parameters:
  • name (str) – the name of this electrode
  • source (str) – the source of the data
  • 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
  • parent (NWBContainer) – The parent NWBContainer for this NWBContainer
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

namespace = 'core'
neurodata_type = 'ElectrodeGroup'
class pynwb.ecephys.ElectrodeTable(name, data=[])

Bases: pynwb.core.NWBTable

A table of all electrodes

Parameters:
  • name (str) – the name of this container
  • data (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset) – the source of the data
add_row(id, x, y, z, imp, location, filtering, description, group, group_name=None)
Parameters:
  • id (int) – a unique identifier for the electrode
  • x (float) – the x coordinate of the position
  • y (float) – the y coordinate of the position
  • z (float) – the z coordinate of the position
  • imp (float) – the impedance of the electrode
  • location (str) – the location of electrode within the subject e.g. brain region
  • filtering (str) – description of hardware filtering
  • description (str) – a brief description of what this electrode is
  • group (ElectrodeGroup) – the ElectrodeGroup object to add to this NWBFile
  • group_name (str) – the ElectrodeGroup object to add to this NWBFile
namespace = 'core'
neurodata_type = 'ElectrodeTable'
class pynwb.ecephys.ElectrodeTableRegion(table, region, description, name='electrodes')

Bases: pynwb.core.NWBTableRegion

A subsetting of an ElectrodeTable

Parameters:
  • table (ElectrodeTable) – the ElectrodeTable this region applies to
  • region (slice or list or tuple or RegionReference) – the indices of the table
  • description (str) – a brief description of what this electrode is
  • name (str) – the name of this container
description

a brief description of what this electrode is

namespace = 'core'
neurodata_type = 'ElectrodeTableRegion'
class pynwb.ecephys.ElectricalSeries(name, source, data, electrodes, resolution=0.0, conversion=1.0, timestamps=None, starting_time=None, rate=None, comments='no comments', description='no description', control=None, control_description=None, parent=None)

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
  • source (str) – Name of TimeSeries or Modules that serve as the source for the data contained here. It can also be the name of a device, for stimulus or acquisition data
  • data (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset or TimeSeries) – The data this TimeSeries dataset stores. Can also store binary data e.g. image frames
  • electrodes (ElectrodeTableRegion) – the table region corresponding to the electrodes from which this series was recorded
  • resolution (float) – The smallest meaningful difference (in specified unit) between values in data
  • conversion (float) – Scalar to multiply each element by to conver to volts
  • timestamps (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset 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
  • parent (NWBContainer) – The parent NWBContainer for this NWBContainer
electrodes

the electrodes that generated this electrical series

namespace = 'core'
neurodata_type = 'ElectricalSeries'
class pynwb.ecephys.SpikeEventSeries(name, source, data, timestamps, electrodes, resolution=0.0, conversion=1.0, comments='no comments', description='no description', control=None, control_description=None, parent=None)

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
  • source (str) – Name of TimeSeries or Modules that serve as the source for the data contained here. It can also be the name of a device, for stimulus or acquisition data
  • data (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset or TimeSeries) – The data this TimeSeries dataset stores. Can also store binary data e.g. image frames
  • timestamps (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset or TimeSeries) – Timestamps for samples stored in data
  • electrodes (ElectrodeTableRegion) – the table region corresponding to the electrodes from which this series was recorded
  • resolution (float) – The smallest meaningful difference (in specified unit) between values in data
  • conversion (float) – Scalar to multiply each element by to conver to volts
  • 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
  • parent (NWBContainer) – The parent NWBContainer for this NWBContainer
namespace = 'core'
neurodata_type = 'SpikeEventSeries'
class pynwb.ecephys.EventDetection(source, detection_method, source_electricalseries, source_idx, times, name='EventDetection')

Bases: pynwb.core.NWBDataInterface

Detected spike events from voltage trace(s).

Parameters:
  • source (str) – the source of the data
  • 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 AbstractDataChunkIterator or DataIO or FORMDataset) – 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 AbstractDataChunkIterator or DataIO or FORMDataset) – 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(source, spike_event_series={}, name='EventWaveform')

Bases: pynwb.core.MultiContainerInterface

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

Parameters:
  • source (str) – the source of the data
  • spike_event_series (list or tuple or dict or SpikeEventSeries) – SpikeEventSeries to store in this interface
  • name (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: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, source, data, timestamps, electrodes, resolution=0.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
  • source (str) – Name of TimeSeries or Modules that serve as the source for the data contained here. It can also be the name of a device, for stimulus or acquisition data
  • data (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset or TimeSeries) – The data this TimeSeries dataset stores. Can also store binary data e.g. image frames
  • timestamps (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset or TimeSeries) – Timestamps for samples stored in data
  • electrodes (ElectrodeTableRegion) – the table region corresponding to the electrodes from which this series was recorded
  • resolution (float) – The smallest meaningful difference (in specified unit) between values in data
  • conversion (float) – Scalar to multiply each element by to conver to volts
  • 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 container

class pynwb.ecephys.Clustering(source, description, num, peak_over_rms, times, name='Clustering')

Bases: pynwb.core.NWBDataInterface

Specifies cluster event times and cluster metric for maximum ratio of waveform peak to RMS on any channel in cluster.

Parameters:
  • source (str) – The source of the data
  • description (str) – Description of clusters or clustering, (e.g. cluster 0 is noise, clusters curated using Klusters, etc).
  • num (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset) – 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 or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset) – Times of clustered events, in seconds.
  • name (str) – the name of this container
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(source, clustering_interface, waveform_filtering, waveform_mean, waveform_sd, name='ClusterWaveforms')

Bases: pynwb.core.NWBDataInterface

Describe cluster waveforms by mean and standard deviation for at each sample.

Parameters:
  • source (str) – the source of the data
  • 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(source, electrical_series={}, name='LFP')

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:
  • source (str) – the source of the data
  • electrical_series (list or tuple or dict or ElectricalSeries) – ElectricalSeries to store in this interface
  • name (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: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, source, data, electrodes, resolution=0.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
  • source (str) – Name of TimeSeries or Modules that serve as the source for the data contained here. It can also be the name of a device, for stimulus or acquisition data
  • data (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset or TimeSeries) – The data this TimeSeries dataset stores. Can also store binary data e.g. image frames
  • electrodes (ElectrodeTableRegion) – the table region corresponding to the electrodes from which this series was recorded
  • resolution (float) – The smallest meaningful difference (in specified unit) between values in data
  • conversion (float) – Scalar to multiply each element by to conver to volts
  • timestamps (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset 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 container

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(source, electrical_series={}, name='FilteredEphys')

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:
  • source (str) – the source of the data
  • electrical_series (list or tuple or dict or ElectricalSeries) – ElectricalSeries to store in this interface
  • name (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: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, source, data, electrodes, resolution=0.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
  • source (str) – Name of TimeSeries or Modules that serve as the source for the data contained here. It can also be the name of a device, for stimulus or acquisition data
  • data (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset or TimeSeries) – The data this TimeSeries dataset stores. Can also store binary data e.g. image frames
  • electrodes (ElectrodeTableRegion) – the table region corresponding to the electrodes from which this series was recorded
  • resolution (float) – The smallest meaningful difference (in specified unit) between values in data
  • conversion (float) – Scalar to multiply each element by to conver to volts
  • timestamps (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset 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 container

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(source, electrodes, description, times, features, name='FeatureExtraction')

Bases: pynwb.core.NWBDataInterface

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

Parameters:
  • source (str) – The source of the data
  • electrodes (ElectrodeTableRegion) – the table region corresponding to the electrodes from which this series was recorded
  • description (list or tuple or ndarray or DataChunkIterator) – A description for each feature extracted
  • times (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset) – The times of events that features correspond to
  • features (ndarray or list or tuple or Dataset or AbstractDataChunkIterator or DataIO or FORMDataset) – Features for each channel
  • name (str) – the name of this container
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'