Tools to view and analyze EDFs in Matlab.


Sleep Portal EDF Tools for Sleep Research

The European Data Format was published in 1992 to facilitate exchange and analysis of sleep studies and continues to be a primary mode of sleep study archival and exchange. We have developed a set of tools for accessing EDF files with the aim of improving the access, utility, and value of quantitative signals contained within sleep studies. The tools are provided as open source with the explicit goal of encouraging collaboration and contributions. The tools described on this page are designed and developed by researchers for researchers. The aim is to reduce the amount of time required to view and analyze signals within an EDF file for our collaborators, who are not always sleep researchers. We employ agile development practices, which ensures that code is explicitly versioned. These development practices enable us to make tools available while collaborating with researchers to make the tools better. Each tool is described below and download links are provided.

If you are interested in learning more about the European Data Format, visit the EDF specification page.

Are you looking for a routine for loading sleep data? You might want to look here.

The Data Access and Visualization for Sleep (DAVS) toolbox is available and described here.

Some of the tools listed below will be re-released as part of the National Sleep Research Resource, which aims to make sleep data, annotations and supported tools freely available. Additional documentation and tutorials for NSRR supported can be found at http://sleepdata.org/.

BlockEdfLoad

signal_block_smBlockEdfLoad was written to decrease the amount of time to load the signals data into memory.  The loader uses block memory loads corresponding to EDF headers and signal sections in conjunction with matrix rotations to access individual signals. The loader is written as a MATLAB script, which the majority of collaborators use for analysis. We are excited at the access speed up that we have achieved. Read our accepted abstract for Sleep 2013 or our submitted paper for additional details. We have also described the loader in detail so the approach can be replicated in other commonly used systems. Send us an email if you recreate the approach in R, Python or any other language. We are sure that there are other researchers that could use the loader.

The most recent version of BlockEdfLoad can be downloaded here. If you are interested in modifying, extending or referencing a previous versions please access the BlockEdfLoad development site.

 

 

BlockEdfLoadClass

BlockEdfLoadClass is an object oriented version for the EDF loader described above.  The class mirrors all of the functionality in the functional form of the loader.  In addition, the class provides direct access to header/signal information, generates header/signal summaries, creates simple signal plots, and provides basic support for batch analysis of data. The most recent version of BlockEdfLoadClass can be found here.

BlockEdfWrite

BlockEdfWrite is a utility for creating EDF files from user generated data. Function can also be used to over write the header, which has applications for de-identifying data. The most recent version of BlockEdfWrite can be found here.

BlockEdfDeIdentify

The Health Insurance Portability and Accountability Act of 1996 (HIPAA) requires us to only share de-identified data. The MATLAB function can be used in conjunction with BlockEdfWrite to remove the patient id and study date from the EDF header.

Signal Raster Viewer

signalRasterEeg125The Signal Raster Viewer is a utility that can be used to inspect the contents of an EDF file. The EDF header and signal information can be inspected from the MATLAB console or written to a file.  A signal raster plot can be created for the selected signal. The utility has the parameters for controlling the signal segment duration and the number of sequential signal segment displayed on each page of the signal raster summary.  The signal raster plot can be saved in a Microsoft PowerPoint File. More information can be found here.

 

Sleep Portal Viewer

EDf_View_sm

Sleep Portal Viewer was developed at Case Western Reserve University as part of the Physio-MIMI project as an open source MATLAB EDF viewer. Our goal is to provide a viewer for our quantitative collaborators, especially engineers who are developing new methods to analyze physiological signals stored in a sleep file. The viewer enables the user to open an EDF file and a corresponding sleep annotation file, which contains sleep scoring information. The user can select the signals to view and a myriad of ways are provided to scroll through the signals including: scrolling, clicking on the hypnogram, and clicking on a specific annotation. The Sleep Portal Viewer is the result of collaborations between engineers, sleep researchers, and scoring technicians. Our engineering colleagues insured that filtering methods were included. Our sleep researchers ensured that expected signal navigation methods were included. The Sleep Portal Viewer provides a minimal viewer which we designed to decrease the amount of time for sleep researchers to begin collaborations. The MATLAB scripts for the Sleep Portal Viewer can be found here. A complied version of the program is available for 64 Bit Windows machines and can be found here.  Contact us if you are interested in the compiled version of the program.

 

Spectral Art

SpectralArtThumbSpectralArt is an an interactive spectral analysis and automatic artifact detection program for sleep data that includes sleep-wake scoring information.  The spectral analysis feature includes the ability to save epoch by epoch results, summary results across the sleep session, and to save summary figures.  Total, absolute and relative power are computed and summaries are created for user defined spectral bands. The automatic artifact detection features include the ability to set the thresholds, perform threshold sensitivity studies and to view the epoch identified with artifacts.

More information about the spectral analysis program can be found here.

 

 

 

 

Collaborators

The most recent version of Sleep Portal Viewer can be downloaded here. If you are interested in modifying, extending or referencing a previous versions please access the Sleep Portal Viewer development site.

Case Western Reserve University
Ken Loparo, PhD
Farhad Kaffashi, PhD
Brigham and Women’s Hospital
Harvard Medical School

Susan Redline, PhD
Remo Mueller, PhD
Dennis A. Dean, II, PhD

References

    1. Dean II DA, Kaffashi F, Mueller R, Redline S, Loparo KA. Block EDF Load and the Sleep Portal EDF-Viewer: Open Source MATLAB Tools for Viewing Polysomnography Files Stored in European Data Format (EDF). Sleep 2013.
    2. Dean II DA, Kaffashi F, Mueller R, Redline S, Loparo KA. BlockEdfLoad: A Fast European Data Format Loader for Computational Sleep Medicine Applications.  (In Preparation).