epoch: reject_criteria on a sliding window is it possible?


I’m using mne for EEg data.
My question is about the rejecting epoch. Here what I’m using now:

reject_criteria = dict(eeg=150e-6)
epochs = mne.Epochs(reref, events=allevents, event_id=eventsdict, tmin=tmin, tmax=tmax, on_missing=‘warn’, reject=reject_criteria, preload=True, baseline=None, reject_by_annotation=True)

If I understood well the time window correspond to the time of my epoch. But i would like to reject on a sliding window of 300ms. Where could I put this information in my code??

Thank you so much for your help!

Hi Laure,

You might find this snippet code useful: https://gist.github.com/jasmainak/e361f6eefd5a254cc32e423ae56e44ff

It will create annotations and the annotations can be removed during the analysis. Hopefully that satisfies your purposes.