• Stars
    star
    209
  • Rank 187,217 (Top 4 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created about 9 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

pyedflib is a python library to read/write EDF+/BDF+ files based on EDFlib.

pyEDFlib

Test Coverage Docs Build PyPI Version Conda Version Conda Downloads

What is pyEDFlib

pyEDFlib is a python library to read/write EDF+/BDF+ files based on EDFlib.

EDF means European Data Format and was firstly published Kemp1992. In 2003, an improved version of the file protocol named EDF+ has been published and can be found at Kemp2003.

The EDF/EDF+ format saves all data with 16 Bit. A version which saves all data with 24 Bit, was introduces by the company BioSemi.

The definition of the EDF/EDF+/BDF/BDF+ format can be found under edfplus.info.

This Python toolbox is a fork of the toolbox from Christopher Lee-Messer and uses the EDFlib from Teunis van Beelen. The EDFlib is able to read and write EDF/EDF+/BDF/BDF+ files.

Documentation

Documentation is available online at http://pyedflib.readthedocs.org.

Installation

pyEDFlib can be used with Python >=3.7. It depends on the Numpy package. To use the newest source code from git, you have to download the source code. You need a C compiler and a recent version of Cython. Go then to the source directory and type:

python setup.py build
python setup.py install

There are binary wheels which can be installed by (use pip3 when available):

pip install pyEDFlib

Users of the Anaconda Python distribution can directly obtain pre-built Windows, Intel Linux or macOS / OSX binaries from the conda-forge channel. This can be done via:

conda install -c conda-forge pyedflib

The most recent development version can be found on GitHub at https://github.com/holgern/pyedflib.

The latest release, including source and binary packages for Linux, macOS and Windows, is available for download from the Python Package Index. You can find source releases at the Releases Page.

Highlevel interface

pyEDFlib includes an highlevel interface for easy access to read and write edf files. Additionally functionality as anonymizing, dropping or renaming channels can be found there.

from pyedflib import highlevel

# write an edf file
signals = np.random.rand(5, 256*300)*200 # 5 minutes of random signal
channel_names = ['ch1', 'ch2', 'ch3', 'ch4', 'ch5']
signal_headers = highlevel.make_signal_headers(channel_names, sample_frequency=256)
header = highlevel.make_header(patientname='patient_x', gender='Female')
highlevel.write_edf('edf_file.edf', signals, signal_headers, header)

# read an edf file
signals, signal_headers, header = highlevel.read_edf('edf_file.edf', ch_names=['ch1', 'ch2'])
print(signal_headers[0]['sample_frequency']) # prints 256

# drop a channel from the file or anonymize edf
highlevel.drop_channels('edf_file.edf', to_drop=['ch2', 'ch4'])
highlevel.anonymize_edf('edf_file.edf', new_file='anonymized.edf'
                         to_remove=['patientname', 'birthdate'],
                         new_values=['anonymized', ''])
# check if the two files have the same content
highlevel.compare_edf('edf_file.edf', 'anonymized.edf')
# change polarity of certain channels
highlevel.change_polarity('file.edf', channels=[1,3])
# rename channels within a file
highlevel.rename_channels('file.edf', mapping={'C3-M1':'C3'})

License

pyEDFlib is a free Open Source software released under the BSD 2-clause license.

Releases can be cited via Zenodo.

More Repositories

1

beem

A python library to interact with the HIVE blockchain
Python
133
star
2

pynostr

Python library for nostr
Python
53
star
3

TUB_PhDThesisTemplate

An unofficial PhD Thesis template for pdflatex, lualatex and xelatex for the Technical University of Berlin. The pdf-files are following the PDF/A-1b standard.
TeX
30
star
4

py-scrypt

This is a set of Python bindings for the scrypt key derivation function.
C
22
star
5

steemrewarding

Automatic upvote service for STEEM
CSS
13
star
6

hiveengine

Unofficial Python library for hiveengine
Python
11
star
7

ua-python

ua-python
Python
9
star
8

sciflt

sciFLT is a Fuzzy Logic Toolbox for scilab
Scilab
9
star
9

pymempool

About Python Package for Mempool.Space API.
Python
9
star
10

pyyawt

Yet another python wavelet toolbox
C
8
star
11

steemengine

Python library for steem/hive engine
Python
8
star
12

swt

Scilab Wavelet Toolbox
C
6
star
13

steembasicincome

steembasicincome - scripts for python
Python
5
star
14

pyRdatasets

1300 datasets from various R packages packed as DataFrames through compressed pickle files
Python
5
star
15

hivedesktop

A pyqt5 based desktop app for the hive blockchain
Python
4
star
16

sublime-scilab

Scilab syntax highlighter for Sublime Text. Scilab is an open source software for numerical computation (http://scilab.org).
XML
3
star
17

BeemBot.py

BeemBot - Bot to allow with steem using the beem library via discord
Python
3
star
18

hive-reports

Python
3
star
19

scilab-edflib

load/write edf/bdf-files
C
3
star
20

EDFlib-qt

EDFlib-qt is a QT-based library to read/write EDF+/BDF+ files based on EDFlib.
C++
2
star
21

hivehistory

Python tools for obtaining and processing account history of a hive account
Python
2
star
22

hivediff

Diff viewer for hive posts
Python
1
star
23

steem-fullnode-update

The steem account @fullnodeupdate contains the newest full node updates
Python
1
star
24

rebuild-mingw

scripts for rebuilding MinGW-w64 targets from scratch
Shell
1
star
25

BeempyTerminal

Python
1
star
26

delegationOnboardBot

Python
1
star
27

sci-libsvm

Scilab language bindings for LIBSVM
Scilab
1
star
28

QRtaiLab

QRtaiLab is a QT-based port of the software scope xrtailab of the RTAI project. It can be used as virtual oscilloscope and monitoring application for interacting with the real-time executable. More informations about RTAI on https://www.rtai.org .
C++
1
star