It seems like zeroing out ICA components has no effect on the data. I plot the sources and components and click on the sources I want to zero out before exiting the window, I then use .apply(raw) which tells me it is zeroing out the number of components that I selected, but then when I plot both raw and raw_corrected they are identical.
Before applying ica I also use
ica.plot_overlay(raw, exclude=[9,10], picks="eeg")
to see what the effect will be and there is definitely a difference shown there. The difference in the “average across EEG channels” plot is very noticeable.
MNE version: e.g. 0.24.0
operating system: macOS 12
raw = mne.io.read_raw(before_ICA_path, preload = True)
raw.interpolate_bads()
ica_chans = raw.info['ch_names'].copy()
# create ica instance with defined parameters
ica = ICA(.95,
max_iter= 1000, # max iterations allowed for the algorithm
random_state= 42,
method = 'infomax',
fit_params=dict(extended = True)
)
# fit ica with the parameters above to the data
ica.fit(raw,
picks = ica_chans, # channels to use
reject = dict(eeg = 300e-5) # threshold to ignore parts of the signal
)
# plot topology and select components in sources plot.
ica.plot_sources(raw)
ica.plot_components()
raw_corrected = ica.apply(raw)
raw.plot(start = 14, scalings="auto")
raw_corrected.plot(start = 14, scalings="auto")
Is there any reason why this would be happening? There was a github issue opened on this topic, where I think the people responding basically were saying that the difference will be small enough to not see a change between plots but they didn’t go into any more detail. That just doesn’t really make sense to me either, especially since there is such a noticeable difference when I use plot_overlay.