Note that this reference documentation is identical to the help that is displayed in Matlab when you type “help ft_spike_maketrials”.
FT_SPIKE_MAKETRIALS converts raw timestamps in a SPIKE structure to spike times that are relative to an event trigger in an SPIKE structure. This is a necessary preprocessing step to use functions such as FT_SPIKE_PSTH. The other route is by FT_SPIKE_DATA2SPIKE. The main function of FT_SPIKE_MAKETRIALS is to create the field spike.time and spike.trial, which contain the trial numbers in which the spikes were recorded, and the onset and offset of the trial relative to trigger time t = 0. Use as [spike] = ft_spike_maketrials(cfg,spike) Inputs: The raw spike datatype, obtained from any of the fieldtrip READ functions. Structure spike includes the following spike-format specific fields: - spike.timestamp (1-by-nUnits cell array), raw spike times as from recording, these are not relative to trigger but relative to recording system. - spike.label, cell array containing the labels of spike channels. Configurations: cfg.trl = is an nTrials-by-3 matrix. Every row contains start (col 1), end (col 2) and offset of the event trigger in the trial. For example, an offset of -1000 means that the trigger (t = 0 sec) occurred 1000 timestamps after the trial start. cfg.timestampspersecond = number of timestaps per second. cfg.timestampspersecond should always be explicitly specified. Outputs: spike.time = 1-by-nUnits cell array, containing the spike times in seconds relative to the event trigger. spike.trial = 1-by-nUnits cella array, containing the trial number for every spike telling in which trial it was recorded. spike.trialtime = nTrials-by-2 matrix specifying the start and end of every trial in seconds. spike.trl = contains the original matrix of cfg.trl Further, reproduced in the output are the original fields spike.timestamp and spike.label.
Share this page: