[Eeglablist] interpolate previously deleted channels

Gorka FG gorkafraga at gmail.com
Thu Feb 9 17:08:52 PST 2017

hi Tarik,
thanks. Following  Makoto's pipeline and your suggestion, I first loaded a
dataset with all chans saved the EEG variable with a different name , e.g.
 Then I start my subjects' loop in which I load each dataset and then run :
pop_interp(EEG,originalEEG.chanlocs, 'spherical') .
This seem to work fine

On Feb 10, 2017 1:02 AM, "Tarik S Bel-Bahar" <tarikbelbahar at gmail.com>

Hello Gorka, it should be as easy as the following, though it's a simple
loading a first file with the removed channels missing
and then loading a second file that has all the original channels
and then run interpolate from the GUI, to "fill out the missing channels in
the first file based on the full channels from the second file".
Then review the commands that were run from eegh.
You may want to play around with the different options in the gui and view
the different results.
Use the modified commands based on eegh in your loop, and make adjustments
in your codelet as necessary.
You might need to reload the "all-channels" file each time you want to
If you're matlab saavy, one can use the Urchannel locations information to
rebuild original channels too.

On Mon, Feb 6, 2017 at 7:24 PM, Gorka FG <gorkafraga at gmail.com> wrote:

> Dear all,
> I have a dataset in which bad channels were manually removed using  EEG =
> pop_select (EEG, 'channel', *chans2keep*). In later steps, I was unable
> to interpolate those removed channels so I did a workaround inserting blank
> channels and then interpolating (see below).
> Would this approach be correct? am I missing a more simple way of doing
> this using pop_interp?
> Thanks in advance for the help!
> Gorka
> *--*
> %insert blank channels using *insertrows*  ( http://nl.
> mathworks.com/matlabcentral/fileexchange/9984-insertrows-a-b-ind-)  in
> each trial:
>        for trial = 1:size(EEG.data,3); % loop thru trials
>             tmp= EEG.data(:,:,trial);
>               for c = 1:length(chans2interpNum); % loop thru indexes of
> channels to interpolate
>                   tmp= insertrows(tmp,zeros(1,size(EE
> G.data,2))],chans2interpNum(c)-1); %insert a row of zeros at chan index
> position
>               end
>             newEEG(:,:,trial) = tmp;
>             clear tmp
>        end
>        EEG.data = newEEG;
> %interpolate:
>        EEG = eeg_checkset(EEG);
>         EEG = pop_chanedit(EEG,'load',chanlocsfile,'besa');
>            for c = 1:length(chans2interp);
>                EEG =pop_interp(EEG,chans2interpNum(c), 'spherical');
>            end
>          EEG = eeg_checkset(EEG);
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.uc
> sd.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/20170210/cc9d1669/attachment.html>

More information about the eeglablist mailing list