"epochs.selection" exclude epochs from index that are marked as "IGNORED"

Hello MNE Team,

I am currently creating epochs conditions based on behavioral data. I dropped bad epochs using reject and I want to use epoch.selection to kick out the trials that are marked bad. I have block markers in my EEG recording that are stored as “IGNORED” in epoch.selection. Because of those markers my behavioral data and my epoch data index are not the same length. I couldn’t figure out a nice and clean way of getting rid of those block markers from my index in epoch.selection or epoch.drop_log.

Thank you so much for your help.

Carina

Hello @CarinaFo,

I don’t think I fully understand the particularities of your issue, but I just wanted to let you know that the “gold-standard” way of ensuring that epochs and behavioral data stay in sync is to use what we call “epochs metadata” in MNE:

https://mne.tools/stable/auto_tutorials/epochs/30_epochs_metadata.html

I also created a (probably too long…) tutorial demonstrating how to auto-generate metadata based on event markers / triggers:

https://mne.tools/stable/auto_tutorials/epochs/40_autogenerate_metadata.html

Good luck,
Richard

2 Likes

Thank you richard. I added my behavioral data now to the metadata argument and used regexp during annotations_as_events to get rid of the block marker events that messed up my indices.

Thank your for your help.

Carina

2 Likes