Representation of spiketrain data after readout

Spiketrain data can be described as a series of timepoints where spikes occurred, with accompanying waveforms. After reading out the data using ft_preprocessing, ft_read_data, or a custom import functions or scripts, the spike data has the format

  • spike.timestamp = cell-array of raw timestamps (e.g., in microseconds). Every entry of the cell array corresponds to one unit (i.e., single or multi-unit).
  • spike.label = cell-array of N character labels for N units.
  • spike.waveform = cell-array of waveforms for N units. The first dimension of waveform data should be the spikes, the second dimension (columns) the samples of the waveform. For every ith unit, the length of spike.timestamp{i} should match the size of the first dimension of spike.waveform{i}. It is possible to leave spike.waveform as an empty cell array though.

Processing spiketrains relative to a trigger event

After the raw spiketrain data has been read in, we restructure it relative to event triggers, i.e., we add a trial dimension to it. This serves two goals. First, by making trials, we can proceed with further analyses, such as peristimulus histograms, raster plots etc. Second, by making trials, the data can be linked to the LFP data which we assume is represented in the Fieldtrip data format, with fields data.trial and data.time.

For making trials, one uses the function ft_spike_maketrials. The idea of this function is to convert the spike format to a structure having the following additional fields:

  • spike.time = cell-array for N units. Each entry of the cell-array contains the times of the spikes in seconds relative to an event trigger.
  • spike.trial = cell-array for N units. Each entry of the cell-array contains the trials numbers in which each spike occurred. Thus, for the ith unit, the length of spike.time{i} matches the length of spike.trial{i}.
  • spike.trialtime = nTrials-by-2 matrix. The first column indicates the onset of the trial in seconds, the second column indicates the end of the trial in seconds.

Together, these three fields fully define the structure of the spiketrain. The field spike.time tells us where the spikes occurred in time, the field spike.trial tells us in which trial they occurred. This information is not yet sufficient to fully identify the structure of the spike-train, because the number of trials is not specified, and the beginning and end times of the trials are not specified. This is solved by the additional field spike.trialtime.

The critical input to ft_spike_maketrials is the input cfg.trl. This field has a similar role as cfg.trl in ft_preprocessing. The first two column specify the beginning and the end of the trials in time-stamps. Thus, the trigger event (e.g., the onset of a visual stimulus) must be specified on the same time-axis as the spikes in spike.timestamp. The third column of cfg.trl serves a similar role as the third column of cfg.trl in ft_preprocessing. It indicates the offset of the trigger relative to t = 0. For example, an offset of -1000 indicates that the trigger occurred 1000 timestamps after t = 0. Another required field is cfg.timestampspersecond. This information is necessary to convert the raw timestamp (with an unknown relationship to seconds) to seconds. For the neuralynx system, one typically has cfg.timestampspersecond = 1000000, although timestamps are sometimes represented in 100's of microseconds, in which case cfg.timestampspersecond = 10000.

This point-representation of the spikes in this format is very efficient, because we only store a value for those points at which spikes occurred, and we do not store a value for times at which no spikes occurred (as opposed to a binary representation of the spiketrain).

Conversion to a binary format

For some analyses, e.g. a spike-density analysis (ft_spikedensity), it is desirable to convert the point-representation of the spiketrains to a binary representation (i.e., as arrays of zeros and ones). This is achieved using the function ft_spike_spike2data, which creates a standard data format with the fields data.trial and data.time. It is also possible to convert the binary representation back to the point-representation, using the function ft_spike_data2spike.

tutorial/preprocessing_of_spiketrain_data.txt · Last modified: 2011/11/28 09:22 by robert

You are here: starttutorialpreprocessing_of_spiketrain_data
This DokuWiki features an Anymorphic Webdesign theme, customised by Eelke Spaak and Stephen Whitmarsh.
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0