alexenge / hu-neuro-pipeline

Single trial EEG pipeline at the Abdel Rahman Lab for Neurocognitive Psychology, Humboldt-Universität zu Berlin
https://hu-neuro-pipeline.readthedocs.io
MIT License
14 stars 3 forks source link

Fix bad epoch rejection for epochs that already have bad epoch markers (e.g., `NO_DATA`) #140

Closed alexenge closed 11 months ago

alexenge commented 11 months ago

E.g., participant sub-006 in the ERP CORE ERN dataset has 387 EEG epochs with matching triggers (i.e., () in epochs.drop_log) but the drop log also contains (NO_DATA) for the first event. So this event was not ignored when looking up the indices of the rejected epochs in get_bad_epochs, leading the bad_ixs to be off by 1.

Let's hope this is sufficiently general. Ideally, we should also take into account any pre-existing "bad" markers in the data, regardless of our own peak-to-peak rejection.

Fixes #139