Package used to analyze preprocess edf files for the ENSEMBLE2 study
Project description
Table of Contents
ENSEMBLE EEG
Ensemble EEG is a library of EEG analyis tools for the ENSEMBLE study. As of today it is focuses on 5 seperate things:
- Anonymizing EDF files in accordance with the ENSEMBLE study and the requirements of EDF+
- Fixing EDF headers to adhere to the EDF+ standard
- Converting BRM to EDF+ files
- Combining seperate aEEG channels into one EDF+ file
- Renaming EEG files according to ENSEMBLE and BIDS standards
Getting started
Prerequisites
The following is required for the use of this software
- Python 3.10 & pip
- For instructions, please refer to the following link
Installation
python3 -m pip install ensemble_eeg
Usage
Start python
- From command line
- Open cmd / terminal / powershell or your preferred command line interpreter
- Type python or python3
- Using your preferred python interpreter
Anonymizing EDF-files
from ensemble_eeg import ensemble_edf
ensemble_edf.anonymize_edf_header('path/2/your/edf/file')
Fixing EDF headers
from ensemble_eeg import ensemble_edf
ensemble_edf.fix_edf_header('path/2/your/edf/file')
Combine left and right aEEG channels into one single file
from ensemble_eeg import ensemble_edf
ensemble_edf.combine_aeeg_channels('path/2/your/left/channel', 'path/2/your/right/channel', 'new_filename')
Rename EDF-files according to BIDS and ENSEMBLE standards
from ensemble_eeg import ensemble_edf
ensemble_edf.rename_for_ensemble('path/2/your/edf/file')
Example scripts for specific situations
1) File is already .edf, but you do not know whether header is EDF+, the file is not anonymized, and not renamed
from ensemble_eeg import ensemble_edf
file = 'path/2/your/edf/file'
ensemble_edf.fix_edf_header(file) # for header check
ensemble_edf.anonymize_edf_header(file) # for anonymization
ensemble_edf.rename_for_ensemble(file) # for renaming
2) File is .brm
from ensemble_eeg import brm_to_edf
from ensemble_eeg import ensemble_edf
brm_file = 'path/2/your/brm/file'
brm_to_edf.convert_brm_to_edf(brm_file) # for conversion, output edf is already anonymized
edf_file = 'path/2/your/edf/file' # check which file was made in previous step
ensemble_edf.rename_for_ensemble(edf_file) # for renaming
3) Files are .edf, but left and right channel are seperate
from ensemble_eeg import ensemble_edf
left_file = 'path/2/your/left/edf/file'
right_file = 'path/2/your/right/edf/file'
ensemble_edf.combine_aeeg_channels(left_file, right_file) # output is automatically anonymized
ensemble_edf.rename_for_ensemble(file) # for renaming
4) Anonymize multiple .edf files in the same directory
from ensemble_eeg import ensemble_edf
import glob
import os
edf_directory = 'path/2/your/left/edf/directory'
edf_files = glob.glob(os.path.join(edf_directory, "*.edf"))
for file in edf_files:
ensemble_edf.fix_edf_header(file)
ensemble_edf.anonymize_edf_header(file)
ensemble_edf.rename_for_ensemble(file)
5) Convert multiple .brm files in the same directory
from ensemble_eeg import brm_to_edf
import glob
import os
brm_directory = 'path/2/your/left/edf/directory'
brm_files = glob.glob(os.path.join(brm_directory, "*.brm"))
for file in brm_files:
brm_to_edf.convert_brm_to_edf(file)
For more scripts, please refer to the demos folder
Acknowledgements
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
ensemble_eeg-0.1.3.tar.gz
(25.5 kB
view hashes)
Built Distributions
Close
Hashes for ensemble_eeg-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98feb98b355fb45c40921dc2c36e693d05a376acd2c002a90ba35fa4c676f844 |
|
MD5 | e7b43acc01bc2de34f5f278da0d0ad6a |
|
BLAKE2b-256 | 3ec33e068c613cc833d26d831a8bb2dd1881ed8588ea5d2e29d8c56abfa808ea |
Close
Hashes for ensemble_eeg-0.1.3-1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e32acccc05cd2930e2cf7363e4a767339e6b5af670e4c1379f7013da17e368a5 |
|
MD5 | de6ea2182f9ce4357f454e75846c1f1e |
|
BLAKE2b-256 | 7adb7321cdbd7bab1a2c0f0eb5c6bbe5eb7b75b82bcb9888249ad12c1edadd0d |