We have a setting ica_reject to remove bad epochs before fitting ICA. The epochs we feed into ICA are separate from the epochs we want to clean: they're high-pass filtered and they have drop_bad(reject=ica_reject) applied. This ensures ICA can be fit on epochs without flux / voltage spikes etc
Now in the apply_ica step, when we load the "actual" epochs we wish to clean, instead of simply applying ICA, we first call drop_bad(reject=ica_reject) too. In my opinion this is a bug, as normally we should be assuming that applying ICA may at least remove some of those high-amplitude artifacts. But if we reject those epochs before cleaning them via ICA, they're gone forever.
I think we should remove the drop_bad() call here. Any remaining large-amplitude artifacts after ICA cleaning will be caught in the following step, preprocessing/ptp_reject.
In an EEG dataset I'm currently working with, applying the PTP rejection threshold before applying ICA leads to a loss of many epochs that could have been saved through ICA
We have a setting
ica_reject
to remove bad epochs before fitting ICA. The epochs we feed into ICA are separate from the epochs we want to clean: they're high-pass filtered and they havedrop_bad(reject=ica_reject)
applied. This ensures ICA can be fit on epochs without flux / voltage spikes etcNow in the
apply_ica
step, when we load the "actual" epochs we wish to clean, instead of simply applying ICA, we first calldrop_bad(reject=ica_reject)
too. In my opinion this is a bug, as normally we should be assuming that applying ICA may at least remove some of those high-amplitude artifacts. But if we reject those epochs before cleaning them via ICA, they're gone forever.https://github.com/mne-tools/mne-bids-pipeline/blob/1bc1e8226d70b10b6d3a76d69d355cd906775b39/mne_bids_pipeline/steps/preprocessing/_07a_apply_ica.py#L102-L115
I think we should remove the
drop_bad()
call here. Any remaining large-amplitude artifacts after ICA cleaning will be caught in the following step,preprocessing/ptp_reject
.In an EEG dataset I'm currently working with, applying the PTP rejection threshold before applying ICA leads to a loss of many epochs that could have been saved through ICA
cc @agramfort