Hi,
Could anyone help me how to find indices of epochs that have been dropped ?
Also, does mne have an automatic rejection for bad epochs ?
Thanks in advanced
IG
Hi,
Could anyone help me how to find indices of epochs that have been dropped ?
Also, does mne have an automatic rejection for bad epochs ?
Thanks in advanced
IG
Sorry for the slow reply. epochs.selection
gives you the indices of epochs that have not been dropped. epochs.drop_log
records the reasons why epochs have been dropped. So to get the indices of dropped epochs, there are a few options, e.g.,;
[n for n, dl in enumerate(epochs.drop_log) if len(dl)] # result is a list
np.nonzero(map(len, epochs.drop_log)) # result is a numpy array
For your second question, when epochs are created via mne.Epochs(raw, events, ...)
there are a few ways that epochs can get dropped:
reject
parameter. See the docstring for examples.raw
object had any annotations that start with bad
or edge
, and an epoch would overlap that annotation. These are signal values used when concatenating raws (edge
) or when annotating artifacts (bad
). You can prevent this dropping by passing reject_by_annotation=False
Thank you so much for this info. I will try your advice