Hello, my name is Arnaud Delorme
and I'm the main software architect of the EEGLAB software
for processing brainwave data.
In this series of videos, I'm going to show you how to preprocess data in EEGLAB.
The first step is to import your data into EEGLAB.
So first, why preprocess data?
Well, EEG data out of the recording device is a continuous unprocessed signal
so it's like measuring a difference of potential on an oscilloscope.
And you can actually do that if you want.
You can measure brainwave data on the oscilloscope if you wanted to.
So to make sense of the data, we will need to:
extract meaningful measures from it
(such as brain oscillations, brain source activations)
compare brain data in different conditions
or assess reliable changes to external stimuli
(different related potentials, for example).
But before we do all that, we need to apply a series of transformations to the data.
This is the standard pipeline for processing EEG data
whether you use EEGLAB or any other software.
First you would collect the data, then import the data into EEGLAB
then import event markers and channel locations, which are often in separate files.
Then you might want to re-reference or decrease the sampling rate of your EEG data.
Then you might want to filter the data.
At this point it's good to actually look at your data, to see what kind of data you have
and what kind of artifacts are present in your data.
Then you will want to identify and reject bad channels.
Very often, when you collect EEG data, some of the channels have a bad connection.
Then reject large artifacts, which are very often present in EEG data.
Every time you move, for instance, there will be a dramatic artifact that needs to be removed.
The last step in this pipeline is to run an algorithm called independent component analysis
which allows you to extract a stereotyped artifact.
It's very powerful and widely used in the field.
Then you have to select components, to remove the components you want to exclude from the data.
The first step is to download and install MATLAB, and download and install EEGLAB.
So MATLAB you have to pay [for], that's a commercial software. EEGLAB is free.
You can run a lot of the EEGLAB under the free octave software
but you don't have any graphical interface.
You can plot most of the graphics, but you can't use the graphical interface of EEGLAB
So you download EEGLAB, unzip the file, start MATLAB, and add EEGLAB to your path
either from the command line by typing something like this line
(it depends where you unzipped the EEGLAB of course)
or you can set the path here.
If you set the path, there is an option to add all the sub paths.
Don't add all the sub paths, just add the main EEGLAB path
and EEGLAB will take care of adding additional paths if that becomes necessary.
So then you type EEGLAB.
You might have the compiled version of EEGLAB, which doesn't require MATLAB
so you don't have to do all these steps.
You will just get the graphic interface directly.
So you type EEGLAB, you get this graphic interface, then you're ready to import data.
So there [are] different options to import data.
First: "File -> Import data."
And you can select native EEGLAB functions and plugins (listed here).
You should see the format you're interested in.
It reports most of the main manufacturers
and then for all the other ones, there [are] dedicated plugins.
We also interface to our toolboxes.
Here [are] the FILE-IO interface and the BIOSIG interface
with our separate toolbox for EEG under MATLAB.
These allow you to import mostly the same formats
but also different formats sometimes.
If your format is not listed, what you can do is
go to "Manage EEGLAB extensions -> Data import extensions"
and see if your format is listed.
You would just check "Install," press "OK," [and] it would restart EEGLAB.
There would be a new menu in "Import data -> Using EEGLAB [functions and plugins]"
where your format will now be listed
and then you can use that additional menu.
These extensions are developed by third parties
so that's why we're not in the default EEGLAB interface.
If you go on the EEGLAB Wiki, there is a list of the file formats which are supported.
There [are] different columns either supported directly by EEGLAB, by BIOSIG, or by FILE-IO.
You can also go to the BIOSIG website
which tells you all the formats which are supported
or the FILE-IO website also contains some information.
So I'm going to show you [what] it looks like.
I've just started MATLAB. If you haven't added EEGLAB to your path
you can do it here: "Set Path -> Add folder."
I'm already in the EEGLAB folder, so I'm just going to press "Open."
Don't "Add with Subfolders," although if you do that's not the end of the world.
I would save, close, and now I'm ready to start EEGLAB.
This shows you the plugins you have installed at startup, by the way.
I have more plugins here because I've installed these plugins.
So here is the menu "Import data" which I mentioned.
I'm not going to use this menu right now.
Instead, I'm going to use this menu "Load [existing] dataset"
that's loading an EEGLAB dataset that has been saved.
So after you import your data, you can save the data as EEGLAB format.
And that data has been saved just after importing the raw data.
So here I'm going to the EEGLAB folder
and then there's a subfolder that's called sample_data
and this eeglab_data.set is an EEGLAB data set
which has been saved just after importing some raw data.
As soon as we import, we have some information here
like the file name, number of channels, number of samples, epoch.
When it's continuous data it's always 154 events, 128 sampling rate
beginning and end of the data in seconds, [and] the reference.
It doesn't have channel locations yet, doesn't have independent component analysis calculated yet
and the dataset is 4.3 MB.
As soon as you import the data, you might want to look at what's in the data
so that's the menu "Plot -> Channel data."
And here you can see your raw data, so here you have 32 channels.
If you don't see you data in that plot, don't panic.
We will see how we can filter the data to bring it back in range.
So that's it for importing your raw data into EEGLAB.
In the next video, we'll see how to import events and channel locations.