Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MISC] make explicit that EDF+ (and for EEG: BDF+) are included in iEEG / EEG format requirements #831

Merged
merged 1 commit into from
Aug 4, 2021

Conversation

sappelhoff
Copy link
Member

closes #821

As proposed by @Aaronearlerichardson I here make explicit in the spec, that the EDF and BDF formats supported in EEG and iEEG also include EDF+ and BDF+.

Both EDF+ and BDF+ are backward compatible with EDF and BDF tools, the file extensions are the same, and technical, open accessible specifications of the formats are available and linked.

@CPernet and @robertoostenveld were not particularly enthusiastic, but also not against this change.

I personally deem this change more of a clarification and I assume that most of the BIDS .edf files that are "around" these days are actually EDF+ files anyhow (just my assumption though, I didn't check).

@alexrockhill
Copy link
Contributor

This seems reasonable to me, maybe we should gather an EDF+ and a BDF+ file and add them to mne-bids in a test though. Doing that first might be helpful to know if there are any issues but I think the issues will be able to be solved anyway so whichever order really.

Copy link
Member

@adam2392 adam2392 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sappelhoff
Copy link
Member Author

sappelhoff commented Jul 27, 2021

maybe we should gather an EDF+ and a BDF+ file and add them to mne-bids in a test though

I just did this: MNE-BIDS tests, we are using this EDF file, which is EDF+ as one can verify by reading it via https://gitlab.com/Teuniz/EDFlib-Python

To check for BDF+, I generated a test file (also via EDFlib-Python) and read it via MNE-Python's read_raw_bdf reader, and it worked without problems.

I will attach test files here as a zip for other people to check out. The Zip contains a README and tiny edf, edf+, bdf, and bdf+ files. The EDF and BDF files were created using https://github.com/holgern/pyedflib, because EDFlib-Python does only support writing to EDF+ and BDF+. (Not sure why, maybe to nudge people towards using the newer standard).

edf_bdf_plus_examples.zip

EDIT: Actually, there are also test files (EDF/EDF+/BDF/BDF+) here: https://www.teuniz.net/edf_bdf_testfiles/


One additional thing:

@Teuniz - Perhaps you can offer your EDF(+)/BDF(+) expert opinion here. This is the question:

Are EDF+ and BDF+ truly backward compatible with EDF and BDF (respectively)? That is, when reading an EDF+/BDF+ file with a EDF/BDF reader: Does one get valid data except for the fields that are only supported in the "plus variants" (annotations, etc.)?

Vice versa, I assume that any EDF+/BDF+ reader could read any EDF/BDF file without any problems: Is that true?

In the two questions above I assume that the "readers" I refer to are implemented correctly, according to the EDF(+)/BDF(+) specification(s).

Your input would be very much appreciated!

@Teuniz
Copy link

Teuniz commented Jul 27, 2021

@Teuniz - Perhaps you can offer your EDF(+)/BDF(+) expert opinion here. This is the question:

Are EDF+ and BDF+ truly backward compatible with EDF and BDF (respectively)? That is, when reading an EDF+/BDF+ file with a EDF/BDF reader: Does one get valid data except for the fields that are only supported in the "plus variants" (annotations, etc.)?

Vice versa, I assume that any EDF+/BDF+ reader could read any EDF/BDF file without any problems: Is that true?

In the two questions above I assume that the "readers" I refer to are implemented correctly, according to the EDF(+)/BDF(+) specification(s).

Yes, that's correct.
It's also the reason why some parts of the EDF+ standard look a bit awkward, because the EDF+ extensions are designed in a way not to break compatibility with older EDF readers.
An (older) EDF reader will treat the annotation channel(s) as regular signals and show garbage when plotted but apart from that, it wil not "upset" the reader.
In EDF+, the specifications for the "normal" signals have not been changed.
In other words, an EDF+ file is still a valid EDF file.

@sappelhoff
Copy link
Member Author

okay, thanks everyone. I'll leave this PR open for a bit longer so other people have the option to chime in if they want. But basically, this is ready to be merged.

Out of curiosity @Aaronearlerichardson --> What software do you use to read and write your BDF+ files? Have you ever come across incompatibilities with libraries such as FieldTrip, EEGLAB, or MNE-Python?

I think with regards to BDF+ it's possible that several packages out there do not yet support it, and thus reading BDF+ with these packages will not provide you with the annotations and "enriched patient data" that comes with the "+" of BDF+. Is that what you experience?

In terms of BIDS that wouldn't be a problem of course, because that information is in the BIDS metadata files.

@sappelhoff sappelhoff merged commit 5cabb88 into bids-standard:master Aug 4, 2021
@sappelhoff sappelhoff deleted the misc/edf_bdf branch August 4, 2021 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding BDF and BDF+ to the acceptable data formats for eeg/ieeg data
4 participants