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

Annotations get truncated to 40 characters #215

Closed arjunmgh closed 1 year ago

arjunmgh commented 1 year ago

when i write annotations using- f.writeAnnotation(onset_time, duration, event_type)

where event_type is the annotation, the annotations are truncated to 40 characters, is there a limit to the length of a single annotation?

skjerns commented 1 year ago

Upon inspection I found that in the original edflib, the maximum annotation length (EDFLIB_WRITE_MAX_ANNOTATION_LEN) is indeed set to 40. However, in the specifications I cannot find a reason why this should be the case.

https://github.com/holgern/pyedflib/blob/2a1567254b374813f97dfe12d4105c5d9ae7f2f1/pyedflib/_extensions/c/edflib.c#L82

I have raised the issue here and will report back.

skjerns commented 1 year ago

see https://gitlab.com/Teuniz/EDFlib/-/issues/13#note_1444441941

It's "on the wishlist", so might be included in the next release. For now, you either need to limit yourself to 40 chars or compile pyedflib yourself while setting EDFLIB_WRITE_MAX_ANNOTATION_LEN to a higher value in developer mode.

arjunmgh commented 1 year ago

Thank you for your help!