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
214 stars 121 forks source link

Can not read FieldTrip tutorial data file #202

Closed tensionhead closed 1 year ago

tensionhead commented 1 year ago

In one of FieldTrip's tutorials an edf file is loaded from the SubjectNY394 dataset. However, it is not readable by pyedflib:

from pyedflib import highlevel
highlevel.read_edf('NY394_VisualLoc_R1.edf')

throws

OSError: NY394_VisualLoc_R1.edf: the file is not EDF(+) or BDF(+) compliant the label is incorrect

I also tried the low-level approach:

import pyedflib
f = pyedflib.EdfReader('NY394_VisualLoc_R1.edf')

which throws the same exception as above. I am using a fresh install via pip (pyedflib-0.1.32).

We were thinking of adding edf support to Syncopy using pyedflib, but got stuck due to this reading error.

EDIT: The mne.io.read_raw_edf() function can open this file

skjerns commented 1 year ago

This is probably a problem within the file itself. We are using edflib in the background, which is quite strict with adhering to the specifications. I'll have a look at it in the next days.

General rule of thumb: If EDFBrowser gives the same error, the problem is likely not easily solvable on our side.

tensionhead commented 1 year ago

I was afraid so, indeed checking with the EDFBrowser as you recommended shows:

Ok I guess I will reach out to the FT people, thx!