Export to EDF using pyEDFLib

See original GitHub issue

Problem Right now it is only possible to export data using FIF, which is not a very useful and widely used file format. I do remember seing an issue about integration of some EDF library, but at this point I can’t find it again.

Suggestion I’d like to make a first, basic addition to integrate pyEDFlib for writing EDF+ files to disk. I’m using this library since some time and have good experience with it.

However I have a few questions regarding the approach:

  • Would it be okay to use an external library for saving EDF instead of re-inventing the wheel?
  • Where should I insert the code? I thought to extend BaseRaw with a function save_edf(), however it would also be possible to alter .save() to accept different file types
  • in the basic version, this would save channels (and annotations?) only as raw as they are. I have no experience with all the Evoked, Epoched, etc. and if we could save them appropriately via EDF.

Alternatives Write a native EDF-writer, which at this point I do not have the time for.

edit: I’ve created a gist as requested here: https://gist.github.com/skjerns/bc660ef59dca0dbd53f00ed38c42f6be

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
agramfortcommented, Nov 29, 2018

2 reactions:

  • @holgern @robertoostenveld (author of pyedf) and anyone interested in this should team up so there is one reference implementation of EDF files in Python

  • pyEDFlib has a dependency on cython so it’s not an option to use this in mne. Packaging compiled code is too much work.

I would support adding an entry in the MNE doc to document how to write edf+ files with mne. You could put a link to a gist you use.

0reactions
cbrnrcommented, Dec 12, 2018

Closing since this was fixed in #5777, but if a pure-Python solution emerges in the future, feel free to open a new issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PyEDFlib -EDF/BDF Toolbox in Python — PyEDFlib ...
PyEDFlib is a free Open Source wavelet toolbox for reading / writing EDF/EDF+/BDF files. import pyedflib import numpy as np file_name = ...
Read more >
How to export a rawEDF file to my computer - Stack Overflow
so basically I am manipulating edf files using mne and pyedflib libraries in python. As long as I am applying many changes on...
Read more >
PyEDFlib Documentation - Read the Docs
PyEDFlib is a Python library to read/write EDF/EDF+/BDF files based on EDFlib. ... The EDF/EDF+ format saves all data with 16 Bit.
Read more >
pyedflib is a python library to read/write EDF+/BDF+ files ...
I'd like to do that if it's at all practical. Also, the byte-order issues seem to be in edflib. My quick research suggests...
Read more >
EDF+ / Annotations / Most are missing when importing the .edf ...
Signal comes through fine. We're using eego recording software (from ant-neuro) for exporting the recorded signal to .edf and I think ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found