Hello, my name is Arnaud Delorme
and this is part 2 of EEG preprocessing using EEGLAB.
This part is about importing events and channel locations.
So [as] we saw, part 1 was about importing into EEGLAB.
Most of the time, event information is already with your EEG dataset.
It's been collected using an additional channel.
It depends on the amplifier, but most often you have some information about events already.
What happens is that sometimes this information is in an additional channel
and has not been extracted from that channel
(we will see that example in a second.)
Sometimes it can also be in a text file.
For instance, if you are using the MATLAB psychophysics toolbox
you might have saved some information in text file from an event channel
or from another software like Presentation, E-Prime, or Neuroscan event file.
What happens when it's from another software is that your EEG amplifier only has limited information.
It just has a number for the event.
[If] you want to associate more information, you would need to fuse these events.
Sometimes you don't have some of the events.
You might just have the stimuli which are saved with the EEG file, but reaction times are not saved on the EEG file
so you want to put back the reaction times in there along with the EEG data so you can process it.
And what EEGLAB will do is import these events
and calculate possible discrepancy in the sampling rate (in the order of 0.1 percent)
then align these events as best as possible.
Here, we'll see the simple example of importing from a data channel.
If you call this menu ["Import event info -> From data channel"]
It's going to ask you the number of event channels
(so for instance it would be 73 here).
Usually the last channel is the event channel.
If it's noisy, you can apply a logical formula to the data.
You can extract on the leading edge, the trailing edge, or both.
You can also extract the duration of the event, erase old events, or add new events.
So if you press OK and look at the data, you don't delete the event channel.
Here only one channel is represented, whereas usually
[you would also see] all the other EEG channels as well
but just for presentation purposes, only the event channel is represented.
And we can see here vertical lines of different colors (which are the events)
and the black trace is the event channel.
So here EEGLAB has extracted different events.
The color of the event depends on the amplitude of the channel
and it has extracted them on the leading edge of the signal.
There was a checkbox here (all events of the same type)
if you click that checkbox then it will only extract one color, one type of event, irrespective of the amplitude.
Once you're done importing events, you should see events here
it's going to tell you the number of events that have been imported.
Now what about channel locations?
Well, to import channel locations you go to the Edit menu "Edit -> Channel locations."
First, you have a pop-up window and it asks you
if you want to use the channel labels to figure out some channel locations for these channels.
Very often in the raw data file there [are] channel labels associated with these channels
so even though they might not have locations, they sometimes have channel labels
and we can use these labels to figure out some template locations.
If you press OK, [the Channel locations window] is going to pop up.
Now we have the channel labels, and we have the location of the channels.
We have the location in three different coordinate systems:
we have polar angle and polar radius, which are planar polar coordinates
we have Cartesian 3D coordinates, XYZ
[and] we have spherical coordinates.
The reason we have all these coordinate systems is
different types of channel location formats use different coordinates
so we wanted to support them all.
You also have this menu "Read locations"
so if you have an external location file that was provided by the manufacturer, you can import it here
or if you have scanned electrodes using Polhemus, you can import them here.
There is a new development which is an EEGLAB extension called get_chanlocs
that allows you to import channel locations from a special format.
If you have an iPad, you film around the head, and you can figure out the channel locations
so this plugin will allow you to import this type of information into EEGLAB.
Once you have channel location information
you can press one of these two buttons: "Plot 2D" or "Plot 3D"
to visualize your channels in 2D or 3D.
Here in two-dimension we see the head.
The nose here is represented by this
and then the ears are represented on the side.
Some of the channels are outside the head because [those are] your [EOG] channels.
If you import channels which you have scanned, you might also want to apply some transformation.
For instance you can optimize the head center.
When you scan channel coordinates, very often the head center is not optimal
so you might want to select a subset of channels and fit the sphere
and then the new center is the center of that sphere.
And you can exclude some of the channels when you do that.
You can also rotate axis.
For instance, if you import your channels and the nose is along the wrong direction, you can rotate the axis.
You can also rotate axis using nose along +X or +Y.
With this menu "Rotate axis" you can also rotate it in three dimension.
You can also select the channel types.
If you have only EEG channels, you can select and set them to all the EEG channels
or if you have autonomous channels, like heart [or] respiration, you can also assign them different types
and there's specific types for different types of channels.
This is useful, for instance, when you're filtering data
you can select different types or all the types of processing.
So then you press OK, and now if you look at the interface
in front of channel locations, it says yes, these channels have been imported.
you have information about that dataset that tells you how the data was acquired.
You can add some notes yourself for people that might process this dataset in the future
or for yourself when you would come back to this dataset.
So here I've just started MATLAB, and now I'm starting EEGLAB.
And I'm going to load that dataset that has been saved in EEGLAB format just after being imported.
So that's in sample_data -> eeglab_data.set
again in the sample_data subfolder of EEGLAB.
This data set doesn't need events to be imported because it already has events.
And we can see the events
and when we plot them we can see them here.
Square, square, and reaction time.
But we will import channel locations.
When we look at channel locations it says "No."
So "Edit -> Channel locations."
And then it tells us "Do you want to look up channel coordinates using a template file?"
And the answer is no, we don't want to do that
because our channel labels here in that case are 1, 2, 3, 4, 5
so there's no standard names that could be used to figure out their location.
If we press OK or if we press Cancel, it's the same thing.
So basically here, there's no channel locations, just create one channel with name E1.
And here we have a channel file associated with this dataset.
So to load it we're gonna press "Read locations."
We go to sample_data, and then we go to eeglab_chan32.loc
and that's the electrode location associated with this dataset. (eeglab_data.set)
We'll leave that (auto detect the type of channel location)
and now we can plot them in 2D and in 3D.
And we press OK.
Now if we look at the main interface "Channel locations" [we'll see] "Yes."
So this is the end of part 2.
In part 3 we will talk about re-referencing and then sampling EEG data.