Converting to Brainstorm Events

Authors: Konstantinos Nasiotis

In case you have data that have already been spike-sorted, you can use the spike-timestamps as separate events for each electrode and import the events from a single events file for your analysis. Brainstorm needs its events to be in a specific format, so they can be imported. Moreover, the functions that use spike-events, will use those events only if you label the events properly and construct the events in the appropriate format.

What you need to do so you can import your spikes, is to create a structure named events in Matlab, and add one entry per neuron recorded. The entry should be per neuron, since there are electrodes that might pick up spikes from several neurons.

The following convention for the spiking events is used throughout this toolbox:

“Spikes Channel ChannelLabel”, where ChannelLabel is the Label of the electrode assigned by the acquisition system.

If the acquisition system assigned the spikes’ waveforms into more than one cluster/neuron during this automatic clustering, the neuronal events would be (e.g. for an electrode that picked up spikes from 3 neurons):

“Spikes Channel ChannelLabel |1|”, “Spikes Channel ChannelLabel |2|”, “Spikes Channel ChannelLabel |3|”

Each entry should have the following fields:

  1. label: The label of the spike events. It should read: “Spikes Channel ” where ChannelLabel is the label of the electrode. In the case where multiple neurons are recorded from a single electrode, the label of the events should be: “Spikes Channel ChannelLabel |iNeuron|”, where ChannelLabel is the label of the electrode and iNeuron the number of the neuron on that electrode.

  2. times: a ROW vector (1xn where n is the number of spikes) with the timestamps of the spikes that the neuron fired, in seconds.
  3. samples: a ROW vector (1xn) with the indices of the samples of the electrode where the spikes occurred (just multiply the times vector with the sampling rate). Note: Be careful on which step of the processing the events are imported; if the events are to be linked to the raw file, the raw file sampling rate should be used; if the events are to be linked to the LFP file, 1KHz sampling rate should be used.
  4. epochs: a ROW vector (1xn) with the epoch that each spike occurred (just assign the number 1 to each one and it will work).
  5. color: A 1x3 vector with the color that the event will be displayed on the Brainstorm viewer. The vector takes values [0,1].
  6. reactTimes: set this to [].
  7. select: set this to 1.

An example events structure is shown here:

eventsConversion.png

The electrode with the label “raw 1” on this example events file, has 3 neurons that fired 2253, 159 and 83 spikes respectively during this recording. The electrode with label “raw 11” picked up 1181 spikes assigned to a single neuron/cluster etc.

The filename of the events that needs to be saved in the end, should start with the string events. Example: “events_filename.mat” and should contain the events structure as described above.

The page about events on Brainstorm’s Tutorial describes briefly how you can deal with events that are already imported:

e-phys/ConvertToBrainstormEvents (last edited 2018-06-11 22:22:07 by ?Konstantinos Nasiotis)