Closed dengemann closed 1 year ago
Yes, we could add that. I just didn't feel the need so far because I haven't actually encountered absolutely flat data in the wild in a channel that wasn't marked as "bad" anyway. Is this a thing that actually occurs?
Yes :) otherwise I would not bother. E.g. in general anesthesia you can have burst suppression, which gives flat EEG.
What I meant is, MNE's flat rejection looks for absolutely flat signals, i.e., where the amplitude difference between consecutive time points is exactly zero, if I'm not mistaken. Even if in your real-world setting EEG goes flat, I assume there are still minuscule fluctuations in the data, which would then not be classified as flat. I guess what I'm trying to say is that we first might need to make MNE's flat finding algorithm more robust, or add a new function to find and annotate flat segments with a certain tolerance. This is what I'd been working on recently, I have some code somewhere that is inspired by the flat-rejection part of find_bad_channels_maxwell
. I can share it with you so we can see if it would do the job for you?
see https://mne.tools/stable/generated/mne.Epochs.html
Rejection parameters based on flatness of signal. Valid keys are 'grad', 'mag', 'eeg', 'eog', 'ecg'. The values are floats that set the minimum acceptable peak-to-peak amplitude (PTP). If the PTP is smaller than this threshold, the epoch will be dropped. If None then no rejection is performed based on flatness of the signal.
it you set flat=dict(grad=1e-14) it will consider it flat if ptp is less than 1e-14 T/m
Oh … the heck, what was I reading about then? 🤔 Anyway, this seems like a trivial fix then!
Closing as dup of #446 because it says what function should be used
I think it would be important to also pass the flat params to the the epoching script. Any thoughts? @drammock @hoechenberger @agramfort