[Eeglablist] Interpolation of eliminated channels after running ICA

Cedric Cannard ccannard at protonmail.com
Mon May 22 11:37:03 PDT 2023


Dear Margarida,

I prefer to interpolate them before ICA, as long as you use PCA-dimension reduction when running ICA to take effective data rank into account. although EEGLAB default recommendations is to interpolate electrodes at the STUDY level. 

Here is a quick pipeline draft to do the steps you need:

% import file, remove unnecessary channels (e.g. ECG, EMG, etc.) if you have any, re-reference if you need to for your montage. 

% load channel locations
chanlocpath = fileparts(which('dipfitdefs.m'));
        EEG = pop_chanedit(EEG,'rplurchanloc',1,'lookup',fullfile(chanlocpath,'standard_BEM','elec','standard_1005.elc')); % default BEM 1020 template

% make a copy of this original dataset
oriEEG = EEG;

% remove bad channels
badChan = ~contains({oriEEG.chanlocs.labels}, {EEG.chanlocs.labels});

% remove artifacts with ASR

% interpolate bad channels
EEG = pop_interp(EEG, oriEEG.chanlocs, 'spherical'); % interpolate

% calculate effective data rank
dataRank = sum(eig(cov(double(EEG.data(:,:)'))) > 1E-7);

% run infomax ICA with PCA dimension reduction to take data rank into account
% (to avoid ghost ICs; see https://urldefense.com/v3/__https://doi.org/10.3389/frsip.2023.1064138__;!!Mih3wA!GTJ3993OdyfG-IshNQOYxiBYYiHKfZg6qEl4OZRIFmICN3htPtdNSyQjogs7G-iadtTP7S1I0trfQTxhctruJpmV9w$ )
EEG = pop_runica(EEG,'icatype','runica','extended',1,'pca',dataRank); 

% run ICLABEL
EEG = pop_iclabel(EEG,'default'); 

% Flag ocular and muscular components
EEG = pop_icflag(EEG,[NaN NaN; .95 1; .95 1; NaN NaN; NaN NaN; NaN NaN; NaN NaN]);
badComp = find(EEG.reject.gcompreject); % index of bad components

% Visualize 20 first components (flagged ones are in red)
pop_selectcomps(EEG,1:20); 



Cedric Cannard, PhD


Sent with Proton Mail secure email.

------- Original Message -------
On Monday, May 22nd, 2023 at 8:22 AM, Margarida Moreira via eeglablist <eeglablist at sccn.ucsd.edu> wrote:


> Hello,
> 
> I am having a bit of trouble interpolating my eliminated channels, after
> running ICA.
> I have been eliminating bad channels before running ICA, and I wanted to
> interpolate such channels after running ICA, using a different dataset
> (with no eliminated channels) as reference.
> However, the reference dataset for the interpolation I have been doing was
> from a different participant, that had no eliminated channels. However, as
> I think that might not be very correct since different participants have
> different head shapes and different brain action, I wanted to use a dataset
> from the same participant as the reference.
> However I don't know if using a dataset before running ICA would be
> correct. Wouldn't that have noise that would contaminate the interpolation?
> So my question is: should I keep using another participant as a reference
> dataset, or should I was a same participant dataset before ICA and
> eliminated channels?
> 
> I hope I was able to explain my issue, and thank you for your attention!
> 
> Margarida Moreira
> _______________________________________________
> 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