Updating annotations

Hello everyone,

I am trying to figure out a way to delete epochs that correspond to stimuli (in my case, words) whose behavioral response was below performance.

The simplest idea would be to use the reject_by_annotation argument of the mne.Epoch function, though I am having trouble figuring out how to do that, since the raw data is associated with annotations/events, which however do not contain any info regarding the words being presented. The word info are added as metadata only when epoching.

Can anyone suggest the best way to do this, given the issue above?

see mne.Epochs β€” MNE 0.23.dev0 documentation

Alex

1 Like

Thank you for your reply!

I see that the drop() method may be of use here. Just to clarify – the indices are just the consecutive index number of the epochs, right? So, I would just need to identify the indices of the epochs I want to delete and pass it through the function. Am I correct?

If the data are not preloaded, then the indices you pass to drop() are just the sequential numeric indices (so pass [0, 5] to drop the first and sixth trials).

If the data are preloaded, certain epochs may have already been dropped due to signal reject criteria provided when the Epochs() constructor was called. In that case, dropping the first and sixth trials might need different indices. For example, suppose the third and fourth epochs were rejected because of a big signal jump (maybe the subject scratched their nose), then the remaining epochs will be 0, 1, 4, 5, 6, … so to drop the first and sixth trials, you need indices [0, 3].

Either way, as long as the indices you pass to drop() refer to the epochs based on their current order in the Epochs object β€” not based on the β€œoriginal” order prior to epoch rejection β€” you should get the right result.

2 Likes

Ok, got it. Thank you both!