[Eeglablist] ASR Implications and Segmenting Based on First Occurrence of Event Code

Makoto Miyakoshi mmiyakoshi at ucsd.edu
Fri Sep 8 10:52:50 PDT 2023


Hi Cailee,

> When I go to band-pass filter the entire continuous EEG recording it
takes forever (>90 minutes for one participant).

Most likely, you are using inappropriately long filter order i.e.
unnecessarily sharp slope.

> As a result, I've tried selecting just the event codes of interest (there
are only 2 events with 30 instances each). This helps filtering go much
quicker.

Don't avoid the problem but solve it. Trust your sense--if you feel
something is strange, you are seeing a problem there (and the problem is
unexpectedly common).

> However, when I go to run clean_rawdata for channel rejection and ASR
rejection it rejects about 23 channels and almost all of the data (keeps
~30 seconds from 192 seconds).

Disable the ASR channel rejection by entering -1. That stage of the process
has some issue.

> I would really like to better understand this process as I want to
automatically reject artifacts but have some concerns about it removing
that much data.

The journal Sleep will publish my commentary on ASR soon. If you want to
read the final draft now, send me a separate email.

> When I visually inspect the data after being filtered it's clear that
there are noisy channels and sections of data (see screenshot 1), but I
don't think enough to only keep 30 seconds worth of data. When I visually
inspect the ASR rejected data (see screenshot 2) it is clear that a lot of
the data was rejected and you can also see that more data was rejected from
that first segment which has changed the time length following each
component. Should I try using a more lenient value for ASR? Is it better to
reject epochs or trials instead in this case? Is it possible that
segmenting to only keep the two events is causing the removal of a majority
of the data?

First of all, check what options you are using. The current EEGLAB default
is NOT to use ASR but just reject all the windows for corrections. In other
words, the default setting is REJECT not CORRECT. This is not the
original developer's intention.

> I have tried to extract and reject epochs using artifact detection in
epoched data from ERPLAB. I couldn't use the EEGLAB options for extracting
and automatically rejecting epochs because when I went to extract epochs it
gives an error saying dataset is empty (assuming this is because of the way
I selected events so it no longer thinks the file is continuous?). However,
when I do this it highlights almost all of the epochs for rejection (see
screenshot 3). Could it be possible that it looks so noisy because of the
way I originally segmented by selecting events?

Maybe 'loadmode', 'info' is used when pop_loadset() is called? I have no
experience with ERPLAB so I can't comment on that part.

> My main question (especially if the segmenting by event codes is adding
to the noise) is: is there a way that I can select just the last portion of
the entire EEG recording that keeps it continuous? For example, I would
like to write a bit of code that keeps the continuous data after the first
occurrence of my event codes of interest and gets rid of everything
beforehand but I'm not sure of a function that could do that as I'm
relatively new to MATLAB coding.

You can directly edit event structure. For example, if you want to delete
events [3 9 11 18 25], then EEG.event([3 9 11 18 25]) = []; will delete
these events (before epoching, of course)

Makoto



On Fri, Sep 8, 2023 at 12:36 PM Nelson, Cailee via eeglablist <
eeglablist at sccn.ucsd.edu> wrote:

> Hi all,
>
> I am having a bit of an issue preprocessing my data and was hoping someone
> could give me insight.
>
> To give some background, we collected data from several different
> experimental paradigms within one EEG recording session so our file size is
> huge. For a paper I am working on, I really am only interested in the data
> from the last experimental paradigm we ran. When I go to band-pass filter
> the entire continuous EEG recording it takes forever (>90 minutes for one
> participant). As a result, I've tried selecting just the event codes of
> interest (there are only 2 events with 30 instances each). This helps
> filtering go much quicker. However, when I go to run clean_rawdata for
> channel rejection and ASR rejection it rejects about 23 channels and almost
> all of the data (keeps ~30 seconds from 192 seconds). I would really like
> to better understand this process as I want to automatically reject
> artifacts but have some concerns about it removing that much data.
>
> When I visually inspect the data after being filtered it's clear that
> there are noisy channels and sections of data (see screenshot 1), but I
> don't think enough to only keep 30 seconds worth of data. When I visually
> inspect the ASR rejected data (see screenshot 2) it is clear that a lot of
> the data was rejected and you can also see that more data was rejected from
> that first segment which has changed the time length following each
> component. Should I try using a more lenient value for ASR? Is it better to
> reject epochs or trials instead in this case? Is it possible that
> segmenting to only keep the two events is causing the removal of a majority
> of the data?
>
> I have tried to extract and reject epochs using artifact detection in
> epoched data from ERPLAB. I couldn't use the EEGLAB options for extracting
> and automatically rejecting epochs because when I went to extract epochs it
> gives an error saying dataset is empty (assuming this is because of the way
> I selected events so it no longer thinks the file is continuous?). However,
> when I do this it highlights almost all of the epochs for rejection (see
> screenshot 3). Could it be possible that it looks so noisy because of the
> way I originally segmented by selecting events?
>
> My main question (especially if the segmenting by event codes is adding to
> the noise) is: is there a way that I can select just the last portion of
> the entire EEG recording that keeps it continuous? For example, I would
> like to write a bit of code that keeps the continuous data after the first
> occurrence of my event codes of interest and gets rid of everything
> beforehand but I'm not sure of a function that could do that as I'm
> relatively new to MATLAB coding.
>
> Any help is greatly appreciated! Thank you!
>
> Cailee
>
> Screenshots:
> https://urldefense.com/v3/__https://alabama.box.com/s/1ans8hgmlc26g72p3zgnhsxjos2vboqc__;!!Mih3wA!AwwneLEf-KRh50nIeQJZK5yZel1Xaik63ApJW2gtHskipo8-ivdCkG20u-0_D8chGicQJoVBy9Is54H79rqVUW2U_hpd$
>
> Cailee M. Nelson, Ph.D.
> Postdoctoral Fellow
> she/her/hers
>
> Department of Psychology
> Brain Research Across Development (B-RAD) Lab
> University of South Carolina
>
> caileen at mailbox.sc.edu<mailto:caileen at mailbox.sc.edu>
>
>
> [cid:image001.jpg at 01D9E19B.1747C420]
>
> _______________________________________________
> 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
>


More information about the eeglablist mailing list