[Eeglablist] rejecting/interpolating bad channels?
James Desjardins
jdesjardins at brocku.ca
Mon May 9 06:10:02 PDT 2011
Hi Andrew,
The outputs listed in the pop_rejchan help text can be added following
the EEG output at the command line as follows:
[EEG,indelec] = pop_rejchan(EEG,'elec',1:64], ...
'threshold',5,'norm','on','measure','kurt');
Then used in eeg_interp as follows:
EEG = eeg_interp(EEG,indelec)
Also, it may be good practice to store that vector in the EEG
structure so you can keep the information when you subsequently save
the dataset. Other rejection variables are stored in the EEG.reject
field.
The following should work nicely and the marked channels will be
stored when you save the dataset:
[EEG,EEG.reject.indelec] = pop_rejchan(EEG,'elec',1:64], ...
'threshold',5,'norm','on','measure','kurt');
EEG = eeg_interp(EEG,EEG.reject.indelec)
I have been using a procedure similar to this in my data processing
stream where I interpolate bad channels then include them in my
average reference (the interpolation allows for a consistent and
spatially balanced average reference channel across participants
regardless of what channels are marked bad). I keep track of which
channels have been interpolated (in the case above using the
EEG.reject.indelect field) and then I do not include them in
procedures where interpolation is inappropriate (eg. ICA).
I hope that this is helpful.
ps. I am going to use the term "automagically" regularly from now on.
James Desjardins
Technician, MA Student
Department of Psychology, Behavioural Neuroscience
Cognitive and Affective Neuroscience Lab
Brock University
500 Glenridge Ave.
St. Catharines, ON, Canada
L2S 3A1
905-688-5550 x4676
Quoting Andrew Hill <andrewhill at ucla.edu>:
> Hi folks,
>
> I'm trying to figure out how to first automagically detect bad
> channels and then interpolate them on the fly, before saving my EEG
> data set.
> Using pop_rejchan seems to do what it should:
> ...
>>> EEG = pop_rejchan(EEG ,'threshold',5,'norm','on','measure','kurt');
> Computing kurtosis for channels...
> 4 electrodes labeled for rejection
> Removing 4 channel(s)...
> ...
>
> But these are of course not removed - just marked as red in the plot
> and I'm assuming labeled in the EEG object somewhere.
>
> I see an output parameter "indelec" in the pop_rejchan help, but
> after running pop_rejchan I don't see an "indelec" variable created,
> nor a EEG.indelec one.
>
> Ideally I'd like to take the indices of any marked-bad channels and
> then immediately interpolate, maybe something like this?
>
> EEG = pop_rejchan(EEG, 'elec',[1:64]
> ,'threshold',5,'norm','on','measure','kurt');
> EEG = eeg_interp(EEG, EEG.indelec)
>
> But that of course isn't syntatically correct - how/where is this
> information stored?
> Is anyone else doing something like this?
>
> Also, does the pop_reref function know enough to exclude channels
> that have been marked bad?
> I couldn't see anything relevant in the function help.
>
> Thanks,
> Andrew
>
>
> _______________________________________________
> 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