Hello, my name is Arnaud Delorme
and I'm the main software architect of the EEGLAB software for processing EEG data.
This is part 7 of EEG pre-processing
where we're going to remove bad data segments.
So we just identified and rejected bad channels
so now it's time to reject large artifacts.
There's two menus we've seen before to access the raw data and reject raw data.
One is "Plot -> Channel data (scroll)" and one is "Tools -> Reject continuous data by eye."
They're actually equivalent, so you can call either.
When you select this one, it also gives you instructions what to do.
Mark stretches as continuous data
and you can also click on mark to remove your rejections.
Let's look at some data.
So here we have a continuous portion of data
and we want to remove that portion right there.
So we are going to place our mouse right here, and (click and) drag our mouse
and this is going to select that region for rejection.
We can scroll the data.
Once we're done selecting that region we can press the reject button.
There [are] different types of artifacts you might want to remove.
Usually you want to reject large muscle artifacts or otherwise strange events
(like these ones)
which contaminate most of the channels.
So we would select these events.
But stereotyped artifacts, like blinks for instance, can be taken care of by ICA
(independent component analysis)
so we don't necessarily want to remove these.
They can be taken care of at a later stage of pre-processing so we can keep them
and then ICA will take care of these so we don't have to remove them at that stage.
But these other events we want to remove right now, because ICA will likely not be able to deal with these,
[and they] contaminate all the data channels.
There is another method to do fast artifact rejection.
We have two buttons here, stack and norm.
Stack is going to stack all the electrodes, and norm is going to normalize the activity of each single channel.
So if you press these two buttons, you end up with this view
where whole channels are in the center.
You can also change the time range display
and you can use a window length of 30 seconds (instead of 5 seconds).
And then you get this kind of view.
You can see, these are likely blinks, so you might want to remove these
but these are pretty large artifacts, so you can see them at once and just decide to remove them.
It's not optimal, because you don't see all the channels
but it's a quick way to go through your data.
There [are] also automated methods to remove artifacts like automatic continuous rejection.
[TO SEE THIS MENU, GO TO EEGLAB PREFERENCE MENU. RECOMMENDED METHOD IS NOW TO USE CLEAN_RAWDATA PLUGIN INSTALLED BY DEFAULT]
This method is going to scan the data in windows of four seconds
and then detect in these windows whether there is high frequency.
So for instance, here you put a frequency range, you put a threshold
and if it goes above the threshold in that window, it selects that window and rejects it.
And [the epoch length or window is set to] half a second.
You can also add some additional regions at the beginning and end of each window, so you're sure you don't have artifacts.
So that's one method.
It works for [both] low and high frequency, it's a very simple method.
There [are] also more advanced methods
like "Clean continuous data using ASR."
That's the same extension I mentioned before, the one that can reject bad channels.
This one can also reject bad portions of data.
This is a more complex method that uses principal component analysis.
And there [are] other plugins available in the extension manager, of course.
So this is the live demo.
I will start EEGLAB.
And I'm going to load a different dataset this time
because the one that's in the sample_data folder is too clean.
This dataset is actually available in the description of this video.
There is a link to it. It's called simple oddball.
It's also an EEGLAB dataset that was saved just after importing.
So here I'm going to select it.
And this is how it looks.
So as I mentioned before, the fact [that] we can't see all the traces is due to DC shift.
So we can remove that using "Display -> Remove DC offset"
So now this is how it looks.
In this artifact, we have strong discontinuity here.
These are probably eye movements.
We also have strong muscle activation that we can see here
and here a series of muscle activation.
As [I] mentioned before, it's easier if we look at a longer window (30 seconds) of data.
and we can select regions
(like this)
and we can also go backward like this.
And if we want to join regions on different pages, we would go like this.
So this would be a single region.
And this allows you to merge regions which are on different pages.
Then if you want to reject that data, you would press reject.
[I'm] not going to reject the data.
So here in this example, I would probably want to reject this portion
and then this portion of data as well where we have strong muscle artifact.
I'm going to illustrate how to do that using the automated methods.
First, there is [the] simple method, (Automatic continuous rejection)
[in] which you specify the channel range, the frequency and the threshold.
So here we want to remove portions of data with high frequency, 4 second windows and 0.5 second increments.
So we just press OK.
And this automatically selects a very long window.
So here, this is the same data we were looking at before
and I'm just gonna select a shorter window
(10 seconds)
and remove the DC offset.
And we can see, it selected these portions with the muscle artifact.
It's also selected this portion right there, but it failed to select this portion here
because there was not much high-frequency activity.
Then we have this other method which I mentioned, ASR
and we're going to illustrate it as well
(here).
So "Tools -> Clean continues data using ASR."
I'm just going to leave the default
I'm not gonna plot the results, I'm gonna just gonna show it to you.
So there's different steps.
First, it scans for bad channels or channels with high-frequency noise.
So that's what it's doing here.
It's a method that takes a little bit longer because it's more compute-intensive.
So after it scans for bad electrodes (it found 2), it's looking for bad data regions.
Here it says it's cleaning in 31 blocks.
So we'll wait until this is done.
And now it's done creating dataset number two which we're going to visualize.
So this is now how the data looks, so you won't be able to see the artifact anymore.
We can do the same type of long window (10 seconds)
which is the one we were looking at before.
We can see lots of the channels vary together
so in that case we would benefit from computing average reference.
This is just the raw data.
Usually we would have all the pre-processing steps before
which have been detailed in all the lectures
so it's just a quick view of what data can do.
So some of the regions with the muscle have been removed.
Here you see that ASR introduced the boundary, which means that it cuts some data out that was bad.
Overall it looks pretty good.
So this is the end of the pre-processing pipeline.
There is one step we haven't talked about, and that's the step of running independent component analysis (ICA) and rejecting components.
But this will be the object of another series of lectures.
So we're done with this section of preprocessing.
It's been continued in the next series, which is about running ICA.
There we'll talk about the theory and how to recognize your components, how to remove your components.
I also want to spend a few seconds to thank all the people who have made these videos, and the EEGLAB project in general, possible.
First, Scott Makeig, co-creator of EEGLAB.
Then Julie Onton and Marissa Westerfield, who helped design the series of presentation over the years as we presented them at EEGLAB workshops.
NIH of course, who has supported the EEGLAB project over the years.
And finally, all the researchers who have contributed to this project.
I apologize in advance if I forgot someone.
Thank you again for watching.