holgern / pyedflib

pyedflib is a python library to read/write EDF+/BDF+ files based on EDFlib.
http://pyedflib.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
209 stars 121 forks source link

How to read events from edf? #183

Closed yifeiSunny closed 1 year ago

skjerns commented 1 year ago

There's two ways. One is getting them from the header['annotations'] that is returned by signal, signalheaders, heder = highlevel.read_edf(), the other is by using the EdfReader.readAnnotations() after opening the file.

so

 signal, signalheaders, header = highlevel.read_edf(edf_filename)
annot = header['annotations']
print(annot)

or

f = EdfReader(edffile)
annot = f.readAnnotations
print(annot)