mne-python: Reading and writing edf files leads to runtime error

1k Views Asked by At

I would like to write an EDF file but haven't found a function in mne that would allow me to do so. So I used pyedflib instead. But when I try to read my newly created EDF file back using mne.io.read_raw_edf(), I get a runtime error:

RuntimeError: EDF+ Annotations (TAL) channel needs to be parsed completely on loading. You must set preload parameter to True.

The code that I used for creating EDF files is a demo from pyedflib:

https://github.com/holgern/pyedflib/blob/master/demo/writeEDFFile.py

What changes do I need to make either in the write-out or the read-in to be able to use mne functions on my EDF file?

1

There are 1 best solutions below

0
On

You need to preload the data:

mne.io.read_raw_edf(preload=True)

This is only necessary for the edf files. For .fif files, it is not necessary.