[Eeglablist] Artifact detection and ICA on data with multiple epoch types

Mikołaj Magnuski imponderabilion at gmail.com
Sun May 5 16:06:31 PDT 2013


It seems I didn't send my last message to eeglablist, it can be found at
the end of this one.

Anyway, Becky, I have found and uploaded the beforementioned function
to https://sites.google.com/site/analizasygnalow/zasoby/nasze-narzedzia
the function name is epoch_linearize.m and it is called this way:
newEEG = epoch_linearize(EEG);

it does not retain events, but you don't need these for ICA.
For linearizing multiple files you can use linearize_all_eeg
(also on the page) like this:
ALLEEG = linearize_all_eeg(files, folder);
'files' is assumed to be a cell matrix of file names
(for example: {'subj01.set', 'subj02.set'}), while 'folder'
a string defining filepath (like: 'C:\DATA\Exp1_2012\').

You would still have to save these files and later
join relevant ones. I had a script for this too
where you could specify with regular expressions
what files should be linearized and then concatenated,
but I didn't transform it into a more universal function,
I'll try to do this soon if you would find it useful.

If you have any troubles using these functions -
let me know!


You can also transform all your subject subfiles (epochs of different
> length) into continuous signals (instead of epochs you can place 'boundary'
> events, although it is not necessary for ICA) - such that you have one file
> per subject. Then you would perform ICA and copy ica weights to your
> original epoched files. I think there is a function in EEGlab to 'de-epoch'
> the data (Arno, Makoto, am I correct?). Anyway - I wrote such function some
> time ago, so I'll see if I can still find it. The function did not retain
> events from the original dataset, but you do not need this for ICA.
> (there is yet another option - you could epoch the data into small chunks
> of 1-s long or so, reject epochs containing artifacts or signal of no
> interest, then perform ICA and copy ica weights to your normally epoched
> data. I too have a function for this, which allows for several useful
> options like automatic rejection of windows (these small epochs) that are
> too far from cerain events or event sequences - so that you wouldn't have
> to manually click and reject windows ocurring in breaks or during a task
> you are not interested in. Unfortunatelly the function help is still in
> polish - but the basic options are easy to explain in one short mail - that
> is if you think you will find such function useful)
>  30 kwi 2013 19:24, "Becky Prince" <becky.prince at york.ac.uk> napisał(a):
>
>>  Dear EEGLAB users,
>>
>> I have a question about the best artifact detection and ICA procedures
>> for data sets with multiple epoch types of different lengths.
>>
>> Each trial in my EEG task is made up of 3 non-overlapping epochs of
>> interest: 1) 4 seconds, 2) either 1.5 or 2.5 seconds, 3) 2.5 seconds.  For
>> my previous ERP experiments I've used the following data processing
>> procedure: epoch the data, reject bad epochs, run ICA on remaining epochs,
>> reject ICA components, analyze data in channel space.  For my current
>> experiment (with 3 epochs per trial), I haven't been able to run ICA on all
>> of the epoched data at once because, as soon as I epoch the data, it is
>> split into a separate data set.  I'm fairly sure that these 3 separate
>> epoched data sets cannot be merged/appended for a single ICA run because
>> the epochs are of differing lengths.
>>
>> I've come up with 2 different protocols for processing the individual
>> data sets.  I'm not sure which is better or if I'm overlooking other
>> options.
>>
>> Solution 1: artifact rejection and ICA on continuous data
>> 1) reject artifacts in continuous data
>> 2) run ICA on continuous data
>> 3) reject ICA components
>> 4) epoch the data (creates 3 separate data sets)
>> 5) analyze data in channel space
>>
>> Solution 2: artifact rejection and ICA on epoched data
>> 1) epoch the data (creates 3 separate data sets)
>> Then for each of the 3 epoched data sets:
>> 2) reject epochs
>> 3) run ICA on remaining epochs
>> 4) reject ICA components
>> 5) analyze data in channel space
>>
>> My problem with solution 1 is that it is much more time consuming to
>> detect the artifactual sections of continuous data than it is to detect and
>> reject bad epochs.  Also, ICA seems to run more slowly in this case (even
>> after taking into account the differences in the size of the continuous and
>> epoched data sets).  My problem with solution 2 is that it doesn't seem
>> right to run ICA separately for each epoched data set for the same
>> subject/session.  Because I am doing within-subject comparisons among the 3
>> trial segments, I'm concerned about producing artificial differences among
>> these epochs as a result of differences in the ICA decomposition and
>> component rejection.
>>
>> Sorry for the long question.  Can anyone tell me what they would
>> recommend?  Any suggestions and/or criticisms of my current processing
>> steps would be very helpful!
>>
>> Many thanks,
>> Becky
>> PhD Candidate
>> Department of Psychology
>> University of York
>>
>>
>> _______________________________________________
>> 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/20130506/14cc225d/attachment.html>


More information about the eeglablist mailing list