How to remove flat segments of Concatenated eeg data.

  • MNE version: e.g. 0.24.0
  • operating system: Windows 10

I concatenated different sections of eeg recordings but finding it difficult removing the flat segments of non active recordings. Also, how can I make epoch sections without ‘events’?

Have you seen the mne.preprocessing.annotate_flat function? → you could run that on your concatenated raw data to get an Annotations object attached to your raw data.

Then later (during epoching), you can use the reject_by_annotation parameter to get rid of these flat segments.

Also, how can I make epoch sections without ‘events’?

If you don’t have any markers (TTL triggers, event markers, …) in your data, you will either have to create events from scratch, using some other information about the recording that you may have — or — if you don’t have any information about timings and events, you may want to try creating fixed length epochs, see: mne.make_fixed_length_epochs — MNE 1.6.0 documentation

Thank you @sappelhoff . this is really helpful

Note that from 1.0 onwards, annotate_flat has been replaced by mne.preprocessing.annotate_amplitude.

1 Like