[Eeglablist] filters, ICA and erp

Stefan Debener stefan.debener at uni-oldenburg.de
Thu Oct 13 23:59:55 PDT 2011


Hi Steve,

Yes, ICA training on 1 Hz hp filtered data and applying the weights to 
the unfiltered data was my suggestions (and has been used in Scott's lab 
for many years, I believe). After playing a lot with preprocessing we 
found this to work best as well. The ML code below shows a typical 
preprocessing example implementing this. Note that, due to the HP 
filter, there is no real benefit in baseline correction of the dummy 
epochs. The rationale for this code, as well as a more general 
introduction into the analysis of multi-channel EEG data with ICA 
(inlcuding other assumptions and relazted preprocessing issues), is 
descriped in our EEG-fMRI book in chapter 3.1.:

Debener et al., (2010). Using ICA for the analysis of mutli-channel EEG 
data. In: Ullsperger & Debener (Eds.). Simultaneous EEG and fMRI: 
recording, analysis, and application (pp. 121-133). Oxford University 
Press.

Feel free to cite this chapter when you use the code below.

Thanks,
Stefan

Ps: Sara, on the issue of filtering and ERPs, you should test the effect 
of the filter, by plotting an overlay of the filtered and unfiltered 
ERPs. This, of course, should be done on single subject ERPs, as the 
grand average sometimes acts as a(nother) filter.



-----------------------------------------------------------------
% miu_inside_ana03.m
% sd
%
% ica on cnt data
% ----------------------------------------------------------------

MAINPATH = '/data/sd_miu/pilot_inside/';
PATHIN = [MAINPATH, 'data/ana02/'];
PATHOUT = [MAINPATH, 'data/ana03/'];
SUBJ = {'4102', '4103new', '4105', '4106'};
HPF = 1;                 % high pass filter for ica training only
DIM = 63;               % ica dimensionality
EPOCHDUR = 1;      % epoch duration in seconds for pruning
THRES = 4;             % SD cut-off for rejection

for s = 1:length(SUBJ)
[ALLEEG EEG CURRENTSET ALLCOM] = eeglab;
EEG = pop_loadset('filename', [SUBJ{s}, '_bcgrem.set'], 'filepath', PATHIN);

% high pass filter
EEG = pop_iirfilt(EEG, HPF, 0, [], [0]);

% dummy trigger for epoching
for i=1:(EEG.srate*EPOCHDUR):EEG.pnts
     EEG.event(end+1).type = 'S999';
     EEG.event(end).latency = i;
end
EEG = eeg_checkset(EEG);
%eeg_eventtypes(EEG)

% epoching and pruning
EEG = pop_epoch(EEG, {'S999'}, [0 EPOCHDUR], 'newname', 'tmp epochs', 
'epochinfo', 'yes');
EEG = pop_jointprob(EEG,1,[1:63] ,THRES, THRES,0,0);
EEG = pop_rejkurt(EEG,1,[1:63] ,THRES, THRES,0,0);
EEG = eeg_rejsuperpose(EEG, 1, 1, 1, 1, 1, 1, 1, 1);
EEG = pop_rejepoch(EEG, EEG.reject.rejglobal ,0);

% ICA
EEG = pop_runica(EEG, 'icatype','runica','dataset',1,'options', 
{'extended' 1, 'pca' DIM },'chanind',[1:63]);

TMP.icawinv = EEG.icawinv;
TMP.icasphere = EEG.icasphere;
TMP.icaweights = EEG.icaweights;
TMP.icachansind = EEG.icachansind;

% apply to cnt dataset
clear EEG;
EEG = pop_loadset('filename', [SUBJ{s}, '_bcgrem.set'], 'filepath', PATHIN);
EEG.icawinv = TMP.icawinv;
EEG.icasphere = TMP.icasphere;
EEG.icaweights = TMP.icaweights;
EEG.icachansind = TMP.icachansind;
clear TMP;
EEG = pop_saveset(EEG, 'filename',[SUBJ{s}, '_cnt.set'], 
'filepath',PATHOUT);
[ALLEEG, EEG, CURRENTSET] = eeg_store(ALLEEG, EEG, 0);

end
eeglab redraw;

----------------------------------------


Am 10/13/11 6:09 PM, schrieb Steve Luck:
> Hi Sara.  Unless you care about frequencies per se, epoching and 
> baseline-correcting the data won't be a problem.  From a time-domain 
> perspective, this won't change anything.
>
> BTW, someone else suggested using the 1-Hz high-pass cutoff, 
> performing ICA, and then applying the component coefficients to the 
> unfiltered data.  That sounds like a great suggestion, although I 
> don't know if there is a technical reason why it wouldn't work.  Does 
> anyone out there know if there would be a problem with this?
>
> Steve
>
> ps- The email trail on this topic has gotten out of hand, so I deleted 
> everything except the most recent message and your original message.
>
> On Oct 13, 2011, at 7:20 AM, Sara Graziadio wrote:
>
>> Steve,
>> actually I was refering to your book when I was writing that the 
>> filter would deforme/reduce the erp. But following David Groppe's 
>> suggestion would mean to reduce activity at different frequency all 
>> across the spectrum, wihtout exactly knowing which frequencies I am 
>> reducing, am I right? If I want to look at the psd as well as at the 
>> erps, would this analysis just be correct? I am always concerned 
>> about applying data modification that I cannot fully control..if you 
>> know what I mean...
>> Thank you very much
>> Best
>>
>> Sara
>
>> On Wed, Oct 5, 2011 at 10:46 AM, Sara Graziadio
>> <sara.graziadio at newcastle.ac.uk 
>> <mailto:sara.graziadio at newcastle.ac.uk>> wrote:
>> Hello,
>> I would like just a suggestion about some data cleaning/analysis I am 
>> doing. I
>> am doing an ERP analysis and I want to clean my data first with the 
>> ICA. In
>> theory, though, I should not use an high-pass cutoff higher than 0.1 
>> Hz to not
>> reduce the erp amplitude. On the other side the ICA does not work 
>> well if the
>> high-pass cutoff is lower than 0.5 Hz...what is then the best method 
>> to apply?
>> Has anybody tested how robust the ica is with a 0.1Hz filter?
>> I have also another question: I am doing the analysis on 94 electrodes
>> referenced to Fz. I planned to average reference the data but 
>> actually there is
>> quite a large spread of noise on all the electrodes with this method 
>> (muscular
>> artefacts for example from the temporal electrodes). But actually 
>> almost all
>> the papers are using the average reference so I was surprised, am I 
>> the only
>> one having this problem of noise? Would not be better just to keep the Fz
>> reference and then perhaps to average the erps for every different 
>> cortical
>> area and do the analysis on these averaged erps?
>>
>> Thank you very much
>>
>> Best wishes
>>
>> Sara Graziadio
>> Research Associate
>> Newcastle University
>
> --------------------------------------------------------------------
> Steven J. Luck, Ph.D.
> Director, Center for Mind & Brain
> Professor, Department of Psychology
> University of California, Davis
> Room 109
> 267 Cousteau Place
> Davis, CA 95618
> (530) 297-4424
> E-Mail: sjluck at ucdavis.edu <mailto:sjluck at ucdavis.edu>
> Web: http://mindbrain.ucdavis.edu/people/sjluck
> Calendar: 
> http://www.google.com/calendar/embed?src=stevenjluck%40gmail.com&ctz=America/Los_Angeles 
> <http://www.google.com/calendar/embed?src=stevenjluck@gmail.com&ctz=America/Los_Angeles>
> --------------------------------------------------------------------
>
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> 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


-- 
Prof. Dr. Stefan Debener
Neuropsychology	Lab
Department of Psychology
University of Oldenburg
D-26111 Oldenburg
Germany

Office: A7 0-038
Phone: +49-441-798-4271
Fax:   +49-441-798-5522
Email: stefan.debener at uni-oldenburg.de

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20111014/243e95f7/attachment.html>


More information about the eeglablist mailing list