This package performs ECG processing on custom datasets followed by feature extraction.
- R-Peak Detection - Detect R-peaks in 12-lead ecgs using Neurokit2 tool.
- ECG Delineation - to detect P/QRS/T onset/peak/offset.
- Feature Extraction - Compute baseline features such as heart rate and ecg-related intervals (PR interval, QT interval, etc.)
- Load ECG data from a specified dataset.
- Perform cleaning and preprocessing of ECG signals.
- Detect R-peaks and delineate ECG signals into their physiological components.
- Extract features from the cleaned ECG data.
- Save the extracted features and annotations to output files.
- Clone the repository:
[email protected]:dieterich-lab/ecg_processing.git cd ecg_processing
- Install the package:
pip install -r requirements.txt
- To run the script:
python main.py
Edit the config.json
file to specify dataset paths and output directories.
Currently, the pipeline is tested with 3 different datasets i.e. Mediconnect, UK Biobank and MIMIC-IV ECGs.
The data loader script for each of these datasets is available under data_loader/
directory.
Now, to use your own dataset, create a data loader under the same directory,
Expected Output
- A NumPy array of ECG signals
(signal_array)
with shape(n_samples, n_leads, n_timepoints).
- The sample frequency
(samp_freq)
. - A predefined list of channel sequences
(CHANNELS_SEQ)
.