Annotation count inconsistency

Hello,

I am currently working with EDF+ files and have encountered an inconsistency in the number of annotations reported by two different libraries, MNE and edfio. I am seeking insights into why these differences might occur and how can I be sure I get the all annotations.

Here is a brief overview of what I observed:

Using MNE to read an EDF+ file:

import mne
file = "./edfs/EDNDOTKK.edf"
data = mne.io.read_raw_edf(file, verbose=True)
annotations = data.annotations
print(len(annotations))  # Outputs: 1272

Using edfio to read the same EDF+ file:

from edfio import read_edf
file = "./edfs/EDNDOTKK.edf"
edf = read_edf(file)
print(len(edf.annotations))  # Outputs: 1306

Given that both libraries are reading the same file, I expected the number of annotations to match, but they do not. This file includes redacted annotations, which might be affecting the parsing process.

Any insights or recommendations on how to further investigate or resolve this discrepancy would be greatly appreciated.

  • MNE version: 1.7.0
  • Operating system: Windows 11

edit: Further research thought me that my files are edf+D.

Thank you!

I don’t know if there’s a package that can reliably read EDF+D files. However, EDFbrowser includes a command line tool to convert an EDF+D file to multiple EDF+C files, which can be read by both edfio and mne.