[Eeglablist] Order of Channel Removal+Interpolation and ICA (removing noisy components)
Naviya Lall
naviyal at iiitd.ac.in
Thu May 28 23:51:55 PDT 2026
Thank you for these responses, they are incredibly helpful. Brief follow up
questions-
1. Should I use script to first save the number of the channels, then
remove the noisy ones and then interpolate the ones removed *OR* can I just
tell EEGLAB the noisy channels and then interpolate without removing like
this:
bad_idx = find(ismember({EEG.chanlocs.labels}, {'F10'})); %
EEG = pop_interp(EEG, bad_idx, 'spherical');
EEG = eeg_checkset(EEG);
[ALLEEG, EEG, CURRENTSET] = eeg_store(ALLEEG, EEG, CURRENTSET);
2. If I interpolate the noisy channels without removing them, do I still
run the PCA adjusted ICA? like so-
n_chans = EEG.nbchan; data_rank = rank(double(EEG.data(:,:))); % or just:
n_chans - n_interpolated
EEG = pop_runica(EEG, 'icatype', 'runica', 'extended', 1, 'pca', data_rank);
3. Dr. Miyakoshi- If I follow this strategy of interpolating before ICA,
would it be sensible to cite the paper you referred to?- Kim H, Luo J, Chu
S, Cannard C, Hoffmann S and Miyakoshi M (2023) ICA’s bug: How ghost ICs
emerge from effective rank deficiency caused by EEG electrode interpolation
and incorrect re-referencing. Front. Sig. Proc. 3:1064138. doi:
10.3389/frsip.2023.1064138
Thank you!
Best regards,
Naviya
--
Naviya Lall
Junior Research Fellow
Cognitive Science Lab
IIIT Delhi
naviyalalluni.wixsite.com <https://urldefense.com/v3/__https://naviyalalluni.wixsite.com/naviyalall__;!!Mih3wA!FQyTrO4VCQzKiAaHQYBhwg-G7LrmGyGdl2DOVzeIYwL4krOhTWwF7h59XTGli76LuO9fipK7WDEdwyD-E89CpGG1$ >
On Fri, May 29, 2026 at 3:18 AM Makoto Miyakoshi via eeglablist <
eeglablist at sccn.ucsd.edu> wrote:
> Hi Marshid and Tim,
>
> Thank you for your comments. It's my honor to go against Claude's advice!
>
> In fact, I recognize Claude's workaround works fine for a specific purpose:
> it uses ICA purely as an electrode signal cleaner at the cost of
> IC-electrode correspondence i.e., your EEG.icawinv will be invalidated. As
> a result, certain types of analyses become impossible, such as
> envelope-topography (envtopo) at the group-level analysis, because matrix
> dimensions do not match across datasets.
>
> Here is the step by step examination.
>
> 1. We all agree that bad channels need to be excluded before ICA. Suppose
> that we reject n channels here.
>
> 2. We run ICA on this channel-reduced data. As a result, the reduced number
> of electrodes are registered to your ICA-generated matrices
> (EEG.icaweights, EEG.icasphere, EEG.icawinv, EEG.chaninds).
>
> 3. After ICA, you interpolate rejected channels to recover your original
> EEG.nbchan. Technically, you can do it. Probably you see no error message
> in EEGLAB. However, this interpolation does not take care of ICA-generated
> matrices (as far as I know). As a result, you can't perform IC rejection
> for electrode signal cleaning because the number of channels of your scalp
> recording and of your ICA-generated matrices do not match. You do see an
> error message here.
>
> 4. The easiest way (i.e., without developing a reasonable workaround and
> publishing it a dedicated technical paper to address this specific problem)
> to avoid this problem is to perform channel interpolation BEFORE ICA so
> that all the original electrodes are registered to ICA-generated matrices
> so that you can perform IC rejection etc. after ICA. The drawback is that
> you need to use PCA (or whatever) dimension reduction to run full-rank ICA
> decomposition: see my ICA's bug paper for detail. Spline channel
> interpolation is the most dangerous process for ICA because it does not
> cause a clean rank deficiency due to its nonlinearity. If the smallest
> eigenvalue is < 1E-6, ICA starts to generate 'ghost ICs', even though
> Matlab's rank() function says 'the data are full ranked'! I credit Sven
> Hoffmann for finding this threshold.
>
> To conclude, my suggestion guarantees group-level data compatibility
> between scalp and IC sources at the cost of the use of PCA dimension
> reduction in ICA, and Claude's suggestion works fine only for channel data
> analysis.
>
> Makoto
>
> On Thu, May 28, 2026 at 9:24 AM Tim Curran <tim.curran at colorado.edu>
> wrote:
>
> > Hi Makoto,
> > I have been playing with Claude Code, and using the latest Claude.md file
> > with EEGLAB.
> >
> > Claude.md file says:
> > "Typical pipeline position: clean_rawdata (removes bad channels) ->
> > re-reference -> ICA -> ICLabel -> remove components -> **interpolate** ->
> > re-reference (again, optional) -> epoch.”
> >
> > You do not agree with eeglab’s Claude.md file or maybe I am missing
> > something?
> >
> > thanks
> > Tim
> >
> >
> >
> > *From: *eeglablist <eeglablist-bounces at sccn.ucsd.edu> on behalf of
> Makoto
> > Miyakoshi via eeglablist <eeglablist at sccn.ucsd.edu>
> > *Date: *Wednesday, May 27, 2026 at 5:41 PM
> > *To: *eeglablist at sccn.ucsd.edu <eeglablist at sccn.ucsd.edu>
> > *Subject: *Re: [Eeglablist] Order of Channel Removal+Interpolation and
> > ICA (removing noisy components)
> >
> > [External email - use caution]
> >
> >
> > Hi Naviya,
> >
> > - My main question is if I should perform interpolation before ICA
> > or after ICA?
> >
> > Do it BEFORE ICA.
> > If you perform channel interpolation after ICA, your EEG.icasphere does
> not
> > have columns for the added channel.
> >
> > Makoto
> >
> > On Tue, May 26, 2026 at 2:19 PM Naviya Lall via eeglablist <
> > eeglablist at sccn.ucsd.edu> wrote:
> >
> > > Hello all,
> > >
> > > My name is Naviya and I work with EEG data in a lab in Delhi, India. I
> > have
> > > a question about EEG data channel interpolation and its order in
> > > preprocessing pipelines.
> > >
> > > - We record data with high density EEG (128 channels).
> > > - I tried to perform ICA without removing any channels and it was
> > giving
> > > me noise heavy components (I use ICA to remove noisy components of
> > eye,
> > > heart, muscle etc.)
> > > - I just want to remove 2-4 channels in some participants or certain
> > > sessions.
> > > - The GUI has very easy direct interpolation
> > > steps- Tools>Interpolate>select from data channels which skips the
> > > "Removal" step altogether.
> > > - In code I feel that it would be easier to "remove" the noisy
> > > channel(s) and use this - original_chanlocs = EEG.chanlocs; (to
> save
> > > original locations) and then EEG = pop_interp(EEG,
> original_chanlocs,
> > > 'spherical');
> > > to interpolate the removed data- *Is that right?*
> > > - My main question is if I should perform interpolation before ICA
> or
> > > after ICA?
> > > - I read through some older exchanges on EEGLABLIST Archive from
> 2015,
> > > 2017, 2023 and 2025 however I am still unsure of the ideal order of
> > > performing interpolation.
> > > - My logical thought is to remove + interpolate before running ICA
> so
> > > that the rank and number of components generated is not affected but
> > > most
> > > people advise to remove channel, then ICA and then interpolate.
> > > - Please advise on the method of channel removal+interpolation and
> the
> > > order of channel interpolation and ICA?
> > >
> > >
> > > Thank you so much.
> > >
> > >
> > > Best regards,
> > > Naviya
> > >
> > > --
> > > Naviya Lall
> > > Junior Research Fellow
> > > Cognitive Science Lab
> > > IIIT Delhi
> > > naviyalalluni.wixsite.com <
> > >
> >
> https://urldefense.com/v3/__https://nam10.safelinks.protection.outlook.com/?url=https*3A*2F*2Furldefense.com*2Fv3*2F__https*3A*2F*2Fnaviyalalluni.wixsite.com*2Fnaviyalall__*3B!!Mih3wA!AK4IIr3bl7l5vstVMLfS9SvOU__IwE4KJfUqRptsvdt6mN4V6stqKqyZVfvP6h_-ebr4vwz6RSNGbePI1sed-hDQ*24&data=05*7C02*7Ctim.curran*40colorado.edu*7C5079845aad8347e770d908debc4968d2*7C3ded8b1b070d462982e4c0b019f46057*7C1*7C0*7C639155220649594641*7CUnknown*7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ*3D*3D*7C0*7C*7C*7C&sdata=QGd*2F*2BQg2J2n0RkrlOzb*2FhSvbVx*2Fn0bVEQOYCEDOyJBs*3D&reserved=0__;JSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJSU!!Mih3wA!Fy84dba60JaJD0fse1s0aw2M57j4HXXwDjTTVm3jvINiwNtWFC0hdHgfyQySOxrDj_DzOc-vYNGAVTei2QI_ZmXOfiM$
> > <
> https://urldefense.com/v3/__https://naviyalalluni.wixsite.com/naviyalall__;!!Mih3wA!AK4IIr3bl7l5vstVMLfS9SvOU__IwE4KJfUqRptsvdt6mN4V6stqKqyZVfvP6h_-ebr4vwz6RSNGbePI1sed-hDQ$
> >
> > > >
> > > _______________________________________________
> > > To unsubscribe, send an empty email to
> > > eeglablist-unsubscribe at sccn.ucsd.edu or visit
> > >
> >
> https://urldefense.com/v3/__https://nam10.safelinks.protection.outlook.com/?url=https*3A*2F*2Fsccn.ucsd.edu*2Fmailman*2Flistinfo*2Feeglablist&data=05*7C02*7Ctim.curran*40colorado.edu*7C5079845aad8347e770d908debc4968d2*7C3ded8b1b070d462982e4c0b019f46057*7C1*7C0*7C639155220649658506*7CUnknown*7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ*3D*3D*7C0*7C*7C*7C&sdata=c006lGx*2Fi56iu2LNb9*2FuIWUnxG7dj6so24fzPPOjWsw*3D&reserved=0__;JSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUlJQ!!Mih3wA!Fy84dba60JaJD0fse1s0aw2M57j4HXXwDjTTVm3jvINiwNtWFC0hdHgfyQySOxrDj_DzOc-vYNGAVTei2QI_6lBRk_o$
> > <https://sccn.ucsd.edu/mailman/listinfo/eeglablist > .
> > >
> > _______________________________________________
> > To unsubscribe, send an empty email to
> > eeglablist-unsubscribe at sccn.ucsd.edu or visit
> >
> https://urldefense.com/v3/__https://nam10.safelinks.protection.outlook.com/?url=https*3A*2F*2Fsccn.ucsd.edu*2Fmailman*2Flistinfo*2Feeglablist&data=05*7C02*7Ctim.curran*40colorado.edu*7C5079845aad8347e770d908debc4968d2*7C3ded8b1b070d462982e4c0b019f46057*7C1*7C0*7C639155220649710224*7CUnknown*7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ*3D*3D*7C0*7C*7C*7C&sdata=IT5TcjXlhHoNDwoMewsn*2BHl5tWNo1LhIj23ioNFTfhk*3D&reserved=0__;JSUlJSUlJSUlJSUlJSUlJSUlJSUlJSUl!!Mih3wA!Fy84dba60JaJD0fse1s0aw2M57j4HXXwDjTTVm3jvINiwNtWFC0hdHgfyQySOxrDj_DzOc-vYNGAVTei2QI_Gjg6iIE$
> > <https://sccn.ucsd.edu/mailman/listinfo/eeglablist >.
> >
> _______________________________________________
> To unsubscribe, send an empty email to
> eeglablist-unsubscribe at sccn.ucsd.edu or visit
> https://sccn.ucsd.edu/mailman/listinfo/eeglablist .
More information about the eeglablist
mailing list