diff --git a/tutorials/ecephys.mlx b/tutorials/ecephys.mlx index ca95380d..f5b4a2ef 100644 Binary files a/tutorials/ecephys.mlx and b/tutorials/ecephys.mlx differ diff --git a/tutorials/html/ecephys.html b/tutorials/html/ecephys.html index ec161ac2..6b51b3ff 100644 --- a/tutorials/html/ecephys.html +++ b/tutorials/html/ecephys.html @@ -37,16 +37,16 @@ .inlineElement .textElement {} .embeddedOutputsTextElement.rightPaneElement,.embeddedOutputsVariableStringElement.rightPaneElement { min-height: 16px;} .rightPaneElement .textElement { padding-top: 2px; padding-left: 9px;} -.S13 { margin: 15px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: 700; text-align: left; } -.S14 { margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; } +.S13 { border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; } +.S14 { margin: 15px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: 700; text-align: left; } +.S15 { margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: center; } .embeddedOutputsVariableTableElement .ClientViewDiv table tr { height: 22px; white-space: nowrap;} .embeddedOutputsVariableTableElement .ClientViewDiv table tr td,.embeddedOutputsVariableTableElement .ClientViewDiv table tr th { background-color:white; text-overflow: ellipsis; font-family: 'Arial', sans-serif; font-size: 12px; overflow : hidden;} .embeddedOutputsVariableTableElement .ClientViewDiv table tr span { text-overflow: ellipsis; padding: 3px;} .embeddedOutputsVariableTableElement .ClientViewDiv table tr th { color: rgba(0,0,0,0.5); padding: 3px; font-size: 9px;} /* ClientDocument has a summary bar child that takes up 17px, this clashes with overflow on the view which allots space for scrollbars. On print preview, this causes headers from to overlap on subsequent pages. Displaying Document as flex renders summarybar and view in column format and fixes the issue g2788485 */.embeddedOutputsVariableTableElement .ClientDocument { display: flex; flex-direction: column;} -.S15 { border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px 0px 4px 4px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; } -.S16 { margin: 3px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: 700; text-align: left; } -.S17 { border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 0px none rgb(33, 33, 33); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; } +.S16 { border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 0px 0px 4px 4px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; } +.S17 { margin: 3px 10px 5px 4px; padding: 0px; line-height: 18px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 17px; font-weight: 700; text-align: left; } .S18 { margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: rgb(33, 33, 33); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left; } .S19 { border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 1px solid rgb(217, 217, 217); border-radius: 4px; padding: 6px 45px 4px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; } .S20 { border-left: 1px solid rgb(217, 217, 217); border-right: 1px solid rgb(217, 217, 217); border-top: 1px solid rgb(217, 217, 217); border-bottom: 0px none rgb(33, 33, 33); border-radius: 0px; padding: 6px 45px 0px 13px; line-height: 18.004px; min-height: 0px; white-space: nowrap; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; } @@ -77,36 +77,36 @@ .variableNameElement { margin-bottom: 3px; display: inline-block;} /* * Ellipses as base64 for HTML export. */.matrixElement .horizontalEllipsis,.rtcDataTipElement .matrixElement .horizontalEllipsis { display: inline-block; margin-top: 3px; /* base64 encoded version of images-liveeditor/HEllipsis.png */ width: 30px; height: 12px; background-repeat: no-repeat; background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAJCAYAAADO1CeCAAAAJUlEQVR42mP4//8/A70xw0i29BUDFPxnAEtTW37wWDqakIa4pQDvOOG89lHX2gAAAABJRU5ErkJggg==");} .matrixElement .verticalEllipsis,.textElement .verticalEllipsis,.rtcDataTipElement .matrixElement .verticalEllipsis,.rtcDataTipElement .textElement .verticalEllipsis { margin-left: 35px; /* base64 encoded version of images-liveeditor/VEllipsis.png */ width: 12px; height: 30px; background-repeat: no-repeat; background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAZCAYAAAAIcL+IAAAALklEQVR42mP4//8/AzGYgWyFMECMwv8QddRS+P//KyimlmcGUOFoOI6GI/UVAgDnd8Dd4+NCwgAAAABJRU5ErkJggg==");} -.S22 { margin: 15px 10px 5px 4px; padding: 0px; line-height: 28.8px; min-height: 0px; white-space: pre-wrap; color: rgb(192, 76, 11); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 24px; font-weight: 400; text-align: left; }

Neurodata Without Borders Extracellular Electrophysiology Tutorial

Table of Contents

About This Tutorial

This tutorial describes storage of hypothetical data from extracellular electrophysiology experiments in NWB for the following data categories:

Before You Begin

It is recommended to first work through the Introduction to MatNWB tutorial, which demonstrates installing MatNWB and creating an NWB file with subject information, animal position, and trials, as well as writing and reading NWB files in MATLAB.
Important: The dimensions of timeseries data in MatNWB should be defined in the opposite order of how it is defined in the nwb-schemas. In NWB, time is always stored in the first dimension of the data, whereas in MatNWB time should be stored in the last dimension of the data. This is explained in more detail here: MatNWB <-> HDF5 Dimension Mapping.

Setting up the NWB File

An NWB file represents a single session of an experiment. Each file must have a session_description, identifier, and session_start_time. Create a new NWBFile object these required fields along with any additional metadata. In MatNWB, arguments are specified using MATLAB's keyword argument pair convention, where each argument name is followed by its value.
nwb = NwbFile( ...
'session_description', 'mouse in open exploration',...
'identifier', 'Mouse5_Day3', ...
'session_start_time', datetime(2018, 4, 25, 2, 30, 3, 'TimeZone', 'local'), ...
'timestamps_reference_time', datetime(2018, 4, 25, 3, 0, 45, 'TimeZone', 'local'), ...
'general_experimenter', 'Last Name, First Name', ... % optional
'general_session_id', 'session_1234', ... % optional
'general_institution', 'University of My Institution', ... % optional
'general_related_publications', {'DOI:10.1016/j.neuron.2016.12.011'}); % optional
nwb
nwb =
NwbFile with properties: - - nwb_version: '2.7.0' +.S22 { margin: 15px 10px 5px 4px; padding: 0px; line-height: 28.8px; min-height: 0px; white-space: pre-wrap; color: rgb(192, 76, 11); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 24px; font-weight: 400; text-align: left; }

Neurodata Without Borders Extracellular Electrophysiology Tutorial

About This Tutorial

This tutorial describes storage of hypothetical data from extracellular electrophysiology experiments in NWB for the following data categories:
  • Raw voltage recording
  • Local field potential (LFP) and filtered electrical signals
  • Spike times

Before You Begin

It is recommended to first work through the Introduction to MatNWB tutorial, which demonstrates installing MatNWB and creating an NWB file with subject information, animal position, and trials, as well as writing and reading NWB files in MATLAB.
Important: The dimensions of timeseries data in MatNWB should be defined in the opposite order of how it is defined in the nwb-schemas. In NWB, time is always stored in the first dimension of the data, whereas in MatNWB time should be stored in the last dimension of the data. This is explained in more detail here: MatNWB <-> HDF5 Dimension Mapping.

Setting up the NWB File

An NWB file represents a single session of an experiment. Each file must have a session_description, identifier, and session_start_time. Create a new NWBFile object these required fields along with any additional metadata. In MatNWB, arguments are specified using MATLAB's keyword argument pair convention, where each argument name is followed by its value.
nwb = NwbFile( ...
'session_description', 'mouse in open exploration',...
'identifier', 'Mouse5_Day3', ...
'session_start_time', datetime(2018, 4, 25, 2, 30, 3, 'TimeZone', 'local'), ...
'timestamps_reference_time', datetime(2018, 4, 25, 3, 0, 45, 'TimeZone', 'local'), ...
'general_experimenter', 'Last Name, First Name', ... % optional
'general_session_id', 'session_1234', ... % optional
'general_institution', 'University of My Institution', ... % optional
'general_related_publications', {'DOI:10.1016/j.neuron.2016.12.011'}); % optional
nwb
nwb =
NwbFile with properties: + + nwb_version: '2.8.0' file_create_date: [] identifier: 'Mouse5_Day3' session_description: 'mouse in open exploration' @@ -146,6 +146,7 @@ general_subject: [] general_surgery: '' general_virus: '' + general_was_generated_by: '' intervals: [0×1 types.untyped.Set] intervals_epochs: [] intervals_invalid_times: [] @@ -155,900 +156,900 @@ stimulus_presentation: [0×1 types.untyped.Set] stimulus_templates: [0×1 types.untyped.Set] units: [] -

Electrode Information

In order to store extracellular electrophysiology data, you first must create an electrodes table describing the electrodes that generated this data. Extracellular electrodes are stored in an electrodes table, which is also a DynamicTable. electrodes has several required fields: x, y, z, impedance, location, filtering, and electrode_group.

Electrodes Table

Since this is a DynamicTable, we can add additional metadata fields. We will be adding a "label" column to the table.
numShanks = 4;
numChannelsPerShank = 3;
numChannels = numShanks * numChannelsPerShank;
 
electrodesDynamicTable = types.hdmf_common.DynamicTable(...
'colnames', {'location', 'group', 'group_name', 'label'}, ...
'description', 'all electrodes');
 
device = types.core.Device(...
'description', 'the best array', ...
'manufacturer', 'Probe Company 9000' ...
);
nwb.general_devices.set('array', device);
for iShank = 1:numShanks
shankGroupName = sprintf('shank%d', iShank);
electrodeGroup = types.core.ElectrodeGroup( ...
'description', sprintf('electrode group for %s', shankGroupName), ...
'location', 'brain area', ...
'device', types.untyped.SoftLink(device) ...
);
nwb.general_extracellular_ephys.set(shankGroupName, electrodeGroup);
for iElectrode = 1:numChannelsPerShank
electrodesDynamicTable.addRow( ...
'location', 'unknown', ...
'group', types.untyped.ObjectView(electrodeGroup), ...
'group_name', shankGroupName, ...
'label', sprintf('%s-electrode%d', shankGroupName, iElectrode));
end
end
electrodesDynamicTable.toTable() % Display the table
ans = 12×5 table
 idlocationgroupgroup_namelabel
10'unknown'1×1 ObjectView'shank1''shank1-electrode1'
21'unknown'1×1 ObjectView'shank1''shank1-electrode2'
32'unknown'1×1 ObjectView'shank1''shank1-electrode3'
43'unknown'1×1 ObjectView'shank2''shank2-electrode1'
54'unknown'1×1 ObjectView'shank2''shank2-electrode2'
65'unknown'1×1 ObjectView'shank2''shank2-electrode3'
76'unknown'1×1 ObjectView'shank3''shank3-electrode1'
87'unknown'1×1 ObjectView'shank3''shank3-electrode2'
98'unknown'1×1 ObjectView'shank3''shank3-electrode3'
109'unknown'1×1 ObjectView'shank4''shank4-electrode1'
1110'unknown'1×1 ObjectView'shank4''shank4-electrode2'
1211'unknown'1×1 ObjectView'shank4''shank4-electrode3'
nwb.general_extracellular_ephys_electrodes = electrodesDynamicTable;

Links

In the above loop, we create ElectrodeGroup objects. The electrodes table then uses an ObjectView in each row to link to the corresponding ElectrodeGroup object. An ObjectView is a construct that enables linking one neurodata type to another, allowing a neurodata type to reference another within the NWB file.

Recorded Extracellular Signals

Voltage data are stored using the ElectricalSeries class, a subclass of the TimeSeries class specialized for voltage data.

Referencing Electrodes

In order to create our ElectricalSeries object, we first need to reference a set of rows in the electrodes table to indicate which electrode (channel) each entry in the electrical series were recorded from. We will do this by creating a DynamicTableRegion, which is a type of link that allows you to reference specific rows of a DynamicTable, such as the electrodes table, using row indices.
Create a DynamicTableRegion that references all rows of the electrodes table.
electrode_table_region = types.hdmf_common.DynamicTableRegion( ...
'table', types.untyped.ObjectView(electrodesDynamicTable), ...
'description', 'all electrodes', ...
'data', (0:length(electrodesDynamicTable.id.data)-1)');

Raw Voltage Data

Now create an ElectricalSeries object to hold acquisition data collected during the experiment.
raw_electrical_series = types.core.ElectricalSeries( ...
'starting_time', 0.0, ... % seconds
'starting_time_rate', 30000., ... % Hz
'data', randn(numChannels, 3000), ... % nChannels x nTime
'electrodes', electrode_table_region, ...
'data_unit', 'volts');
This is the voltage data recorded directly from our electrodes, so it goes in the acquisition group.
nwb.acquisition.set('ElectricalSeries', raw_electrical_series);

Processed Extracellular Electrical Signals

LFP

LFP refers to data that has been low-pass filtered, typically below 300 Hz. This data may also be downsampled. Because it is filtered and potentially resampled, it is categorized as processed data. LFP data would also be stored in an ElectricalSeries. To help data analysis and visualization tools know that this ElectricalSeries object represents LFP data, we store it inside an LFP object and then place the LFP object in a ProcessingModule named 'ecephys'. This is analogous to how we stored the SpatialSeries object inside of a Position object and stored the Position object in a ProcessingModule named 'behavior' in the behavior tutorial
lfp_electrical_series = types.core.ElectricalSeries( ...
'starting_time', 0.0, ... % seconds
'starting_time_rate', 1000., ... % Hz
'data', randn(numChannels, 100), ... nChannels x nTime
'filtering', 'Low-pass filter at 300 Hz', ...
'electrodes', electrode_table_region, ...
'data_unit', 'volts');
 
lfp = types.core.LFP('ElectricalSeries', lfp_electrical_series);
 
ecephys_module = types.core.ProcessingModule(...
'description', 'extracellular electrophysiology');
 
ecephys_module.nwbdatainterface.set('LFP', lfp);
nwb.processing.set('ecephys', ecephys_module);

Other Types of Filtered Electrical Signals

If your acquired data is filtered for frequency ranges other than LFP—such as Gamma or Theta—you can store the result in an ElectricalSeries and encapsulate it within a FilteredEphys object instead of the LFP object.
% Generate filtered data
filtered_data = randn(50, 12); % 50 time points, 12 channels
filtered_data = permute(filtered_data, [2, 1]); % permute timeseries for matnwb
 
% Create an ElectricalSeries object
filtered_electrical_series = types.core.ElectricalSeries( ...
'description', 'Data filtered in the theta range', ...
'data', filtered_data, ...
'electrodes', electrode_table_region, ...
'filtering', 'Band-pass filtered between 4 and 8 Hz', ...
'starting_time', 0.0, ...
'starting_time_rate', 200.0 ...
);
 
% Create a FilteredEphys object and add the filtered electrical series
filtered_ephys = types.core.FilteredEphys();
filtered_ephys.electricalseries.set('FilteredElectricalSeries', filtered_electrical_series);
 
% Add the FilteredEphys object to the ecephys module
ecephys_module.nwbdatainterface.set('FilteredEphys', filtered_ephys);

Decomposition of LFP Data into Frequency Bands

In some cases, you may want to further process the LFP data and decompose the signal into different frequency bands for additional downstream analyses. You can then store the processed data from these spectral analyses using a DecompositionSeries object. This object allows you to include metadata about the frequency bands and metric used (e.g., power, phase, amplitude), as well as link the decomposed data to the original TimeSeries signal the data was derived from.
In this tutorial, the examples for FilteredEphys and DecompositionSeries may appear similar. However, the key difference is that DecompositionSeries is specialized for storing the results of spectral analyses of timeseries data in general, whereas FilteredEphys is defined specifically as a container for filtered electrical signals.
Note: When adding data to a DecompositionSeries, the data argument is assumed to be 3D where the first dimension is time, the second dimension is channels, and the third dimension is bands. As mentioned in the beginning of this tutorial, in MatNWB the data needs to be permuted because the dimensions are written to file in reverse order (See the dimensionMapNoDataPipes tutorial)
% Define the frequency bands of interest (in Hz):
band_names = {'theta'; 'beta'; 'gamma'};
band_mean = [8; 21; 55];
band_stdev = [2; 4.5; 12.5];
band_limits = [band_mean - 2*band_stdev, band_mean + 2*band_stdev];
 
% The bands should be added to the DecompositionSeries as a dynamic table
bands = table(band_names, band_mean, band_stdev, band_limits, ...
'VariableNames', {'band_name', 'band_mean', 'band_stdev', 'band_limits'})
bands = 3×4 table
 band_nameband_meanband_stdevband_limits
12
1'theta'82412
2'beta'214.50001230
3'gamma'5512.50003080
 
bands = util.table2nwb( bands );
 
% Generate random phase data for the demonstration.
phase_data = randn(50, 12, numel(band_names)); % 50 samples, 12 channels, 3 frequency bands
phase_data = permute(phase_data, [3,2,1]); % See dimensionMapNoDataPipes tutorial
 
decomp_series = types.core.DecompositionSeries(...
'data', phase_data, ...
'bands', bands, ...
'metric', 'phase', ...
'starting_time', 0.0, ... % seconds
'starting_time_rate', 1000.0, ... % Hz
'source_channels', electrode_table_region, ...
'source_timeseries', lfp_electrical_series);
 
% Add decomposition series to ecephys module
ecephys_module.nwbdatainterface.set('theta', decomp_series);

Spike Times and Extracellular Events

Sorted Spike Times

Spike times are stored in a Units table, a specialization of the DynamicTable class. The default Units table is located at /units in the HDF5 file. You can add columns to the Units table just like you did for electrodes and trials (see convertTrials). Here, we generate some random spike data and populate the table.
num_cells = 10;
spikes = cell(1, num_cells);
for iShank = 1:num_cells
spikes{iShank} = rand(1, randi([16, 28]));
end
spikes
spikes = 1×10 cell
 12345678910
11×24 double1×19 double1×20 double1×25 double1×22 double1×20 double1×22 double1×17 double1×21 double1×25 double

Ragged Arrays

Spike times are an example of a ragged array- it's like a matrix, but each row has a different number of elements. We can represent this type of data as an indexed column of the Units table. These indexed columns have two components, the VectorData object that holds the data and the VectorIndex object that holds the indices in the vector that indicate the row breaks. You can use the convenience function util.create_indexed_column to create these objects. For more information about ragged arrays, we refer you to the "Ragged Array Columns" section of the dynamic table tutorial.
[spike_times_vector, spike_times_index] = util.create_indexed_column(spikes);
 
nwb.units = types.core.Units( ...
'colnames', {'spike_times'}, ...
'description', 'units table', ...
'spike_times', spike_times_vector, ...
'spike_times_index', spike_times_index ...
);
 
nwb.units.toTable
ans = 10×2 table
 idspike_times
1124×1 double
2219×1 double
3320×1 double
4425×1 double
5522×1 double
6620×1 double
7722×1 double
8817×1 double
9921×1 double
101025×1 double

Unsorted Spike Times

While the Units table is used to store spike times and waveform data for spike-sorted, single-unit activity, you may also want to store spike times and waveform snippets of unsorted spiking activity. This is useful for recording multi-unit activity detected via threshold crossings during data acquisition. Such information can be stored using SpikeEventSeries objects.
% In the SpikeEventSeries the dimensions should be ordered as
% [num_events, num_channels, num_samples].
% Define spike snippets: 20 events, 3 channels, 40 samples per event.
spike_snippets = rand(20, 3, 40);
% Permute spike snippets (See dimensionMapNoDataPipes tutorial)
spike_snippets = permute(spike_snippets, [3,2,1])
spike_snippets =
spike_snippets(:,:,1) = - - 0.3732 0.7791 0.5937 - 0.7586 0.8887 0.6501 - 0.3051 0.4772 0.4288 - 0.4012 0.5913 0.3957 - 0.3939 0.3286 0.1415 - 0.5662 0.5443 0.2179 - 0.9869 0.4951 0.4386 - 0.7861 0.9518 0.4311 - 0.6751 0.4070 0.1629 - 0.4426 0.5435 0.8580 - 0.0396 0.6455 0.9119 - 0.9309 0.4391 0.6281 - 0.2086 0.5926 0.6285 - 0.9404 0.2170 0.2241 - 0.5310 0.3074 0.9547 - 0.3391 0.8501 0.5889 - 0.0462 0.7716 0.8651 - 0.0262 0.6235 0.9419 - 0.8849 0.0555 0.4975 - 0.4348 0.8429 0.5563 - 0.3528 0.4937 0.8508 - 0.5342 0.9424 0.9996 - 0.5746 0.0628 0.8755 - 0.4744 0.8553 0.9244 - 0.7230 0.6936 0.2125 - 0.4087 0.2393 0.7200 - 0.2982 0.4357 0.2804 - 0.1524 0.7107 0.3372 - 0.9375 0.9103 0.1958 - 0.7425 0.0687 0.4879 - 0.2087 0.0370 0.0393 - 0.1920 0.2053 0.4417 - 0.1422 0.4232 0.1870 - 0.8810 0.7692 0.7563 - 0.1456 0.9029 0.5702 - 0.2523 0.1514 0.7324 - 0.4195 0.4896 0.2667 - 0.3307 0.6090 0.6230 - 0.1701 0.9241 0.5880 - 0.5319 0.0420 0.6809 +

Electrode Information

In order to store extracellular electrophysiology data, you first must create an electrodes table describing the electrodes that generated this data. Extracellular electrodes are stored in an electrodes table, which is also a DynamicTable. electrodes has several required fields: x, y, z, impedance, location, filtering, and electrode_group.
The electrodes table references a required ElectrodeGroup, which is used to represent a group of electrodes. Before creating an ElectrodeGroup, you must define a Device object. The fields description, manufacturer, model_number, model_name, and serial_number are optional, but recommended.
device = types.core.Device(...
'description', 'A 12-channel array with 4 shanks and 3 channels per shank', ...
'manufacturer', 'Array Technologies', ...
'model_number', 'PRB_1_4_0480_123', ...
'model_name', 'Neurovoxels 0.99', ...
'serial_number', '1234567890' ...
);
 
% Add device to nwb object
nwb.general_devices.set('array', device);

Electrodes Table

Since this is a DynamicTable, we can add additional metadata fields. We will be adding a "label" column to the table.
numShanks = 4;
numChannelsPerShank = 3;
numChannels = numShanks * numChannelsPerShank;
 
electrodesDynamicTable = types.hdmf_common.DynamicTable(...
'colnames', {'location', 'group', 'group_name', 'label'}, ...
'description', 'all electrodes');
 
for iShank = 1:numShanks
shankGroupName = sprintf('shank%d', iShank);
electrodeGroup = types.core.ElectrodeGroup( ...
'description', sprintf('electrode group for %s', shankGroupName), ...
'location', 'brain area', ...
'device', types.untyped.SoftLink(device) ...
);
nwb.general_extracellular_ephys.set(shankGroupName, electrodeGroup);
for iElectrode = 1:numChannelsPerShank
electrodesDynamicTable.addRow( ...
'location', 'unknown', ...
'group', types.untyped.ObjectView(electrodeGroup), ...
'group_name', shankGroupName, ...
'label', sprintf('%s-electrode%d', shankGroupName, iElectrode));
end
end
electrodesDynamicTable.toTable() % Display the table
ans = 12×5 table
 idlocationgroupgroup_namelabel
10'unknown'1×1 ObjectView'shank1''shank1-electrode1'
21'unknown'1×1 ObjectView'shank1''shank1-electrode2'
32'unknown'1×1 ObjectView'shank1''shank1-electrode3'
43'unknown'1×1 ObjectView'shank2''shank2-electrode1'
54'unknown'1×1 ObjectView'shank2''shank2-electrode2'
65'unknown'1×1 ObjectView'shank2''shank2-electrode3'
76'unknown'1×1 ObjectView'shank3''shank3-electrode1'
87'unknown'1×1 ObjectView'shank3''shank3-electrode2'
98'unknown'1×1 ObjectView'shank3''shank3-electrode3'
109'unknown'1×1 ObjectView'shank4''shank4-electrode1'
1110'unknown'1×1 ObjectView'shank4''shank4-electrode2'
1211'unknown'1×1 ObjectView'shank4''shank4-electrode3'
nwb.general_extracellular_ephys_electrodes = electrodesDynamicTable;

Links

In the above loop, we create ElectrodeGroup objects. The electrodes table then uses an ObjectView in each row to link to the corresponding ElectrodeGroup object. An ObjectView is a construct that enables linking one neurodata type to another, allowing a neurodata type to reference another within the NWB file.

Recorded Extracellular Signals

Voltage data are stored using the ElectricalSeries class, a subclass of the TimeSeries class specialized for voltage data.

Referencing Electrodes

In order to create our ElectricalSeries object, we first need to reference a set of rows in the electrodes table to indicate which electrode (channel) each entry in the electrical series were recorded from. We will do this by creating a DynamicTableRegion, which is a type of link that allows you to reference specific rows of a DynamicTable, such as the electrodes table, using row indices.
Create a DynamicTableRegion that references all rows of the electrodes table.
electrode_table_region = types.hdmf_common.DynamicTableRegion( ...
'table', types.untyped.ObjectView(electrodesDynamicTable), ...
'description', 'all electrodes', ...
'data', (0:length(electrodesDynamicTable.id.data)-1)');

Raw Voltage Data

Now create an ElectricalSeries object to hold acquisition data collected during the experiment.
raw_electrical_series = types.core.ElectricalSeries( ...
'starting_time', 0.0, ... % seconds
'starting_time_rate', 30000., ... % Hz
'data', randn(numChannels, 3000), ... % nChannels x nTime
'electrodes', electrode_table_region, ...
'data_unit', 'volts');
This is the voltage data recorded directly from our electrodes, so it goes in the acquisition group.
nwb.acquisition.set('ElectricalSeries', raw_electrical_series);

Processed Extracellular Electrical Signals

LFP

LFP refers to data that has been low-pass filtered, typically below 300 Hz. This data may also be downsampled. Because it is filtered and potentially resampled, it is categorized as processed data. LFP data would also be stored in an ElectricalSeries. To help data analysis and visualization tools know that this ElectricalSeries object represents LFP data, we store it inside an LFP object and then place the LFP object in a ProcessingModule named 'ecephys'. This is analogous to how we stored the SpatialSeries object inside of a Position object and stored the Position object in a ProcessingModule named 'behavior' in the behavior tutorial
lfp_electrical_series = types.core.ElectricalSeries( ...
'starting_time', 0.0, ... % seconds
'starting_time_rate', 1000., ... % Hz
'data', randn(numChannels, 100), ... nChannels x nTime
'filtering', 'Low-pass filter at 300 Hz', ...
'electrodes', electrode_table_region, ...
'data_unit', 'volts');
 
lfp = types.core.LFP('ElectricalSeries', lfp_electrical_series);
 
ecephys_module = types.core.ProcessingModule(...
'description', 'extracellular electrophysiology');
 
ecephys_module.nwbdatainterface.set('LFP', lfp);
nwb.processing.set('ecephys', ecephys_module);

Other Types of Filtered Electrical Signals

If your acquired data is filtered for frequency ranges other than LFP—such as Gamma or Theta—you can store the result in an ElectricalSeries and encapsulate it within a FilteredEphys object instead of the LFP object.
% Generate filtered data
filtered_data = randn(50, 12); % 50 time points, 12 channels
filtered_data = permute(filtered_data, [2, 1]); % permute timeseries for matnwb
 
% Create an ElectricalSeries object
filtered_electrical_series = types.core.ElectricalSeries( ...
'description', 'Data filtered in the theta range', ...
'data', filtered_data, ...
'electrodes', electrode_table_region, ...
'filtering', 'Band-pass filtered between 4 and 8 Hz', ...
'starting_time', 0.0, ...
'starting_time_rate', 200.0 ...
);
 
% Create a FilteredEphys object and add the filtered electrical series
filtered_ephys = types.core.FilteredEphys();
filtered_ephys.electricalseries.set('FilteredElectricalSeries', filtered_electrical_series);
 
% Add the FilteredEphys object to the ecephys module
ecephys_module.nwbdatainterface.set('FilteredEphys', filtered_ephys);

Decomposition of LFP Data into Frequency Bands

In some cases, you may want to further process the LFP data and decompose the signal into different frequency bands for additional downstream analyses. You can then store the processed data from these spectral analyses using a DecompositionSeries object. This object allows you to include metadata about the frequency bands and metric used (e.g., power, phase, amplitude), as well as link the decomposed data to the original TimeSeries signal the data was derived from.
In this tutorial, the examples for FilteredEphys and DecompositionSeries may appear similar. However, the key difference is that DecompositionSeries is specialized for storing the results of spectral analyses of timeseries data in general, whereas FilteredEphys is defined specifically as a container for filtered electrical signals.
Note: When adding data to a DecompositionSeries, the data argument is assumed to be 3D where the first dimension is time, the second dimension is channels, and the third dimension is bands. As mentioned in the beginning of this tutorial, in MatNWB the data needs to be permuted because the dimensions are written to file in reverse order (See the dimensionMapNoDataPipes tutorial)
% Define the frequency bands of interest (in Hz):
band_names = {'theta'; 'beta'; 'gamma'};
band_mean = [8; 21; 55];
band_stdev = [2; 4.5; 12.5];
band_limits = [band_mean - 2*band_stdev, band_mean + 2*band_stdev];
 
% The bands should be added to the DecompositionSeries as a dynamic table
bands = table(band_names, band_mean, band_stdev, band_limits, ...
'VariableNames', {'band_name', 'band_mean', 'band_stdev', 'band_limits'})
bands = 3×4 table
 band_nameband_meanband_stdevband_limits
12
1'theta'82412
2'beta'214.50001230
3'gamma'5512.50003080
 
bands = util.table2nwb( bands );
 
% Generate random phase data for the demonstration.
phase_data = randn(50, 12, numel(band_names)); % 50 samples, 12 channels, 3 frequency bands
phase_data = permute(phase_data, [3,2,1]); % See dimensionMapNoDataPipes tutorial
 
decomp_series = types.core.DecompositionSeries(...
'data', phase_data, ...
'bands', bands, ...
'metric', 'phase', ...
'starting_time', 0.0, ... % seconds
'starting_time_rate', 1000.0, ... % Hz
'source_channels', electrode_table_region, ...
'source_timeseries', lfp_electrical_series);
 
% Add decomposition series to ecephys module
ecephys_module.nwbdatainterface.set('theta', decomp_series);

Spike Times and Extracellular Events

Sorted Spike Times

Spike times are stored in a Units table, a specialization of the DynamicTable class. The default Units table is located at /units in the HDF5 file. You can add columns to the Units table just like you did for electrodes and trials (see convertTrials). Here, we generate some random spike data and populate the table.
num_cells = 10;
spikes = cell(1, num_cells);
for iShank = 1:num_cells
spikes{iShank} = rand(1, randi([16, 28]));
end
spikes
spikes = 1×10 cell
 12345678910
11×18 double1×24 double1×22 double1×19 double1×16 double1×28 double1×19 double1×27 double1×26 double1×19 double

Ragged Arrays

Spike times are an example of a ragged array- it's like a matrix, but each row has a different number of elements. We can represent this type of data as an indexed column of the Units table. These indexed columns have two components, the VectorData object that holds the data and the VectorIndex object that holds the indices in the vector that indicate the row breaks. You can use the convenience function util.create_indexed_column to create these objects. For more information about ragged arrays, we refer you to the "Ragged Array Columns" section of the dynamic table tutorial.
[spike_times_vector, spike_times_index] = util.create_indexed_column(spikes);
 
nwb.units = types.core.Units( ...
'colnames', {'spike_times'}, ...
'description', 'units table', ...
'spike_times', spike_times_vector, ...
'spike_times_index', spike_times_index ...
);
 
nwb.units.toTable
ans = 10×2 table
 idspike_times
1118×1 double
2224×1 double
3322×1 double
4419×1 double
5516×1 double
6628×1 double
7719×1 double
8827×1 double
9926×1 double
101019×1 double

Unsorted Spike Times

While the Units table is used to store spike times and waveform data for spike-sorted, single-unit activity, you may also want to store spike times and waveform snippets of unsorted spiking activity. This is useful for recording multi-unit activity detected via threshold crossings during data acquisition. Such information can be stored using SpikeEventSeries objects.
% In the SpikeEventSeries the dimensions should be ordered as
% [num_events, num_channels, num_samples].
% Define spike snippets: 20 events, 3 channels, 40 samples per event.
spike_snippets = rand(20, 3, 40);
% Permute spike snippets (See dimensionMapNoDataPipes tutorial)
spike_snippets = permute(spike_snippets, [3,2,1])
spike_snippets =
spike_snippets(:,:,1) = + + 0.8840 0.4104 0.0773 + 0.2895 0.4434 0.7276 + 0.7282 0.2321 0.1961 + 0.8443 0.0524 0.5851 + 0.3713 0.0241 0.4969 + 0.5494 0.6839 0.7355 + 0.1517 0.7949 0.5979 + 0.6635 0.3582 0.3362 + 0.2304 0.5858 0.8594 + 0.3852 0.2620 0.3264 + 0.3118 0.3305 0.5870 + 0.4677 0.4784 0.8121 + 0.5636 0.3811 0.2998 + 0.5963 0.1882 0.1086 + 0.6762 0.3520 0.0824 + 0.0599 0.0252 0.1052 + 0.1278 0.7587 0.7405 + 0.0422 0.7312 0.6667 + 0.2422 0.8595 0.1119 + 0.6675 0.0296 0.8458 + 0.2531 0.6969 0.2860 + 0.8549 0.6434 0.0730 + 0.9224 0.1372 0.5922 + 0.8046 0.2026 0.3796 + 0.0283 0.4356 0.2686 + 0.0220 0.7392 0.6113 + 0.4983 0.7065 0.8138 + 0.1084 0.7089 0.0159 + 0.4491 0.8796 0.8570 + 0.2666 0.8124 0.1619 + 0.8874 0.7056 0.0604 + 0.7425 0.2605 0.2477 + 0.4856 0.2008 0.1097 + 0.1616 0.0121 0.0490 + 0.1388 0.9127 0.5684 + 0.1459 0.9058 0.1248 + 0.1711 0.1007 0.3990 + 0.8393 0.6710 0.8213 + 0.6889 0.1315 0.7412 + 0.3700 0.8719 0.8248 spike_snippets(:,:,2) = - 0.6946 0.9867 0.1621 - 0.2072 0.7996 0.6578 - 0.7396 0.9594 0.2076 - 0.5369 0.8403 0.3706 - 0.3963 0.8120 0.9353 - 0.0532 0.0624 0.7060 - 0.1420 0.1284 0.4933 - 0.9286 0.5055 0.6835 - 0.3156 0.7733 0.3820 - 0.4400 0.2803 0.6084 - 0.2611 0.6750 0.0324 - 0.0603 0.6302 0.9327 - 0.3091 0.1783 0.3724 - 0.5451 0.6656 0.4110 - 0.1974 0.1752 0.6761 - 0.9598 0.3204 0.7998 - 0.7463 0.9291 0.1296 - 0.1828 0.4812 0.6270 - 0.7885 0.1908 0.7519 - 0.1154 0.7749 0.6845 - 0.5216 0.3994 0.9655 - 0.2219 0.3672 0.2583 - 0.4704 0.8092 0.4067 - 0.9942 0.0751 0.1858 - 0.2373 0.5807 0.9973 - 0.6321 0.7136 0.1707 - 0.4648 0.7071 0.1290 - 0.6359 0.6416 0.3091 - 0.1669 0.8553 0.1380 - 0.7639 0.3221 0.2149 - 0.0145 0.3226 0.4020 - 0.5560 0.0633 0.2573 - 0.6934 0.7846 0.9890 - 0.5472 0.7723 0.0297 - 0.7413 0.4124 0.4747 - 0.9513 0.8615 0.3798 - 0.8774 0.0074 0.0822 - 0.2707 0.2008 0.6769 - 0.9066 0.2487 0.3473 - 0.9031 0.5947 0.2998 + 0.3587 0.9811 0.2971 + 0.7277 0.8138 0.2456 + 0.7136 0.7200 0.9779 + 0.8198 0.6446 0.2123 + 0.7078 0.3514 0.5493 + 0.8665 0.6074 0.3950 + 0.9498 0.9263 0.6231 + 0.4755 0.7082 0.7975 + 0.1605 0.2079 0.8562 + 0.0512 0.8677 0.3511 + 0.1897 0.9574 0.7471 + 0.6744 0.6732 0.0225 + 0.6024 0.5067 0.0387 + 0.8992 0.5272 0.5283 + 0.5722 0.9761 0.7628 + 0.7082 0.5364 0.8801 + 0.1330 0.8471 0.4737 + 0.6811 0.2800 0.9775 + 0.5363 0.9029 0.5870 + 0.7977 0.0398 0.4918 + 0.4657 0.2871 0.0126 + 0.9780 0.3657 0.7575 + 0.8543 0.7694 0.6129 + 0.3676 0.3227 0.3590 + 0.4902 0.7841 0.7379 + 0.7595 0.7320 0.6265 + 0.2180 0.4572 0.1383 + 0.3310 0.0001 0.5000 + 0.0245 0.9370 0.0438 + 0.7992 0.6612 0.7073 + 0.3443 0.9668 0.3462 + 0.9261 0.6006 0.5526 + 0.4018 0.0765 0.4504 + 0.0286 0.3908 0.4233 + 0.6364 0.7242 0.6814 + 0.4236 0.0721 0.5432 + 0.5599 0.7267 0.6644 + 0.1459 0.2461 0.6893 + 0.2536 0.3381 0.0641 + 0.6326 0.7257 0.8844 spike_snippets(:,:,3) = - 0.5451 0.8070 0.3206 - 0.6928 0.4280 0.8321 - 0.6805 0.9535 0.2361 - 0.2666 0.1868 0.4845 - 0.9815 0.7233 0.8900 - 0.7260 0.8210 0.3314 - 0.3164 0.7107 0.6713 - 0.4181 0.4670 0.0010 - 0.9741 0.2856 0.7074 - 0.4238 0.8375 0.8412 - 0.9819 0.8191 0.0949 - 0.4364 0.9326 0.4354 - 0.7310 0.9098 0.4869 - 0.4943 0.9199 0.3313 - 0.6452 0.6932 0.7494 - 0.0505 0.9546 0.9591 - 0.1264 0.4607 0.1279 - 0.9333 0.0234 0.7867 - 0.3341 0.3857 0.6957 - 0.7642 0.1095 0.0429 - 0.9580 0.4884 0.6948 - 0.6084 0.5523 0.8079 - 0.5066 0.6660 0.3920 - 0.0327 0.7744 0.8886 - 0.9240 0.5647 0.0658 - 0.5356 0.0641 0.7811 - 0.4054 0.5640 0.4154 - 0.9789 0.5963 0.8608 - 0.5668 0.1509 0.3670 - 0.7025 0.9988 0.9933 - 0.8613 0.4405 0.1464 - 0.1041 0.7715 0.3392 - 0.3661 0.3882 0.5087 - 0.7465 0.0436 0.0087 - 0.3572 0.4768 0.0233 - 0.9081 0.2854 0.6945 - 0.2392 0.3414 0.6361 - 0.6355 0.0123 0.6029 - 0.8906 0.9561 0.0998 - 0.8724 0.4231 0.8791 + 0.1362 0.1425 0.3644 + 0.2234 0.6658 0.9637 + 0.4727 0.6631 0.2876 + 0.0085 0.0553 0.4585 + 0.9502 0.0977 0.6954 + 0.2312 0.1565 0.5087 + 0.2705 0.3535 0.5659 + 0.2368 0.0900 0.8627 + 0.1081 0.7041 0.3725 + 0.6482 0.0005 0.1544 + 0.2362 0.6108 0.6114 + 0.8803 0.9088 0.2091 + 0.0856 0.8648 0.1002 + 0.3896 0.2870 0.4510 + 0.0470 0.1266 0.1895 + 0.9096 0.4791 0.3934 + 0.8571 0.5306 0.4322 + 0.5716 0.3844 0.8254 + 0.8413 0.8704 0.3305 + 0.5318 0.7753 0.7935 + 0.4743 0.8884 0.4022 + 0.8342 0.4738 0.8089 + 0.8143 0.2582 0.8370 + 0.8134 0.4044 0.0324 + 0.2955 0.2959 0.2695 + 0.6966 0.4155 0.6720 + 0.4360 0.3938 0.8744 + 0.4421 0.9780 0.2194 + 0.2874 0.1777 0.7541 + 0.8277 0.5363 0.0101 + 0.1075 0.8672 0.3565 + 0.5107 0.4739 0.3066 + 0.9965 0.3262 0.0391 + 0.6357 0.1903 0.3097 + 0.2875 0.9710 0.5432 + 0.2359 0.5163 0.9214 + 0.8104 0.6590 0.3723 + 0.2666 0.0595 0.3578 + 0.8609 0.1882 0.3043 + 0.6504 0.3113 0.0771 spike_snippets(:,:,4) = - 0.4854 0.2021 0.4178 - 0.1042 0.0572 0.5235 - 0.7787 0.8715 0.3109 - 0.0947 0.2513 0.3742 - 0.4724 0.0945 0.4348 - 0.7312 0.1811 0.7789 - 0.1908 0.4436 0.7879 - 0.3579 0.8552 0.1141 - 0.4405 0.4878 0.4577 - 0.7250 0.3002 0.0478 - 0.4961 0.2143 0.2460 - 0.3935 0.5856 0.3734 - 0.4304 0.8539 0.6590 - 0.4677 0.2888 0.9005 - 0.6995 0.0156 0.3576 - 0.8153 0.7794 0.9313 - 0.6333 0.6757 0.7350 - 0.5318 0.6517 0.2361 - 0.8009 0.7342 0.3832 - 0.2961 0.9837 0.3576 - 0.2021 0.9876 0.7297 - 0.9424 0.2764 0.0504 - 0.1479 0.1211 0.1844 - 0.4527 0.4286 0.2950 - 0.4787 0.1957 0.8230 - 0.4661 0.1299 0.0478 - 0.4762 0.0754 0.6567 - 0.4106 0.8626 0.7855 - 0.2155 0.7685 0.4191 - 0.8953 0.0073 0.6560 - 0.2029 0.2695 0.3976 - 0.1809 0.4246 0.5822 - 0.9363 0.5071 0.9302 - 0.3073 0.1328 0.5443 - 0.6552 0.0491 0.8480 - 0.3227 0.3559 0.1201 - 0.0361 0.0332 0.5380 - 0.0322 0.5357 0.4574 - 0.8864 0.4393 0.4757 - 0.3848 0.2086 0.7510 + 0.8050 0.2022 0.5860 + 0.5796 0.4442 0.5489 + 0.3618 0.1478 0.7466 + 0.9093 0.7029 0.2356 + 0.0460 0.1836 0.8784 + 0.2005 0.4046 0.1156 + 0.4469 0.5336 0.6318 + 0.9771 0.7806 0.7635 + 0.4451 0.4810 0.1803 + 0.1741 0.2258 0.4179 + 0.7091 0.6490 0.2747 + 0.4820 0.6451 0.5042 + 0.6605 0.6045 0.9469 + 0.0161 0.7395 0.0059 + 0.4782 0.2793 0.8853 + 0.4091 0.9862 0.4804 + 0.8455 0.2913 0.5672 + 0.0649 0.6610 0.3551 + 0.9321 0.3362 0.8347 + 0.4598 0.4687 0.1846 + 0.7372 0.5780 0.8394 + 0.3125 0.0901 0.3703 + 0.4837 0.2241 0.0313 + 0.0275 0.7825 0.1160 + 0.6096 0.8158 0.9808 + 0.4574 0.8434 0.0143 + 0.1786 0.6356 0.4819 + 0.8691 0.1741 0.4058 + 0.0887 0.9107 0.3661 + 0.9826 0.7998 0.8946 + 0.9549 0.2801 0.6857 + 0.9784 0.3684 0.1300 + 0.6258 0.8026 0.6570 + 0.5787 0.1236 0.1830 + 0.5000 0.9966 0.2871 + 0.0470 0.1272 0.4818 + 0.8635 0.1213 0.7935 + 0.8270 0.6987 0.0980 + 0.0250 0.9571 0.9466 + 0.4383 0.4128 0.4984 spike_snippets(:,:,5) = - 0.1860 0.0536 0.5940 - 0.2376 0.8684 0.8130 - 0.1716 0.3393 0.4770 - 0.0312 0.1379 0.6187 - 0.3256 0.6297 0.1215 - 0.8935 0.3748 0.4845 - 0.6420 0.1018 0.4572 - 0.1572 0.6465 0.1285 - 0.7944 0.8081 0.1087 - 0.3353 0.1870 0.9674 - 0.3222 0.3932 0.3531 - 0.8497 0.5727 0.3463 - 0.6986 0.6426 0.5585 - 0.7362 0.5711 0.3389 - 0.1066 0.8356 0.3358 - 0.9519 0.5272 0.1312 - 0.0989 0.9641 0.3374 - 0.5441 0.7474 0.6270 - 0.9346 0.6895 0.6218 - 0.7645 0.7542 0.8233 - 0.0604 0.9699 0.0417 - 0.1195 0.0637 0.8807 - 0.4555 0.7875 0.7380 - 0.3830 0.6953 0.0521 - 0.0568 0.6954 0.6580 - 0.3506 0.4798 0.0857 - 0.2994 0.7058 0.4222 - 0.3651 0.4766 0.6714 - 0.6819 0.1449 0.8841 - 0.7518 0.6569 0.8799 - 0.4554 0.0071 0.1870 - 0.1671 0.5957 0.8323 - 0.7819 0.1208 0.0767 - 0.5283 0.8852 0.1754 - 0.4018 0.9644 0.2548 - 0.3075 0.7336 0.8771 - 0.8817 0.0490 0.6314 - 0.9053 0.7864 0.7232 - 0.3306 0.1048 0.3259 - 0.4217 0.0060 0.3249 + 0.5913 0.8706 0.2520 + 0.7161 0.0618 0.4407 + 0.5908 0.8786 0.0151 + 0.6327 0.6154 0.5395 + 0.1973 0.7438 0.3234 + 0.0870 0.2944 0.4277 + 0.4847 0.1451 0.3072 + 0.3449 0.5248 0.3223 + 0.5565 0.7196 0.2811 + 0.3149 0.0960 0.2301 + 0.3564 0.1228 0.4846 + 0.5336 0.1059 0.1092 + 0.2556 0.8666 0.5237 + 0.2334 0.4155 0.5159 + 0.4103 0.3421 0.3923 + 0.2627 0.2856 0.4128 + 0.6458 0.6598 0.5874 + 0.5963 0.0843 0.2972 + 0.0502 0.6843 0.4237 + 0.3206 0.3378 0.9895 + 0.5622 0.4088 0.9491 + 0.5645 0.6614 0.4398 + 0.3181 0.7743 0.4310 + 0.5152 0.8521 0.4793 + 0.6703 0.7846 0.1971 + 0.4306 0.8096 0.6323 + 0.1371 0.0387 0.8975 + 0.8258 0.9360 0.5596 + 0.8419 0.4748 0.2337 + 0.0046 0.9465 0.5231 + 0.8142 0.1619 0.4782 + 0.8274 0.6917 0.5729 + 0.0124 0.7184 0.6751 + 0.2896 0.4857 0.0238 + 0.1628 0.7326 0.8865 + 0.8080 0.9400 0.3402 + 0.8077 0.0893 0.3769 + 0.9437 0.2364 0.8215 + 0.6212 0.9167 0.2558 + 0.0951 0.8936 0.9542 spike_snippets(:,:,6) = - 0.3607 0.6747 0.2823 - 0.8019 0.7234 0.6816 - 0.9769 0.9206 0.9695 - 0.8595 0.1186 0.5267 - 0.8213 0.5041 0.7992 - 0.6864 0.4441 0.3328 - 0.4342 0.7906 0.7966 - 0.2791 0.6789 0.6589 - 0.0677 0.1800 0.8605 - 0.9977 0.6627 0.8032 - 0.6905 0.0662 0.9176 - 0.6056 0.3628 0.2537 - 0.3349 0.6504 0.4738 - 0.3405 0.3380 0.9896 - 0.9532 0.6461 0.2478 - 0.6151 0.3351 0.3112 - 0.9391 0.4259 0.4215 - 0.1135 0.2030 0.1276 - 0.6935 0.5926 0.5615 - 0.9860 0.1078 0.4081 - 0.8066 0.0918 0.1500 - 0.3176 0.4185 0.3038 - 0.5564 0.0260 0.1120 - 0.2822 0.2521 0.1910 - 0.5111 0.1336 0.9303 - 0.9938 0.0073 0.2631 - 0.9386 0.2338 0.9264 - 0.8758 0.3476 0.6830 - 0.0299 0.3936 0.0800 - 0.5553 0.8059 0.5107 - 0.5919 0.3904 0.7407 - 0.3952 0.6322 0.8418 - 0.0015 0.1364 0.9954 - 0.6989 0.2713 0.1460 - 0.1746 0.6716 0.0101 - 0.3299 0.8212 0.8991 - 0.2970 0.9432 0.8047 - 0.9798 0.9383 0.8505 - 0.4682 0.5601 0.8434 - 0.4084 0.6759 0.9916 + 0.8355 0.5637 0.7755 + 0.2274 0.3269 0.3431 + 0.3749 0.3844 0.4181 + 0.6306 0.5490 0.0857 + 0.3787 0.4608 0.9933 + 0.5684 0.2314 0.9910 + 0.8612 0.8184 0.2795 + 0.0594 0.1986 0.1672 + 0.4588 0.4749 0.5851 + 0.2411 0.0279 0.5333 + 0.2000 0.8661 0.3145 + 0.1040 0.8509 0.0429 + 0.4510 0.3810 0.4695 + 0.6253 0.1327 0.9410 + 0.2672 0.1820 0.3754 + 0.5340 0.0297 0.2965 + 0.1050 0.1508 0.4010 + 0.8741 0.9200 0.5657 + 0.4239 0.5883 0.4612 + 0.5997 0.0074 0.4411 + 0.2558 0.1972 0.9108 + 0.7621 0.7016 0.3741 + 0.1205 0.0695 0.5496 + 0.2904 0.0255 0.0484 + 0.8102 0.7424 0.2196 + 0.1073 0.4464 0.9746 + 0.0747 0.1256 0.1908 + 0.0275 0.2822 0.3473 + 0.9470 0.4516 0.2231 + 0.5762 0.6301 0.6778 + 0.7522 0.1073 0.8839 + 0.4510 0.6959 0.3521 + 0.3911 0.9126 0.5941 + 0.9814 0.8108 0.5995 + 0.2263 0.3503 0.1219 + 0.2262 0.0686 0.8908 + 0.9722 0.6025 0.8860 + 0.0521 0.6195 0.3267 + 0.6933 0.6580 0.1238 + 0.7840 0.2751 0.9997 spike_snippets(:,:,7) = - 0.0571 0.8938 0.2892 - 0.3651 0.2947 0.0883 - 0.0048 0.5505 0.2311 - 0.0752 0.5008 0.0071 - 0.1115 0.1171 0.3412 - 0.2859 0.2660 0.7362 - 0.8617 0.7911 0.6713 - 0.7250 0.9561 0.2437 - 0.3928 0.7430 0.5275 - 0.4087 0.4779 0.9706 - 0.1443 0.3129 0.7893 - 0.5913 0.3437 0.1562 - 0.4039 0.9153 0.6639 - 0.1441 0.5124 0.6560 - 0.8561 0.5080 0.9686 - 0.4229 0.9691 0.2507 - 0.2713 0.5633 0.6792 - 0.0239 0.2525 0.9951 - 0.4989 0.3135 0.1867 - 0.6718 0.8556 0.8071 - 0.8666 0.1969 0.1976 - 0.1018 0.3002 0.1270 - 0.3555 0.5716 0.8467 - 0.7235 0.7092 0.0841 - 0.1264 0.0393 0.0440 - 0.7326 0.2412 0.5221 - 0.0684 0.3701 0.9379 - 0.3814 0.2398 0.9121 - 0.8694 0.0473 0.1581 - 0.5230 0.8057 0.0546 - 0.5274 0.3905 0.7978 - 0.2959 0.0482 0.5761 - 0.3504 0.3914 0.5200 - 0.8993 0.2229 0.4167 - 0.0838 0.4613 0.7469 - 0.8273 0.6824 0.5753 - 0.8421 0.8724 0.1875 - 0.3069 0.7149 0.9203 - 0.8881 0.0453 0.7021 - 0.8480 0.5593 0.0597 + 0.9348 0.5672 0.6494 + 0.6230 0.3300 0.7007 + 0.4442 0.0659 0.1242 + 0.7114 0.5661 0.2602 + 0.0429 0.1881 0.5538 + 0.8699 0.9545 0.7000 + 0.2914 0.0736 0.5799 + 0.8541 0.5021 0.3541 + 0.5734 0.4741 0.6012 + 0.5879 0.1169 0.9234 + 0.6626 0.3217 0.6066 + 0.4561 0.3203 0.5923 + 0.9674 0.8924 0.0659 + 0.2196 0.8062 0.2753 + 0.6065 0.3989 0.9592 + 0.0842 0.8840 0.8314 + 0.4492 0.3714 0.4889 + 0.2868 0.8496 0.4936 + 0.1131 0.4815 0.8227 + 0.7724 0.3689 0.2368 + 0.1026 0.7261 0.7530 + 0.6204 0.1422 0.7569 + 0.9188 0.9783 0.5233 + 0.0023 0.2101 0.1290 + 0.6068 0.1084 0.7324 + 0.4695 0.5852 0.6174 + 0.6207 0.7780 0.2677 + 0.1279 0.1070 0.0026 + 0.6935 0.1865 0.4121 + 0.5727 0.1962 0.7182 + 0.3159 0.0386 0.3871 + 0.3459 0.4791 0.8994 + 0.2445 0.5204 0.6407 + 0.6440 0.6374 0.8091 + 0.8246 0.1185 0.8605 + 0.8813 0.6919 0.5799 + 0.1067 0.4817 0.2726 + 0.3286 0.4898 0.6359 + 0.8793 0.0062 0.7552 + 0.2744 0.2255 0.8729 spike_snippets(:,:,8) = - 0.5469 0.2381 0.3206 - 0.1442 0.0464 0.9169 - 0.8726 0.4046 0.1317 - 0.3666 0.0378 0.7042 - 0.1399 0.5182 0.1363 - 0.9368 0.7287 0.7152 - 0.7624 0.0543 0.3947 - 0.7231 0.4113 0.6290 - 0.4949 0.3340 0.8478 - 0.6423 0.7035 0.9309 - 0.6111 0.9467 0.7805 - 0.0830 0.3386 0.1138 - 0.6171 0.0343 0.6772 - 0.5062 0.2758 0.3346 - 0.3766 0.5560 0.6250 - 0.1964 0.1594 0.8136 - 0.2617 0.4583 0.1110 - 0.0918 0.6463 0.7804 - 0.9457 0.4661 0.8166 - 0.1252 0.4231 0.8606 - 0.7374 0.7485 0.3757 - 0.1418 0.2033 0.9158 - 0.4184 0.0849 0.9580 - 0.4020 0.1756 0.7954 - 0.3852 0.2716 0.4669 - 0.4989 0.4680 0.5607 - 0.2454 0.1776 0.6862 - 0.0040 0.4639 0.3231 - 0.0427 0.0131 0.4277 - 0.3237 0.7697 0.2445 - 0.2296 0.8780 0.5891 - 0.4673 0.3589 0.6978 - 0.9605 0.5383 0.8642 - 0.6235 0.9730 0.8974 - 0.8655 0.3656 0.7443 - 0.2165 0.9781 0.7558 - 0.8414 0.3375 0.1513 - 0.6390 0.4023 0.5663 - 0.2621 0.5162 0.0405 - 0.8289 0.3021 0.8460 + 0.3559 0.3502 0.4184 + 0.1456 0.7047 0.4624 + 0.0364 0.5867 0.9092 + 0.5403 0.8551 0.8671 + 0.4563 0.5706 0.5792 + 0.4000 0.5206 0.9052 + 0.9328 0.8906 0.1171 + 0.5250 0.7959 0.7344 + 0.2594 0.6278 0.1148 + 0.8432 0.2758 0.7820 + 0.7348 0.1972 0.3360 + 0.0840 0.1389 0.4690 + 0.6533 0.9474 0.6290 + 0.1758 0.2443 0.1279 + 0.1706 0.1410 0.9089 + 0.4944 0.0307 0.0575 + 0.6134 0.0540 0.3751 + 0.3314 0.0149 0.7502 + 0.8902 0.2016 0.9204 + 0.3945 0.1937 0.0392 + 0.8257 0.9887 0.1202 + 0.2154 0.2457 0.1660 + 0.0023 0.6066 0.1006 + 0.2223 0.0890 0.2271 + 0.1103 0.1547 0.5031 + 0.4946 0.7406 0.5282 + 0.1234 0.0530 0.4693 + 0.7059 0.9016 0.4029 + 0.1858 0.9035 0.7578 + 0.8333 0.7042 0.3734 + 0.9886 0.5343 0.1843 + 0.1650 0.4507 0.9497 + 0.8576 0.5598 0.4163 + 0.3344 0.4154 0.3729 + 0.5832 0.1692 0.8046 + 0.0764 0.7459 0.2572 + 0.0343 0.4037 0.8575 + 0.3879 0.8997 0.3826 + 0.4534 0.1001 0.7087 + 0.5255 0.2042 0.7357 spike_snippets(:,:,9) = - 0.4691 0.7988 0.0529 - 0.9929 0.6395 0.6071 - 0.7489 0.2541 0.8289 - 0.0846 0.9819 0.9793 - 0.9771 0.4078 0.9797 - 0.8538 0.5584 0.8525 - 0.4623 0.2815 0.8258 - 0.6717 0.7234 0.3825 - 0.3005 0.7018 0.5217 - 0.0373 0.3626 0.3260 - 0.2694 0.0014 0.9328 - 0.0935 0.4851 0.9782 - 0.9277 0.7393 0.8915 - 0.4584 0.3471 0.7444 - 0.6188 0.9747 0.5640 - 0.9186 0.2859 0.3740 - 0.5948 0.5343 0.3207 - 0.9418 0.8765 0.9253 - 0.8842 0.1309 0.4301 - 0.3234 0.3499 0.1663 - 0.2283 0.5276 0.5893 - 0.3362 0.4110 0.4571 - 0.1672 0.0150 0.1694 - 0.5063 0.6239 0.0191 - 0.9739 0.8482 0.7000 - 0.9642 0.0519 0.1061 - 0.3678 0.6110 0.6649 - 0.2460 0.7439 0.6566 - 0.0136 0.4706 0.7010 - 0.8887 0.1154 0.8915 - 0.4598 0.1088 0.0265 - 0.4780 0.0377 0.1051 - 0.6038 0.4467 0.5940 - 0.5292 0.5928 0.9708 - 0.4460 0.6881 0.8970 - 0.3750 0.5452 0.6821 - 0.7657 0.2439 0.3457 - 0.9692 0.2747 0.4023 - 0.5081 0.2458 0.8449 - 0.2699 0.1724 0.6493 + 0.7075 0.3583 0.2809 + 0.9943 0.8379 0.8414 + 0.4010 0.6446 0.2016 + 0.2224 0.3620 0.1538 + 0.0410 0.2821 0.2583 + 0.9369 0.0431 0.9306 + 0.9925 0.3225 0.9261 + 0.1077 0.2515 0.5068 + 0.4240 0.3376 0.0569 + 0.5236 0.5543 0.9493 + 0.6657 0.5300 0.8385 + 0.3563 0.7412 0.3676 + 0.8088 0.1033 0.4451 + 0.3500 0.2520 0.6293 + 0.7315 0.7107 0.5051 + 0.3474 0.7358 0.2772 + 0.3127 0.1042 0.4424 + 0.0544 0.1513 0.2170 + 0.9940 0.9846 0.5657 + 0.3050 0.7328 0.5181 + 0.7067 0.5802 0.5910 + 0.0262 0.1544 0.0785 + 0.0299 0.2458 0.1297 + 0.3248 0.4770 0.5600 + 0.9692 0.0887 0.6627 + 0.4190 0.9029 0.1486 + 0.1847 0.4102 0.0110 + 0.8229 0.2542 0.8645 + 0.8748 0.7377 0.6509 + 0.8114 0.8655 0.0641 + 0.7379 0.4173 0.7943 + 0.1262 0.2913 0.3552 + 0.7535 0.4450 0.5206 + 0.9617 0.1137 0.8812 + 0.9513 0.4632 0.9043 + 0.0408 0.3225 0.1974 + 0.0124 0.4705 0.4695 + 0.8570 0.5250 0.1845 + 0.3925 0.4026 0.9171 + 0.2274 0.9037 0.7655 spike_snippets(:,:,10) = - 0.2646 0.4643 0.9420 - 0.2981 0.8982 0.9420 - 0.9444 0.8127 0.2281 - 0.0019 0.9399 0.6619 - 0.8383 0.3594 0.0589 - 0.3812 0.7412 0.3856 - 0.0461 0.3143 0.6805 - 0.2631 0.5349 0.8362 - 0.6679 0.2794 0.0747 - 0.6365 0.1144 0.1717 - 0.9935 0.8025 0.8176 - 0.2022 0.7851 0.6757 - 0.4380 0.6696 0.4313 - 0.6085 0.2422 0.5570 - 0.1107 0.3251 0.0433 - 0.9562 0.5477 0.2331 - 0.7087 0.1371 0.4938 - 0.7187 0.5549 0.4971 - 0.5788 0.5722 0.0299 - 0.6707 0.4923 0.2003 - 0.6433 0.4343 0.4186 - 0.4536 0.4802 0.5284 - 0.8884 0.5167 0.3753 - 0.7600 0.1937 0.3257 - 0.2230 0.4037 0.1190 - 0.6195 0.8798 0.7132 - 0.6905 0.4647 0.3077 - 0.2035 0.4971 0.3984 - 0.2586 0.8970 0.0824 - 0.3915 0.7657 0.8055 - 0.1682 0.0791 0.8345 - 0.0808 0.8050 0.3915 - 0.2290 0.9915 0.2723 - 0.1630 0.0845 0.3458 - 0.2780 0.0904 0.4128 - 0.2752 0.0924 0.5610 - 0.1138 0.8468 0.0026 - 0.1058 0.0355 0.9058 - 0.7652 0.2477 0.4562 - 0.9184 0.5650 0.4295 + 0.7941 0.5149 0.8517 + 0.7471 0.8854 0.1999 + 0.2383 0.5179 0.0416 + 0.0682 0.5410 0.5133 + 0.3799 0.4434 0.9443 + 0.0974 0.8834 0.6782 + 0.0608 0.0798 0.6398 + 0.4075 0.8149 0.1136 + 0.8780 0.0440 0.9261 + 0.5841 0.8798 0.2789 + 0.1936 0.6428 0.6757 + 0.2792 0.4726 0.1642 + 0.7121 0.9948 0.7833 + 0.7346 0.2496 0.0774 + 0.2914 0.9707 0.6684 + 0.8672 0.1230 0.0800 + 0.8510 0.3240 0.8299 + 0.0924 0.2497 0.7994 + 0.1204 0.1693 0.3222 + 0.6565 0.4299 0.4249 + 0.9711 0.2600 0.8885 + 0.0870 0.0539 0.9095 + 0.6804 0.5909 0.8776 + 0.9831 0.9556 0.0354 + 0.4005 0.2000 0.8917 + 0.7770 0.7415 0.7880 + 0.4564 0.4864 0.3968 + 0.1782 0.2553 0.2720 + 0.9537 0.1915 0.3335 + 0.9620 0.9273 0.4582 + 0.5031 0.2392 0.0366 + 0.2139 0.8565 0.3517 + 0.0704 0.9866 0.9983 + 0.8044 0.9471 0.0526 + 0.9997 0.5544 0.4836 + 0.5022 0.2241 0.1854 + 0.1620 0.1630 0.6789 + 0.0508 0.6460 0.2120 + 0.3283 0.4058 0.2809 + 0.8139 0.0804 0.7395 spike_snippets(:,:,11) = - 0.3360 0.2768 0.2706 - 0.5883 0.5018 0.6218 - 0.5947 0.7284 0.9354 - 0.5599 0.6084 0.1978 - 0.9211 0.8140 0.0545 - 0.7966 0.8976 0.2581 - 0.3007 0.5282 0.5474 - 0.8500 0.4486 0.2071 - 0.0512 0.4022 0.9222 - 0.6838 0.6349 0.0706 - 0.9257 0.6698 0.5748 - 0.2152 0.5339 0.8961 - 0.6102 0.5816 0.3377 - 0.3648 0.6726 0.8777 - 0.2972 0.3565 0.8838 - 0.2829 0.7476 0.3734 - 0.9157 0.7164 0.6893 - 0.8746 0.0111 0.0486 - 0.1815 0.0744 0.1274 - 0.8996 0.0554 0.3310 - 0.9089 0.8892 0.4710 - 0.2577 0.9764 0.5696 - 0.9031 0.9686 0.5731 - 0.7543 0.8753 0.5673 - 0.0123 0.9955 0.3922 - 0.5084 0.7922 0.4345 - 0.4505 0.1746 0.2203 - 0.7865 0.5427 0.2527 - 0.5117 0.9445 0.8626 - 0.4887 0.1589 0.7124 - 0.2850 0.8352 0.5718 - 0.0180 0.3309 0.5588 - 0.5399 0.5011 0.8363 - 0.4116 0.7307 0.3184 - 0.5524 0.4636 0.5660 - 0.7529 0.1027 0.1108 - 0.6302 0.5957 0.6093 - 0.0836 0.9445 0.1758 - 0.0951 0.9562 0.2351 - 0.0849 0.0117 0.7479 + 0.2544 0.4666 0.6415 + 0.7723 0.3364 0.3455 + 0.3722 0.6145 0.6607 + 0.0373 0.8671 0.8135 + 0.9431 0.6031 0.3475 + 0.5092 0.7629 0.6814 + 0.8818 0.7412 0.0964 + 0.4394 0.9440 0.6040 + 0.9009 0.4173 0.6211 + 0.5267 0.2959 0.3061 + 0.1462 0.9594 0.5161 + 0.3670 0.2076 0.1559 + 0.9726 0.5897 0.8215 + 0.5163 0.2440 0.4610 + 0.7033 0.8081 0.0302 + 0.7474 0.2464 0.0298 + 0.0537 0.4461 0.1025 + 0.5831 0.2761 0.1187 + 0.4606 0.5784 0.3064 + 0.8775 0.7498 0.3991 + 0.9276 0.5925 0.3863 + 0.4750 0.3527 0.7902 + 0.3017 0.6283 0.7300 + 0.1315 0.8961 0.5218 + 0.6252 0.2800 0.2163 + 0.7672 0.1983 0.2008 + 0.2827 0.0721 0.6766 + 0.0958 0.6591 0.6342 + 0.5979 0.5047 0.9257 + 0.3368 0.1198 0.3731 + 0.2173 0.1262 0.7610 + 0.5702 0.7797 0.4054 + 0.4685 0.7710 0.0751 + 0.6500 0.0987 0.0612 + 0.6616 0.7665 0.9412 + 0.9498 0.5447 0.3660 + 0.5139 0.9977 0.5679 + 0.0635 0.3845 0.9624 + 0.6494 0.0416 0.4315 + 0.6296 0.1024 0.7642 spike_snippets(:,:,12) = - 0.8269 0.0684 0.4439 - 0.7323 0.1734 0.0751 - 0.6568 0.2218 0.2693 - 0.5686 0.5931 0.7554 - 0.8733 0.5064 0.8141 - 0.6172 0.8727 0.9094 - 0.0136 0.5690 0.1943 - 0.8223 0.9764 0.9327 - 0.0876 0.5534 0.0578 - 0.3906 0.9969 0.1656 - 0.2662 0.9741 0.8474 - 0.2071 0.9988 0.7772 - 0.6265 0.1958 0.3806 - 0.2814 0.7539 0.9439 - 0.6970 0.4425 0.1954 - 0.5497 0.7827 0.0818 - 0.9411 0.2419 0.0642 - 0.3968 0.5786 0.3247 - 0.5858 0.5023 0.4566 - 0.4175 0.2451 0.5167 - 0.3272 0.8763 0.9273 - 0.9850 0.8327 0.0031 - 0.8648 0.6048 0.2515 - 0.7225 0.9099 0.5846 - 0.5928 0.7970 0.9333 - 0.9333 0.4034 0.3905 - 0.7934 0.0362 0.6215 - 0.6854 0.4067 0.6295 - 0.3693 0.6808 0.0589 - 0.2698 0.8693 0.6090 - 0.0236 0.6264 0.6358 - 0.7969 0.6779 0.1526 - 0.1936 1.0000 0.0233 - 0.4508 0.3273 0.7223 - 0.9213 0.7523 0.2685 - 0.3340 0.4351 0.9825 - 0.8270 0.3205 0.1033 - 0.4581 0.7766 0.6554 - 0.1236 0.8837 0.3875 - 0.3160 0.4216 0.8846 + 0.6146 0.0968 0.3336 + 0.3430 0.2655 0.0046 + 0.1619 0.0499 0.5731 + 0.6363 0.8267 0.4098 + 0.6908 0.1887 0.9967 + 0.2547 0.3581 0.4260 + 0.5295 0.4325 0.6309 + 0.6853 0.4064 0.5448 + 0.8801 0.5851 0.9206 + 0.2101 0.5392 0.8670 + 0.4839 0.2279 0.0945 + 0.1867 0.9327 0.1141 + 0.8110 0.4286 0.8918 + 0.0652 0.8428 0.6683 + 0.6747 0.7311 0.8710 + 0.8184 0.4235 0.1510 + 0.0058 0.8850 0.5862 + 0.4190 0.4357 0.1666 + 0.8585 0.5593 0.4555 + 0.3209 0.5544 0.3689 + 0.5356 0.1007 0.9436 + 0.1546 0.4301 0.4500 + 0.0562 0.7332 0.8797 + 0.4663 0.0001 0.5342 + 0.1850 0.7657 0.5038 + 0.9125 0.2055 0.2562 + 0.5721 0.0714 0.6559 + 0.8022 0.8499 0.5639 + 0.6421 0.5074 0.3886 + 0.8348 0.8373 0.2105 + 0.1514 0.8200 0.3957 + 0.3065 0.4698 0.9103 + 0.5984 0.3031 0.2229 + 0.0662 0.6775 0.7322 + 0.3514 0.1481 0.1377 + 0.2903 0.8945 0.4549 + 0.2797 0.1967 0.2417 + 0.8218 0.1114 0.6109 + 0.1070 0.9263 0.5711 + 0.6670 0.0539 0.6385 spike_snippets(:,:,13) = - 0.3545 0.3870 0.0442 - 0.0984 0.6191 0.7319 - 0.4817 0.1129 0.7033 - 0.2747 0.7700 0.5511 - 0.9428 0.1419 0.6388 - 0.4259 0.8899 0.2468 - 0.5116 0.7886 0.0778 - 0.4094 0.0737 0.5975 - 0.5140 0.1224 0.4620 - 0.5372 0.0651 0.4016 - 0.6660 0.9459 0.3132 - 0.4055 0.3468 0.6925 - 0.3096 0.0933 0.2572 - 0.4144 0.0373 0.5043 - 0.9139 0.3029 0.4919 - 0.3319 0.8805 0.7918 - 0.7234 0.9948 0.1098 - 0.0170 0.1829 0.1256 - 0.2830 0.1492 0.3176 - 0.2600 0.7454 0.1790 - 0.9421 0.7018 0.4925 - 0.4013 0.3687 0.5861 - 0.5564 0.1115 0.6931 - 0.5644 0.5759 0.5131 - 0.7829 0.3622 0.5733 - 0.4672 0.1752 0.3412 - 0.6831 0.0186 0.9405 - 0.6730 0.2138 0.3973 - 0.6319 0.7183 0.0820 - 0.5931 0.5956 0.3570 - 0.5988 0.1654 0.1494 - 0.5480 0.1904 0.6582 - 0.9045 0.6122 0.3443 - 0.4664 0.2166 0.3314 - 0.0590 0.6913 0.4432 - 0.6690 0.9421 0.0179 - 0.5997 0.5471 0.8197 - 0.9114 0.1852 0.7625 - 0.7377 0.3112 0.3322 - 0.1051 0.0307 0.9699 + 0.0384 0.0447 0.7745 + 0.2359 0.0803 0.5582 + 0.8278 0.1725 0.9556 + 0.6773 0.0045 0.6783 + 0.7831 0.7674 0.2515 + 0.7814 0.6090 0.8158 + 0.9209 0.5476 0.1611 + 0.7194 0.7287 0.4161 + 0.7315 0.6364 0.0511 + 0.9443 0.4515 0.2623 + 0.0348 0.6175 0.1363 + 0.8028 0.9249 0.8991 + 0.6904 0.8000 0.9812 + 0.5899 0.2797 0.2728 + 0.2293 0.3397 0.7309 + 0.7477 0.0589 0.0045 + 0.4752 0.1478 0.5416 + 0.4774 0.9201 0.1033 + 0.7057 0.4585 0.3031 + 0.9951 0.6517 0.5719 + 0.5022 0.0639 0.1790 + 0.4090 0.1917 0.6295 + 0.6272 0.0826 0.9543 + 0.3429 0.6129 0.5725 + 0.6568 0.0692 0.4979 + 0.9034 0.4953 0.0361 + 0.4969 0.8789 0.0178 + 0.3767 0.8545 0.4115 + 0.8487 0.4793 0.3571 + 0.6909 0.0469 0.2186 + 0.7016 0.1703 0.6514 + 0.3019 0.9341 0.4815 + 0.0172 0.5732 0.9753 + 0.9003 0.7146 0.9119 + 0.8645 0.1699 0.7649 + 0.4176 0.7374 0.9153 + 0.1825 0.2433 0.8153 + 0.6800 0.9977 0.3573 + 0.9317 0.1497 0.5918 + 0.9806 0.8552 0.7741 spike_snippets(:,:,14) = - 0.8738 0.2539 0.5170 - 0.2402 0.9058 0.8826 - 0.5606 0.2673 0.7385 - 0.4901 0.1698 0.0661 - 0.9379 0.7687 0.2550 - 0.3886 0.8274 0.8461 - 0.6457 0.2094 0.0937 - 0.1621 0.3068 0.3773 - 0.5236 0.8581 0.4598 - 0.0713 0.0281 0.4309 - 0.0261 0.3696 0.1999 - 0.2469 0.5367 0.7956 - 0.8040 0.6403 0.4242 - 0.0573 0.7759 0.3112 - 0.6276 0.5760 0.6602 - 0.6207 0.0823 0.4012 - 0.8178 0.4223 0.2240 - 0.4988 0.1640 0.9503 - 0.9282 0.9511 0.7333 - 0.9976 0.8312 0.1382 - 0.3378 0.5846 0.9600 - 0.0158 0.1242 0.9066 - 0.9885 0.3426 0.5408 - 0.0505 0.8228 0.2916 - 0.9758 0.7815 0.6794 - 0.3000 0.9950 0.0827 - 0.9738 0.6339 0.1007 - 0.1853 0.2731 0.0706 - 0.4156 0.1586 0.1189 - 0.6042 0.0076 0.5364 - 0.8413 0.5236 0.2999 - 0.9670 0.2042 0.8950 - 0.0941 0.8300 0.0252 - 0.3518 0.4673 0.2669 - 0.8261 0.7968 0.3462 - 0.2083 0.6459 0.9281 - 0.4527 0.4038 0.3700 - 0.9544 0.9912 0.0818 - 0.8993 0.6790 0.6198 - 0.3285 0.1273 0.1766 + 0.9529 0.4197 0.7940 + 0.0680 0.2133 0.2558 + 0.3934 0.9782 0.8711 + 0.9798 0.4954 0.1090 + 0.8314 0.6794 0.1408 + 0.6423 0.9708 0.2159 + 0.6231 0.8391 0.7335 + 0.2810 0.8298 0.2176 + 0.3974 0.6474 0.8730 + 0.2421 0.9274 0.3335 + 0.7245 0.3462 0.8549 + 0.6980 0.8378 0.7992 + 0.2055 0.2089 0.5516 + 0.5671 0.4157 0.0663 + 0.4671 0.0046 0.2549 + 0.6323 0.2667 0.4567 + 0.2121 0.4947 0.0204 + 0.7162 0.4741 0.5615 + 0.7168 0.2574 0.1147 + 0.9861 0.7936 0.2834 + 0.8550 0.3711 0.7613 + 0.2810 0.6640 0.2897 + 0.5666 0.7711 0.8337 + 0.0302 0.8985 0.0659 + 0.3424 0.3668 0.0051 + 0.1083 0.3183 0.8842 + 0.2733 0.8660 0.7756 + 0.1294 0.2436 0.2996 + 0.4480 0.2132 0.7510 + 0.2924 0.7984 0.5947 + 0.4414 0.0408 0.9539 + 0.5015 0.4748 0.2327 + 0.3004 0.1017 0.0860 + 0.4600 0.1732 0.4097 + 0.4972 0.3785 0.1298 + 0.9853 0.8222 0.8488 + 0.9130 0.3340 0.2946 + 0.0938 0.2253 0.0173 + 0.0004 0.3570 0.9206 + 0.1234 0.8649 0.5750 spike_snippets(:,:,15) = - 0.2518 0.2132 0.6517 - 0.4294 0.2029 0.5901 - 0.1920 0.6816 0.0450 - 0.7183 0.2932 0.3240 - 0.3578 0.0861 0.9851 - 0.3588 0.7868 0.3229 - 0.6010 0.2346 0.3567 - 0.3353 0.8160 0.9498 - 0.6412 0.4145 0.4684 - 0.7884 0.5874 0.5773 - 0.8174 0.3730 0.7253 - 0.6890 0.8826 0.1494 - 0.6320 0.2392 0.3984 - 0.2187 0.1697 0.5931 - 0.4682 0.2170 0.4543 - 0.3698 0.5491 0.1559 - 0.4286 0.7919 0.6831 - 0.6181 0.8617 0.6636 - 0.5057 0.3220 0.4828 - 0.0323 0.0533 0.3387 - 0.8523 0.6696 0.8105 - 0.0593 0.3572 0.5220 - 0.7963 0.7267 0.4698 - 0.1692 0.8722 0.9332 - 0.8412 0.7119 0.8153 - 0.2336 0.3204 0.5797 - 0.5893 0.7290 0.6995 - 0.0408 0.6390 0.3742 - 0.5699 0.7568 0.5696 - 0.1617 0.6294 0.5978 - 0.8506 0.3235 0.0180 - 0.5276 0.7121 0.4807 - 0.0257 0.5351 0.0431 - 0.8287 0.6561 0.6653 - 0.7459 0.8562 0.6875 - 0.3030 0.9366 0.7649 - 0.3332 0.1334 0.1270 - 0.9961 0.1659 0.6390 - 0.3319 0.7664 0.4069 - 0.5801 0.2167 0.8845 + 0.9922 0.6567 0.1626 + 0.7361 0.5865 0.8551 + 0.3929 0.8085 0.1534 + 0.0604 0.4683 0.8830 + 0.9938 0.9102 0.9857 + 0.9197 0.5770 0.0050 + 0.3592 0.8451 0.9703 + 0.4458 0.3356 0.3232 + 0.0204 0.0565 0.8186 + 0.0823 0.8806 0.2045 + 0.7850 0.5394 0.5331 + 0.4210 0.1433 0.4199 + 0.9766 0.7337 0.7132 + 0.9982 0.2258 0.4000 + 0.6702 0.7083 0.9060 + 0.4952 0.0332 0.1472 + 0.6573 0.1771 0.7804 + 0.1723 0.3458 0.1954 + 0.9137 0.3648 0.7029 + 0.3399 0.3422 0.3585 + 0.2941 0.7883 0.9296 + 0.3875 0.4254 0.1448 + 0.5145 0.9283 0.1949 + 0.3563 0.7005 0.8120 + 0.2778 0.9611 0.9273 + 0.6046 0.2139 0.9705 + 0.4420 0.0302 0.1635 + 0.0088 0.6501 0.5761 + 0.7116 0.0831 0.9489 + 0.8314 0.4768 0.4114 + 0.1151 0.1037 0.5107 + 0.3827 0.2916 0.8996 + 0.4661 0.2260 0.1121 + 0.7078 0.4180 0.0222 + 0.7247 0.5719 0.9316 + 0.1403 0.8271 0.9396 + 0.2412 0.1451 0.0554 + 0.2553 0.1747 0.9921 + 0.6871 0.4399 0.3530 + 0.1298 0.2656 0.9714 spike_snippets(:,:,16) = - 0.3617 0.4796 0.3849 - 0.2697 0.9468 0.2100 - 0.6193 0.7343 0.1739 - 0.9393 0.8904 0.9818 - 0.5152 0.3033 0.4682 - 0.7790 0.8632 0.9662 - 0.4675 0.4774 0.5807 - 0.5060 0.4397 0.1240 - 0.9510 0.8019 0.9094 - 0.0934 0.1602 0.6181 - 0.0969 0.6271 0.8978 - 0.2026 0.4344 0.6037 - 0.6735 0.9694 0.1817 - 0.3916 0.3344 0.9062 - 0.9732 0.7063 0.0107 - 0.2138 0.3680 0.3148 - 0.4871 0.1667 0.1139 - 0.6683 0.2919 0.4264 - 0.3876 0.0255 0.8798 - 0.5643 0.8564 0.2776 - 0.5715 0.9426 0.0235 - 0.6990 0.6762 0.3343 - 0.8093 0.2319 0.1015 - 0.3863 0.8508 0.8312 - 0.1336 0.2826 0.6013 - 0.9609 0.7174 0.9380 - 0.9554 0.7533 0.1771 - 0.4546 0.6906 0.3352 - 0.6678 0.1365 0.7942 - 0.4918 0.9342 0.2363 - 0.5866 0.6735 0.0328 - 0.7620 0.9728 0.0622 - 0.6156 0.4195 0.1368 - 0.8612 0.5185 0.0101 - 0.2808 0.2869 0.7742 - 0.4417 0.8612 0.8285 - 0.7203 0.2428 0.9894 - 0.8703 0.6190 0.7001 - 0.4393 0.1567 0.1823 - 0.7885 0.1806 0.0020 + 0.9972 0.9936 0.5482 + 0.8326 0.0840 0.4691 + 0.7708 0.0330 0.8159 + 0.5131 0.1295 0.2345 + 0.7615 0.2317 0.1027 + 0.1724 0.8394 0.5767 + 0.0137 0.1014 0.1270 + 0.0739 0.5132 0.3428 + 0.2915 0.8071 0.9026 + 0.3845 0.5590 0.0266 + 0.8303 0.0359 0.5994 + 0.1240 0.6085 0.5076 + 0.8980 0.9474 0.3432 + 0.6499 0.3732 0.0730 + 0.3303 0.4004 0.7405 + 0.2498 0.7835 0.6898 + 0.1249 0.7027 0.7510 + 0.6946 0.5686 0.2033 + 0.6918 0.5278 0.6515 + 0.8156 0.7957 0.5573 + 0.4032 0.3450 0.7350 + 0.4818 0.8283 0.2974 + 0.0384 0.0808 0.7130 + 0.1391 0.3200 0.3603 + 0.6069 0.4092 0.1513 + 0.3444 0.3243 0.9263 + 0.9033 0.2053 0.4476 + 0.1142 0.2854 0.8082 + 0.0272 0.1698 0.8336 + 0.5026 0.4346 0.5423 + 0.7878 0.6306 0.2140 + 0.9513 0.9625 0.7080 + 0.5834 0.2035 0.9237 + 0.2557 0.0934 0.4052 + 0.9567 0.7467 0.0456 + 0.5091 0.9380 0.0553 + 0.9153 0.0366 0.1606 + 0.3306 0.0036 0.8340 + 0.4779 0.5815 0.6836 + 0.0585 0.7621 0.6835 spike_snippets(:,:,17) = - 0.1959 0.5420 0.9105 - 0.9073 0.6598 0.9800 - 0.3511 0.7097 0.4335 - 0.6976 0.0432 0.8542 - 0.4499 0.8647 0.0570 - 0.6184 0.1866 0.5088 - 0.1193 0.2679 0.1645 - 0.6003 0.3598 0.0318 - 0.7014 0.7784 0.4366 - 0.2962 0.9476 0.4504 - 0.3308 0.3297 0.9279 - 0.2546 0.0680 0.8303 - 0.9917 0.5504 0.9679 - 0.8936 0.4322 0.1293 - 0.5590 0.5348 0.5241 - 0.4043 0.1695 0.9367 - 0.2596 0.0089 0.7440 - 0.3231 0.3334 0.0031 - 0.2933 0.8405 0.0099 - 0.3029 0.3807 0.3762 - 0.3166 0.8088 0.7310 - 0.4989 0.6476 0.8311 - 0.1168 0.6515 0.7213 - 0.2899 0.3840 0.6481 - 0.1497 0.6184 0.0411 - 0.0861 0.9320 0.1645 - 0.3731 0.4888 0.1075 - 0.3739 0.0245 0.9520 - 0.2799 0.4943 0.5538 - 0.2278 0.6777 0.3999 - 0.2515 0.1443 0.8072 - 0.5196 0.6802 0.8547 - 0.9614 0.4804 0.2351 - 0.3108 0.2935 0.7144 - 0.6170 0.7830 0.1604 - 0.3423 0.2268 0.9950 - 0.0840 0.1316 0.4855 - 0.9375 0.8720 0.7160 - 0.8194 0.4043 0.6775 - 0.2686 0.9371 0.0693 + 0.3960 0.3974 0.5588 + 0.0424 0.4685 0.4894 + 0.8798 0.5952 0.9892 + 0.7382 0.6502 0.6027 + 0.5835 0.2012 0.6278 + 0.3606 0.6030 0.2146 + 0.8293 0.6913 0.4075 + 0.8117 0.7003 0.9414 + 0.7901 0.7728 0.7922 + 0.5847 0.0021 0.7396 + 0.3876 0.2996 0.2556 + 0.7419 0.4900 0.2650 + 0.0490 0.5944 0.5732 + 0.3899 0.8482 0.7060 + 0.6078 0.9582 0.0290 + 0.2723 0.3243 0.8536 + 0.0005 0.7109 0.3435 + 0.9130 0.8274 0.2376 + 0.2565 0.1573 0.0270 + 0.5802 0.9857 0.7257 + 0.2650 0.6423 0.3761 + 0.8502 0.5365 0.7145 + 0.4163 0.4096 0.5124 + 0.1079 0.8086 0.8176 + 0.1324 0.4778 0.9827 + 0.5382 0.3201 0.7392 + 0.7771 0.2693 0.9050 + 0.4876 0.0728 0.7989 + 0.0328 0.2198 0.0266 + 0.9892 0.3329 0.9052 + 0.3862 0.1512 0.2777 + 0.5593 0.2181 0.0367 + 0.6248 0.3320 0.7972 + 0.8769 0.6821 0.0563 + 0.4199 0.6120 0.9375 + 0.2787 0.7777 0.2754 + 0.8244 0.1253 0.8188 + 0.5485 0.7533 0.2894 + 0.6503 0.1747 0.0322 + 0.0543 0.7022 0.9705 spike_snippets(:,:,18) = - 0.2044 0.8060 0.4559 - 0.3989 0.3477 0.0178 - 0.3788 0.1528 0.2253 - 0.4920 0.6866 0.6046 - 0.0173 0.5004 0.6817 - 0.4821 0.8199 0.8309 - 0.2736 0.1016 0.2971 - 0.9217 0.5541 0.4229 - 0.1621 0.0677 0.9017 - 0.5945 0.1912 0.6291 - 0.2916 0.5514 0.5131 - 0.2112 0.8000 0.3688 - 0.8284 0.4171 0.1074 - 0.8941 0.1970 0.8132 - 0.5454 0.1708 0.5964 - 0.0349 0.1684 0.5245 - 0.5870 0.6541 0.5613 - 0.7540 0.6592 0.1215 - 0.1668 0.6609 0.2367 - 0.6786 0.1693 0.0634 - 0.9586 0.3644 0.4699 - 0.3425 0.2172 0.2802 - 0.1701 0.9606 0.7301 - 0.9152 0.3249 0.7825 - 0.8650 0.4647 0.2678 - 0.7262 0.6912 0.9897 - 0.4532 0.6555 0.2157 - 0.7250 0.0509 0.3455 - 0.3804 0.2556 0.8391 - 0.6323 0.8273 0.0621 - 0.7440 0.9607 0.9505 - 0.5396 0.6674 0.5746 - 0.5364 0.2100 0.9133 - 0.5956 0.7204 0.8166 - 0.4304 0.9428 0.1365 - 0.2596 0.5669 0.2789 - 0.1343 0.4623 0.9535 - 0.2614 0.6911 0.2445 - 0.4018 0.0246 0.3004 - 0.0077 0.1523 0.3515 + 0.6586 0.8381 0.9346 + 0.3564 0.1914 0.4731 + 0.5518 0.6622 0.0321 + 0.6634 0.5777 0.4223 + 0.1716 0.2335 0.0385 + 0.2029 0.5658 0.7820 + 0.0426 0.4652 0.7967 + 0.0360 0.2248 0.1815 + 0.7329 0.8276 0.1524 + 0.3917 0.7722 0.6973 + 0.1874 0.7361 0.2067 + 0.2838 0.8671 0.4181 + 0.5444 0.8385 0.8334 + 0.9438 0.5089 0.4384 + 0.3220 0.1924 0.7713 + 0.4797 0.0161 0.6776 + 0.0509 0.9474 0.4790 + 0.5528 0.1435 0.8937 + 0.1712 0.2664 0.4000 + 0.3756 0.1580 0.7842 + 0.7943 0.8386 0.6555 + 0.8971 0.8120 0.6511 + 0.3538 0.1422 0.5621 + 0.4175 0.1287 0.7695 + 0.6317 0.3817 0.7950 + 0.8559 0.0167 0.8612 + 0.8622 0.3802 0.3890 + 0.0369 0.2987 0.0346 + 0.1610 0.0036 0.4241 + 0.7199 0.1141 0.7388 + 0.6749 0.6053 0.3875 + 0.9807 0.8228 0.6587 + 0.2027 0.1864 0.9194 + 0.9936 0.7345 0.3757 + 0.6885 0.1653 0.3631 + 0.8941 0.1107 0.6917 + 0.7975 0.2033 0.0698 + 0.7628 0.9172 0.6178 + 0.8866 0.9178 0.1358 + 0.5250 0.7230 0.1884 spike_snippets(:,:,19) = - 0.4796 0.1469 0.7166 - 0.7013 0.1920 0.6477 - 0.3507 0.7289 0.3165 - 0.8040 0.2512 0.8675 - 0.8645 0.4048 0.6909 - 0.6119 0.1603 0.0853 - 0.3848 0.3168 0.8677 - 0.7272 0.9591 0.4262 - 0.4190 0.5329 0.7629 - 0.8615 0.3420 0.3994 - 0.6660 0.7825 0.5770 - 0.0337 0.5107 0.3806 - 0.2774 0.0544 0.5483 - 0.3664 0.7206 0.4609 - 0.3950 0.5821 0.2499 - 0.8709 0.9255 0.2459 - 0.4484 0.3779 0.7865 - 0.5256 0.7493 0.3957 - 0.3331 0.4078 0.6649 - 0.0315 0.3368 0.5578 - 0.8973 0.6093 0.0103 - 0.8446 0.0363 0.2517 - 0.8092 0.1453 0.8943 - 0.7750 0.4485 0.2392 - 0.8051 0.5641 0.9237 - 0.5442 0.3667 0.5998 - 0.7352 0.7777 0.9312 - 0.4753 0.1060 0.7647 - 0.6985 0.3146 0.1770 - 0.9186 0.0215 0.0437 - 0.8929 0.5599 0.3737 - 0.6774 0.9312 0.5492 - 0.2597 0.3554 0.3777 - 0.3778 0.6063 0.0516 - 0.3313 0.3930 0.4723 - 0.3727 0.7249 0.9840 - 0.7936 0.9136 0.4857 - 0.4638 0.5821 0.0701 - 0.8432 0.2344 0.4754 - 0.5643 0.0735 0.2353 + 0.0843 0.0789 0.0190 + 0.9539 0.2201 0.2193 + 0.3115 0.9336 0.0849 + 0.3433 0.4676 0.2098 + 0.2704 0.2124 0.2048 + 0.1612 0.4393 0.1003 + 0.8375 0.4583 0.4274 + 0.0563 0.4216 0.9778 + 0.4400 0.4879 0.2062 + 0.4732 0.5376 0.3918 + 0.9230 0.5727 0.4353 + 0.7881 0.6609 0.1073 + 0.9234 0.2811 0.0459 + 0.5888 0.4915 0.8911 + 0.2365 0.1278 0.2981 + 0.1332 0.9264 0.4458 + 0.3365 0.7043 0.6547 + 0.8653 0.3776 0.0418 + 0.1819 0.6848 0.7250 + 0.0428 0.6453 0.1657 + 0.7494 0.2659 0.1569 + 0.3866 0.6769 0.7458 + 0.0382 0.7546 0.4898 + 0.7645 0.3238 0.0739 + 0.7457 0.2271 0.3200 + 0.9157 0.1533 0.4651 + 0.7660 0.2698 0.7659 + 0.9227 0.1591 0.3390 + 0.8408 0.8849 0.8486 + 0.1186 0.6178 0.3768 + 0.4187 0.6784 0.4346 + 0.3279 0.7755 0.4404 + 0.8957 0.8531 0.9597 + 0.8631 0.8959 0.0828 + 0.1697 0.9542 0.9433 + 0.2106 0.2864 0.0747 + 0.1872 0.6363 0.1239 + 0.0568 0.2628 0.8335 + 0.9199 0.8350 0.3247 + 0.3773 0.3289 0.0652 spike_snippets(:,:,20) = - 0.6873 0.0605 0.9140 - 0.9657 0.0721 0.8518 - 0.8899 0.1328 0.6940 - 0.0387 0.6798 0.9621 - 0.4656 0.5908 0.2731 - 0.7438 0.5670 0.2736 - 0.3971 0.0360 0.3144 - 0.8050 0.7448 0.6957 - 0.0030 0.4603 0.2473 - 0.2465 0.6805 0.3513 - 0.8086 0.2980 0.2490 - 0.2352 0.3977 0.5605 - 0.2713 0.7731 0.5679 - 0.8310 0.7215 0.5309 - 0.7490 0.9698 0.8578 - 0.5483 0.1271 0.5879 - 0.3070 0.0921 0.7794 - 0.1199 0.8039 0.5579 - 0.9437 0.8100 0.8285 - 0.7219 0.4346 0.4720 - 0.7465 0.6658 0.1583 - 0.5633 0.8219 0.5985 - 0.3870 0.4728 0.3190 - 0.4641 0.8891 0.5325 - 0.8391 0.2668 0.5287 - 0.2010 0.5825 0.9167 - 0.9513 0.0738 0.1681 - 0.2306 0.2030 0.1066 - 0.9499 0.1480 0.6067 - 0.9601 0.6199 0.4368 - 0.9094 0.2456 0.3924 - 0.9030 0.7869 0.9830 - 0.1268 0.3279 0.8036 - 0.4003 0.7065 0.6491 - 0.6768 0.2883 0.4791 - 0.1409 0.1552 0.0926 - 0.7783 0.5634 0.3639 - 0.7050 0.2093 0.0664 - 0.2874 0.9361 0.8809 - 0.5040 0.0051 0.3799 -
 
% Create electrode table region referencing electrodes 0, 1, and 2
shank0_table_region = types.hdmf_common.DynamicTableRegion( ...
'table', types.untyped.ObjectView(electrodesDynamicTable), ...
'description', 'shank0', ...
'data', (0:2)');
 
% Define spike event series for unsorted spike times
spike_events = types.core.SpikeEventSeries( ...
'data', spike_snippets, ...
'timestamps', (0:19)', ... % Timestamps for each event
'description', 'events detected with 100uV threshold', ...
'electrodes', shank0_table_region ...
);
 
% Add spike event series to NWB file acquisition
nwb.acquisition.set('SpikeEvents_Shank0', spike_events);

Detected Events

If you need to store the complete, continuous raw voltage traces, along with unsorted spike times, you should store the traces in ElectricalSeries objects in the acquisition group, and use the EventDetection class to identify the spike events in your raw traces.
% Create the EventDetection object
event_detection = types.core.EventDetection( ...
'detection_method', 'thresholding, 1.5 * std', ...
'source_electricalseries', types.untyped.SoftLink(raw_electrical_series), ...
'source_idx', [1000; 2000; 3000], ...
'times', [.033, .066, .099] ...
);
 
% Add the EventDetection object to the ecephys module
ecephys_module.nwbdatainterface.set('ThresholdEvents', event_detection);

Storing Spike Features (e.g Principal Components)

NWB also provides a way to store features of spikes, such as principal components, using the FeatureExtraction class.
% Generate random feature data (time x channel x feature)
features = rand(3, 12, 4); % 3 time points, 12 channels, 4 features
features = permute(features, [3,2,1]); % reverse dimension order for matnwb
 
% Create the FeatureExtraction object
feature_extraction = types.core.FeatureExtraction( ...
'description', {'PC1', 'PC2', 'PC3', 'PC4'}, ... % Feature descriptions
'electrodes', electrode_table_region, ... % DynamicTableRegion referencing the electrodes table
'times', [.033; .066; .099], ... % Column vector for times
'features', features ...
);
 
% Add the FeatureExtraction object to the ecephys module (if required)
ecephys_module.nwbdatainterface.set('PCA_features', feature_extraction);

Choosing NWB-Types for Electrophysiology Data (A Summary)

As mentioned above, ElectricalSeries objects are meant for storing electrical timeseries data like raw voltage signals or processed signals like LFP or other filtered signals. In addition to the ElectricalSeries class, NWB provides some more classes for storing event-based electropysiological data. We will briefly discuss them here, and refer the reader to the API documentation and the section on Extracellular Physiology in the "NWB Format Specification" for more details on using these objects.
For storing unsorted spiking data, there are two options. Which one you choose depends on what data you have available. If you need to store complete and/or continuous raw voltage traces, you should store the traces with ElectricalSeries objects as acquisition data, and use the EventDetection class for identifying the spike events in your raw traces. If you do not want to store the entire raw voltage traces, only the waveform ‘snippets’ surrounding spike events, you should use SpikeEventSeries objects.
The results of spike sorting (or clustering) should be stored in the top-level Units table. The Units table can hold just the spike times of sorted units or, optionally, include additional waveform information. You can use the optional predefined columns waveform_mean, waveform_sd, and waveforms in the Units table to store individual and mean waveform data.

Writing the NWB File

nwbExport(nwb, 'ecephys_tutorial.nwb')

Reading NWB Data

Data arrays are read passively from the file. Calling TimeSeries.data does not read the data values, but presents an HDF5 object that can be indexed to read data. This allows you to conveniently work with datasets that are too large to fit in RAM all at once. load with no input arguments reads the entire dataset:
nwb2 = nwbRead('ecephys_tutorial.nwb', 'ignorecache');
nwb2.processing.get('ecephys'). ...
nwbdatainterface.get('LFP'). ...
electricalseries.get('ElectricalSeries'). ...
data.load;

Accessing Data Regions

If all you need is a data region, you can index a DataStub object like you would any normal array in MATLAB, as shown below. When indexing the dataset this way, only the selected region is read from disk into RAM. This allows you to handle very large datasets that would not fit entirely into RAM.
% read section of LFP
nwb2.processing.get('ecephys'). ...
nwbdatainterface.get('LFP'). ...
electricalseries.get('ElectricalSeries'). ...
data(1:5, 1:10)
ans = 5×10
0.9651 -0.8883 -0.0094 0.8173 -1.0690 0.1127 -1.4322 -1.0934 -1.5671 1.0822 - -0.6077 0.1766 0.1769 0.3961 -0.4618 -0.6057 0.4036 -0.8789 -1.2575 0.5712 - -0.1929 0.5733 -1.4192 -0.2441 1.7385 -0.8977 -0.4516 -0.9052 -0.1145 0.3583 - 0.2470 -0.4401 1.6814 -0.3924 -0.1789 0.1862 -0.4147 -0.1626 -0.4556 -0.1766 - 0.2099 -0.4356 -0.8001 -0.3095 -1.3299 0.1646 0.5666 1.0098 -0.4388 0.7080 -
 
% You can use the getRow method of the table to load spike times of a specific unit.
% To get the values, unpack from the returned table.
nwb.units.getRow(1).spike_times{1}
ans = 24×1
0.3390 - 0.8821 - 0.0155 - 0.9190 - 0.3082 - 0.1643 - 0.0970 - 0.8547 - 0.1262 - 0.3271 -

Learn more!

See the API documentation to learn what data types are available.

MATLAB tutorials

Python tutorials

See our tutorials for more details about your data type:
Check out other tutorials that teach advanced NWB topics:
+ 0.3211 0.6437 0.8537 + 0.1520 0.5627 0.1590 + 0.9570 0.1282 0.0198 + 0.5171 0.9608 0.5398 + 0.5639 0.0015 0.5351 + 0.7871 0.4368 0.6525 + 0.0547 0.4123 0.4774 + 0.2071 0.3338 0.3417 + 0.9039 0.8778 0.9688 + 0.5819 0.2111 0.0526 + 0.7195 0.6208 0.2210 + 0.8373 0.6037 0.2933 + 0.5257 0.4083 0.5324 + 0.3001 0.5219 0.6432 + 0.6423 0.4282 0.2968 + 0.0757 0.3441 0.9642 + 0.8420 0.1641 0.5281 + 0.2294 0.1050 0.7394 + 0.4970 0.7150 0.6435 + 0.2402 0.3646 0.3062 + 0.8428 0.1960 0.4764 + 0.4495 0.6721 0.6090 + 0.3322 0.9081 0.6180 + 0.3987 0.8989 0.3979 + 0.4572 0.4035 0.3269 + 0.7665 0.9586 0.1624 + 0.4178 0.9179 0.0901 + 0.3773 0.9761 0.4298 + 0.8494 0.8965 0.7878 + 0.8920 0.3539 0.2586 + 0.0978 0.6594 0.7246 + 0.3655 0.8161 0.2763 + 0.5166 0.0215 0.4210 + 0.8319 0.7026 0.3662 + 0.1834 0.9958 0.9970 + 0.9425 0.3698 0.1860 + 0.5619 0.5043 0.2714 + 0.1227 0.7896 0.3180 + 0.3038 0.2416 0.8651 + 0.0602 0.9943 0.4567 +
 
% Create electrode table region referencing electrodes 0, 1, and 2
shank0_table_region = types.hdmf_common.DynamicTableRegion( ...
'table', types.untyped.ObjectView(electrodesDynamicTable), ...
'description', 'shank0', ...
'data', (0:2)');
 
% Define spike event series for unsorted spike times
spike_events = types.core.SpikeEventSeries( ...
'data', spike_snippets, ...
'timestamps', (0:19)', ... % Timestamps for each event
'description', 'events detected with 100uV threshold', ...
'electrodes', shank0_table_region ...
);
 
% Add spike event series to NWB file acquisition
nwb.acquisition.set('SpikeEvents_Shank0', spike_events);

Detected Events

If you need to store the complete, continuous raw voltage traces, along with unsorted spike times, you should store the traces in ElectricalSeries objects in the acquisition group, and use the EventDetection class to identify the spike events in your raw traces.
% Create the EventDetection object
event_detection = types.core.EventDetection( ...
'detection_method', 'thresholding, 1.5 * std', ...
'source_electricalseries', types.untyped.SoftLink(raw_electrical_series), ...
'source_idx', [1000; 2000; 3000], ...
'times', [.033, .066, .099] ...
);
 
% Add the EventDetection object to the ecephys module
ecephys_module.nwbdatainterface.set('ThresholdEvents', event_detection);

Storing Spike Features (e.g Principal Components)

NWB also provides a way to store features of spikes, such as principal components, using the FeatureExtraction class.
% Generate random feature data (time x channel x feature)
features = rand(3, 12, 4); % 3 time points, 12 channels, 4 features
features = permute(features, [3,2,1]); % reverse dimension order for matnwb
 
% Create the FeatureExtraction object
feature_extraction = types.core.FeatureExtraction( ...
'description', {'PC1', 'PC2', 'PC3', 'PC4'}, ... % Feature descriptions
'electrodes', electrode_table_region, ... % DynamicTableRegion referencing the electrodes table
'times', [.033; .066; .099], ... % Column vector for times
'features', features ...
);
 
% Add the FeatureExtraction object to the ecephys module (if required)
ecephys_module.nwbdatainterface.set('PCA_features', feature_extraction);

Choosing NWB-Types for Electrophysiology Data (A Summary)

As mentioned above, ElectricalSeries objects are meant for storing electrical timeseries data like raw voltage signals or processed signals like LFP or other filtered signals. In addition to the ElectricalSeries class, NWB provides some more classes for storing event-based electropysiological data. We will briefly discuss them here, and refer the reader to the API documentation and the section on Extracellular Physiology in the "NWB Format Specification" for more details on using these objects.
For storing unsorted spiking data, there are two options. Which one you choose depends on what data you have available. If you need to store complete and/or continuous raw voltage traces, you should store the traces with ElectricalSeries objects as acquisition data, and use the EventDetection class for identifying the spike events in your raw traces. If you do not want to store the entire raw voltage traces, only the waveform ‘snippets’ surrounding spike events, you should use SpikeEventSeries objects.
The results of spike sorting (or clustering) should be stored in the top-level Units table. The Units table can hold just the spike times of sorted units or, optionally, include additional waveform information. You can use the optional predefined columns waveform_mean, waveform_sd, and waveforms in the Units table to store individual and mean waveform data.

Writing the NWB File

nwbExport(nwb, 'ecephys_tutorial.nwb')

Reading NWB Data

Data arrays are read passively from the file. Calling TimeSeries.data does not read the data values, but presents an HDF5 object that can be indexed to read data. This allows you to conveniently work with datasets that are too large to fit in RAM all at once. load with no input arguments reads the entire dataset:
nwb2 = nwbRead('ecephys_tutorial.nwb', 'ignorecache');
nwb2.processing.get('ecephys'). ...
nwbdatainterface.get('LFP'). ...
electricalseries.get('ElectricalSeries'). ...
data.load;

Accessing Data Regions

If all you need is a data region, you can index a DataStub object like you would any normal array in MATLAB, as shown below. When indexing the dataset this way, only the selected region is read from disk into RAM. This allows you to handle very large datasets that would not fit entirely into RAM.
% read section of LFP
nwb2.processing.get('ecephys'). ...
nwbdatainterface.get('LFP'). ...
electricalseries.get('ElectricalSeries'). ...
data(1:5, 1:10)
ans = 5×10
-3.5690 0.9190 1.1629 0.1770 -1.1149 -0.0227 1.7513 0.0439 0.3346 -0.6137 + -0.8413 1.7329 0.4917 0.5800 -2.9249 0.5906 0.0099 0.5686 1.5835 -0.2693 + -0.0354 0.5030 -0.1769 0.9896 -0.5627 -2.1664 0.5403 -0.6677 0.4199 -0.2109 + 0.7809 -0.3773 -0.7599 -0.6833 -1.2777 -1.6061 0.4971 0.1317 0.0585 -0.8233 + 0.2562 0.5045 0.0044 0.2529 0.9348 2.2901 -0.0942 0.2287 -0.5769 -0.1247 +
 
% You can use the getRow method of the table to load spike times of a specific unit.
% To get the values, unpack from the returned table.
nwb.units.getRow(1).spike_times{1}
ans = 18×1
0.0591 + 0.2652 + 0.3253 + 0.6815 + 0.7179 + 0.4488 + 0.0672 + 0.6978 + 0.4125 + 0.7288 +

Learn more!

See the API documentation to learn what data types are available.

MATLAB tutorials

Python tutorials

See our tutorials for more details about your data type:
Check out other tutorials that teach advanced NWB topics: