How to remove large brain waves in EDF data.

MNE version: 1.0.3
OS: macOS Monterey

Hello.

I want to remove waves outside of ±100µV as too large EEG from raw data, but it does not work.

reject_criteria = dict(eeg = 100)
data.drop_bad(reject = reject_criteria)

I ran the above code and got the following data.

AttributeError: 'RawEDF' object has no attribute 'drop_bad'

I guess that I need difficult function for the EDF file, but I can’t find the appropriate one.
What should I use?

Thank you in advance for your help.

MNE-Python does not support removing segments from raw (continuous) data, which is what you were trying to do. In order to use the drop_bad() method, you need to epoch your data first. Once you have an Epochs object, you can drop epochs containing artifacts with the code you mentioned.

Thank you for your reply!

I see that I can’t reject remobe without epoching.
I don’t think I would create an epoch if I want to see changes in brain activity as a whole.
How can I do that in that case?

It depends a bit on the types of artifacts you want to remove and on the subsequent processing you are planning to do. For example, you can remove eye artifacts with ICA without the need for epoching (Repairing artifacts with ICA — MNE 1.5.1 documentation).

@OnoreCoffee You can use annotate_amplitude() to exclude segments of raw data based on peak-to-peak amplitude.

1 Like