[Eeglablist] using BCILAB to deploy different approaches on BCI competition dataset

Christian Kothe christiankothe at googlemail.com
Thu Sep 29 17:55:30 PDT 2011


Yes, these are just a naming convention that you use to tag events in the
data where you know something about the state that the subject is in (e.g.,
based on the stimulus that you presented or perhaps the response buttons
that the subject pressed).
The standard approach to get meaningful markers into your recording is to
design an experiment using ePrime, Presentation or, e.g., the MATLAB Psych
toolbox, in which the subject is put in a particular cognitive state at
various times (e.g. instructed to imagine a left-hand movement in some
trials and to imagine a right-hand movement during other trials). When the
subject runs through the experiment, it is the responsibility of the
experiment program to emit event markers that are then recorded together
with the EEG (the mechanism usually depends on the amplifier and/or
recording program -- e.g., some have a Parallel Port interface, others have
a serial port, others have analog trigger inputs). As long as an appropriate
mechanism for the respective amplifier was used, the events (including their
type and their latencies) will be stored as part of the recording and EEGLAB
will attempt to read them and store them in EEG.event automatically.

In case of the BCI competition data, the data is stored in a custom
MATLAB-compatible format, and the events are, I think, stored in an array
called "mrk" (including their types and their latencies). These are the ones
that you would use to build your EEG data set. Because the event types are
numbers in the competition data while EEGLAB prefers to work with strings,
you will need to translate the numbers to strings (e.g., using num2str)
before you run set_new as below.

Best,
Christian

2011/9/29 Mehdi Karamnejad <mehdi.karamnejad at srttu.edu>

> Thanks for the reply, using the points in this<http://sccn.ucsd.edu/wiki/A02:_Importing_Event_Epoch_Info>page, there is a little description about event types:
>
> ...the channel is an event channel with values 1 (stimulus onset), 2
>> (subject response), and 0 (other)....
>>
> I'm not really sure what these are. is 1 , 2 or 0 just a naming convention?
> so they could be anything as long as they are consistently named through the
> whole process using EEGLAB and BCILAB? from what I've figured out in this<http://sccn.ucsd.edu/wiki/A02:_Importing_Event_Epoch_Info>page , for each "time X channel" entry there should be an event type.now I
> have no idea what kind of event it would be for each of entries in my
> dataset? 1,2 or 0?
> Another question is about latencies, how can I obtain latencies for my
> events?
> -----------
> Regards, Mehdi Karamnejad
> Rajaee Artificial Intelligence & Robotics Laboratory  , Shahid Rajee
> University
>
> On Fri, Jun 17, 2011 at 12:50 AM, Christian Kothe <
> christiankothe at googlemail.com> wrote:
>
>> Hello Mehdi,
>>
>> yes, importing the format of the BCI competition into an EEGLAB-compatible
>> format with appropriate markers requires quite some special treatment. On
>> our wiki we have a piece of code which demonstrates loading & running a
>> simple CSP approach over it using just bare-bones MATLAB:
>> http://sccn.ucsd.edu/wiki/Minimalist_BCI This should give you an idea of
>> how the data is laid out (this is for the .mat version of one of the data
>> sets - I hope it's the data set that you are interested in). You may also
>> check whether this code runs for you right out of the box.
>>
>> To generate from this an EEGLAB-compatible data set, you might want to
>> take a look at the wiki page on the data structure layout:
>> http://sccn.ucsd.edu/wiki/A05:_Data_Structures. A bit more conveniently
>> is BCILAB's function set_new, which is used like in the following usage
>> example:
>>
>> If you have extracted the following variables from the BCI competition
>> data set:
>> mydata (numeric array of #channels x #samples)
>> mysrate (sampling rate in Hz)
>> mychannels (cell array of channel names, e.g. {'C3', 'C4', 'Cz', ...})
>> myeventtypes (cell array of event type strings -- note: these should be
>> strings, e.g. {'1', '2', '1', '2' ...}, not numbers)
>> myeventlatencies (cell array of event latencies, measured in samples,
>> e.g. {10200, 20300, 55100, ...})
>>
>> Then you can create a new set using the command.
>> traindata = exp_eval(set_new('data',mydata, 'srate',mysrate,
>> 'chanlocs',struct('labels',mychannels),
>> 'event',struct('type',myeventtypes,'latency',myeventlatencies)));
>>
>> If you save the data set now as a .set file using
>>
>> pop_saveset(traindata)
>>
>> ... then you can then use it with BCILAB following the GUI tutorials. For
>> this to work, you need to remember that you named your event types a certain
>> way when you created the EEGLAB set, and BCILAB needs to know what events it
>> should use. The tutorial data sets use different event types than those that
>> you have, so assuming that you used the strings '1' and '2', you need to
>> pass {'1','2'} instead of the {'S  1', 'S  2'} in the GUI dialog box where
>> the marker names are specified.
>>
>>
>> Likewise, when you want to go through the scripting tutorials with it
>> (say: tutorial_erd1.m or tutorial_erd2.m), you first need to replace the
>> respective io_loadset line which loads the file (you can also directly use
>> the traindata that you have in your workspace),
>> and replace the names of the event types that are declared to BCILAB. In
>> tutorial_erd1.m, for example, the line
>>
>> myapproach = {'CSP' 'SignalProcessing',{'EpochExtraction',{'TimeWindow',[0
>> 3.5],'EventTypes',{'StimulusCode_2','StimulusCode_3'}}}};
>>
>> needs to be changed to
>>
>> myapproach = {'CSP' 'SignalProcessing',{'EpochExtraction',{'TimeWindow',[0
>> 3.5],'EventTypes',{'1','2'}}}};
>>
>> ... and you should be ready to go (again assuming that you actually named
>> your markers '1' and '2'). If you want to use the more advanced approaches,
>> you need to adapt the event types there, too.
>>
>> Best,
>> Christian
>>
>> PS: I'm actually planning to write a tutorial for BCI competition data
>> sets at some point, but didn't yet get to it.
>>
>> 2011/6/16 Mehdi Karamnejad <mehdi.karamnejad at srttu.edu>
>>
>>> Hello,
>>>
>>> I'm trying to deploy some approaches of BCILAB on BCI competition IV
>>> dataset  1 (here <http://www.bbci.de/competition/iv/desc_1.html> is the
>>> link to description of this dataset)
>>> I take the following steps:
>>>
>>>    1. cnt matrix  contains raw continues EEG data in volts and I first
>>>    convert the values to micro volts . cnt matrix also arranges data in
>>>    the form of  time x channels so I take the transpose of the matrix to
>>>    produce a matrix in the form of channels x time
>>>    2. for testing reasons and making processes much less time-consuming
>>>    , I just extracted a small portion of the signal to import into EEGLAB
>>>    3. then I imported the extracted signal into EEGLAB  along with it's
>>>    channel location
>>>    4. then I had to create the  Events because BCILAB needs it, I did
>>>    this using  File>> Import event info >> >From data channel  and picked 59 as
>>>    my event channel and left other options as default since I'm not sure what
>>>    they do yet.
>>>    ** 59 is the number of entire channels . I'm not sure what my events
>>>    are although I've read the EEGLAB wiki, *could someone tell me what
>>>    are experimental events in EEG signals? and how can I figure out which
>>>    channel(s) are the event channels?
>>>    *
>>>    5. then I saved all of my work as an EEGLAB dataset and loaded it
>>>    into BCILAB and created a new CSP approach. when modifying the approach I
>>>    don't know what to fill in for "Epoch time window relative to the events"
>>>    and "Event marker types for which epochs shall be extracted " . for the
>>>    second one I have read a tutorial which  's 1''s 2' is filled in but
>>>    I don't really understand what this means and when I try to train my model I
>>>    get an error with these settings.
>>>    *could you please explain to me what ** "Event marker types for which
>>>    epochs shall be extracted " is?*
>>>
>>> and could you tell me what do I generally need  to do to make my dataset
>>> appropriate for loading into BCILAB? (for now appropriate enough to use the
>>> CSP approach )
>>> -----------
>>> Regards, Mehdi Karamnejad
>>> Rajaee Artificial Intelligence & Robotics Laboratory  , Shahid Rajee
>>> University
>>>
>>>
>>> _______________________________________________
>>> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
>>> To unsubscribe, send an empty email to
>>> eeglablist-unsubscribe at sccn.ucsd.edu
>>> For digest mode, send an email with the subject "set digest mime" to
>>> eeglablist-request at sccn.ucsd.edu
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20110929/815207db/attachment.html>


More information about the eeglablist mailing list