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
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
location
device
class pynwb.ecephys.ElectrodeTable(name, data=[])

Bases: pynwb.core.NWBTable

A table of all electrodes

Parameters:
  • name (str) – the name of this container
  • data (Iterable) – the source of the data
add_row(id, x, y, z, imp, location, filtering, description, group)
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
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
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 (list or ndarray or DataChunkIterator or TimeSeries or Iterable) – 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 (list or ndarray or DataChunkIterator or TimeSeries or Iterable) – 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
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 (list or ndarray or DataChunkIterator or TimeSeries or Iterable) – The data this TimeSeries dataset stores. Can also store binary data e.g. image frames
  • timestamps (list or ndarray or DataChunkIterator or TimeSeries or Iterable) – 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
class pynwb.ecephys.EventDetection(source, detection_method, source_electricalseries, source_idx, times, name='EventDetection')

Bases: pynwb.core.NWBContainer

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 (Iterable) – 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 (Iterable) – Timestamps of events, in Seconds
  • name (str) – the name of this container
detection_method
source_electricalseries
source_idx
times
class pynwb.ecephys.EventWaveform(source, spike_event_series, name='EventWaveform')

Bases: pynwb.core.NWBContainer

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 SpikeEventSeries) – spiking event data
  • name (str) – the name of this container
spike_event_series
class pynwb.ecephys.Clustering(source, description, num, peak_over_rms, times, name='Clustering')

Bases: pynwb.core.NWBContainer

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 (Iterable) – 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 (Iterable) – Times of clustered events, in seconds.
  • name (str) – the name of this container
class pynwb.ecephys.ClusterWaveforms(source, clustering_interface, waveform_filtering, waveform_mean, waveform_sd, name='ClusterWaveforms')

Bases: pynwb.core.NWBContainer

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
waveform_filtering
waveform_mean
waveform_sd
class pynwb.ecephys.LFP(source, electrical_series, name='LFP')

Bases: pynwb.core.NWBContainer

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 (ElectricalSeries) – LFP electrophysiology data
  • name (str) – the name of this container
electrical_series
class pynwb.ecephys.FilteredEphys(source, electrical_series, name='FilteredEphys')

Bases: pynwb.core.NWBContainer

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 (ElectricalSeries) – filtered electrophysiology data
  • name (str) – the name of this container
electrical_series
class pynwb.ecephys.FeatureExtraction(source, electrodes, description, times, features, name='FeatureExtraction')

Bases: pynwb.core.NWBContainer

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 (list or tuple or ndarray or DataChunkIterator) – The times of events that features correspond to
  • features (list or tuple or ndarray or DataChunkIterator) – Features for each channel
  • name (str) – the name of this container
description
electrode_group
features
times