[Eeglablist] using BCILAB to deploy different approaches on BCI competition dataset
Christian Kothe
christiankothe at googlemail.com
Fri Jun 17 00:50:58 PDT 2011
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/20110617/4b19b322/attachment.html>
More information about the eeglablist
mailing list