eeghdf is a module for reading a writing EEG data into the hdf5 format
Project description
eeghdf
Project to develop a easily accessible format for storing EEG in a way that is easy to access for machine learning.
-
hdf5 based format with the following advantages:
- industry standard format, supported in many languages (C, python, javascript, matlab..)
- compression, checksums
- efficient reading (the whole file is not read into memory to access data)
- "self documenting" and extensible
- advanced features: parallel readers/single writer, MPI, streaming supported
-
looked at edf and neo formats, see Neurodata Without Borders. Compare with XDF.
-
simplier than neo, but may need more of neo's structures as use grows
-
compare with MNE fif format of mne project to evolve
-
looke to support multiple records and different sampling rates
-
look to add fields for clinical report text
-
look to add field for montages and electrode geometry
-
"extension" group
Simple install for developers
- change to the desired python environment
- make sure you have git and git-lfs installed
git clone https://github.com/eegml/eeghdf.git
pip install -e eeghdf
- or if you just want to install as a requirement into a virtual env. Put this into your requirements.txt. The repo will be cloned into ./src/eeghdf and installed
-e git+https://github.com/eegml/eeghdf#egg=eeghdf
Re-sampling
There are many ways to resample signals. In my examples I used an approach based upon libsamplerate because it seemed to give accurate results. Depending on your platform there are many options. Recently I have been suing pytorch based tools a lot, torchaudio has resamplinge tools and librosa is looks very impressive.
Installation will vary but on ubuntu 18.04 I did:
sudo apt install libsamplerate-dev
pip install git+https://github.com/cournape/samplerate/#egg=samplerate
To Do
- code to write file, target initial release version is 1000
- initial scripts to convert edf to eeghdf and floating point hdf5
- code to subsample and convert edf -> eeghdf
- code to write back to edf
- more visualization code -> push to eegvis
- add convenience interface to phys_signal with automagic conversion from digital->phys units
- add study admin code to record info (do not seem to include this now, e.g. EEG No like V17-105)
- code to clip and create subfiles
- allow patient info to propagate
- hash list/tree of history of file so that can track provenance of waveforms if desired
- clip and maintain correct (relative) times
- consider how to handle derived records: for example the downsampled float32 records "frecord200Hz"
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file eeghdf-0.2.2.tar.gz
.
File metadata
- Download URL: eeghdf-0.2.2.tar.gz
- Upload date:
- Size: 52.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.27.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 601b1dd591042b6888d09fb0a3ac5e6f6d11a2f39cd9027c029d3bb053438caf |
|
MD5 | 6c4116582a899e957c6635d1d3745c72 |
|
BLAKE2b-256 | 4670cda90909b177bd3890f18d3dfc782559c8550395ae4b0f121361b0650e02 |
File details
Details for the file eeghdf-0.2.2-py2.py3-none-any.whl
.
File metadata
- Download URL: eeghdf-0.2.2-py2.py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.27.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba7c8008ed63e3b9896ec33b581d01df1c4fcfa1f7cdba749ced251946a0fb85 |
|
MD5 | 5d091212183983b84e5dd787840530b0 |
|
BLAKE2b-256 | 1fb5f573438788c5ae47719f6c91f30b95cb9bbab280b3c88d53f228f261f7b5 |