mne-python icon indicating copy to clipboard operation
mne-python copied to clipboard

add skip_by_annotation to notch_filter and resample

Open jasmainak opened this issue 3 years ago • 3 comments

We have TMS-EEG data at MGH for which we're trying to figure what is the best processing pipeline. The TMS pulses are recorded as triggers, so we can create annotations of 10 ms around those triggers and use that to exclude from operations such as ICA and raw.filter. This seems to work well but we noticed that skip_by_annotation is not supported in notch_filter and resample. Would it make sense to add these functionality to these functions as well? It would also make the API more consistent.

jasmainak avatar Mar 20 '22 20:03 jasmainak

Agreed this would be useful!

larsoner avatar Mar 21 '22 12:03 larsoner

Thinking about this more, if resample function was to have skip_by_annotation, how is the "skipped" segment to be handled? Would there still be decimation but no filter since MNE-Python only supports a single sampling frequency ...

jasmainak avatar Dec 19 '22 20:12 jasmainak

how is the "skipped" segment to be handled? Would there still be decimation but no filter since MNE-Python only supports a single sampling frequency ...

Yes there would be no need, it would just get subsampled somehow. An upfirdn (with no filter / a delta) could do it as you suggest

larsoner avatar Dec 20 '22 14:12 larsoner