mne-tools / mne-bids-pipeline

Automatically process entire electrophysiological datasets using MNE-Python.
https://mne.tools/mne-bids-pipeline/
BSD 3-Clause "New" or "Revised" License
134 stars 65 forks source link

Better handling of virtual EOG channels during ICA #815

Closed hoechenberger closed 3 months ago

hoechenberger commented 8 months ago

Make it such that when using "virtual" EOG channels (e.g., typically these would be frontal EEG channels), the PTP rejection with the thresholds specified in ica_reject will treat these channels as EOG.

šŸ“š Background

I'm working with a set of EEG data where many participants have strong ocular contaminations in numerous frontal channels. I selected these channels for use as virtual EOG channels. I want to use ICA to remove the ocular artifacts from my data.

The problem is that since these channels are actually of type "eeg", I have to supply extremely high values in ica_reject = {"eeg": ...}; otherwise, many epochs (both experimental epochs and automatically created EOG epochs) get rejected before ICA fitting. If that happens, ICA has no chance to "see" the ocular artifacts, and fails to remove them.

Yet, I don't want to be too lenient when setting ica_reject, because I don't want voltage spikes from other channels (e.g. from the occipital region) to interfere with ICA fitting.

So what I actually want is two sets of rejection thresholds: one for the channels that capture most of the EOG signal, and another for the remaining EEG channels.

šŸ§‘ā€šŸ’» This PR

I'd love to hear your feedback on this, @agramfort

šŸ˜« ICA is hard

I feel I'm constantly struggling to hit the right balance between "don't feed too much crap into ICA, because the decomposition will not be good" and "If you don't feed enough bad data, ICA won't have a chance to detect those artifacts".

cc @larsoner, @mscheltienne

agramfort commented 8 months ago

to me it's just a fundamental hard and ill posed problem. For example, it depends on what you do later with the data. Knowing what is signal and what is noise depends on effect you study so cleaning up data independently of the contrast you test, the decoding approach you run etc. is just ill defined. We just have at best good rules of thumbs but it's just rules of thumbs that are never optimal, but not too bad on average...

hoechenberger commented 8 months ago

Thanks @agramfort, this makes total sense!

Do you have any comments on the specific changes I'm proposing here? To me, it seems natural to apply "EOG" PTP thresholds to "virtual" EOG channels, instead of, say, EEG PTP thresholds. But that may just be my own bubble! :)

hoechenberger commented 3 months ago

I'm closing this for now as I get the feeling this is just starting to over-complicate things.