POP_IMPORTEVENT Import events in a dataset. If the EEG dataset is the only inputs, a window pops up to ask for the relevant parameter values.

Usage: >> [EEG,eventnumbers] = pop_importevent( EEG, 'key1', 'value1', ...);

Input:
EEG   
input dataset Optional input
'append'   
['yes'|'no'] 'yes' = Append to the current events of the EEG dataset {default}: 'no' = Erase the previous events.
'event'   
[ 'filename'|array ] filename of a text file or Matlab array of the global workspace containing an array of events in the folowing format: The first column is the type of the event, the second the latency and the other ones are user defined fields. This function can handle text entries in ascii files.
'fields'   
cell array of name for each user-defined column, optionally followed by a description. Ex: { 'type', 'latency' }
'skipline'   
number of rows to skip for text files
'indices'   
vector indicating the indices of the events to modify
'timeunit'   
[ latency unit in second ]. Default unit is 1 second.
'delim'   
delimiting characters in file. Default is tab and space.
'align'   
[num] align the first event latency to existing event latency (number num) and check latency consistency. Negative values can also be used and then event number -num is aligned with the first pre-existing event. Default is 0. (NaN-> no alignment)

Outputs:
EEG   
dataset with updated event field
eventnumbers   
indexes of the appended events

Example: [EEG, eventnumbers] = pop_importevent(EEG, 'event', 'event_values.txt', 'fields', {'type', 'latency','condition' }, 'append', 'no', 'align', 0, 'timeunit', 1E-3 );
This loads the ascii file 'event_values.txt' containing 3 columns
(event type, latency and condition). Latencies in the file are
in ms. The first event latency is re-aligned with the first
pre-existing latencies in the dataset ('align', 0) and old
events are erased ('append' no).

Author: Arnaud Delorme & Scott Makeig, CNL / Salk Institute, 9 Feb 2002

See also: pop_editeventfield, eeg_eventformat, pop_selectevent

See the matlab file pop_importevent.m (may require other functions)

Back to functions