Skip to content

dieterich-lab/ecg_processing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ECG Processing and Feature Extraction

This package performs ECG processing on custom datasets followed by feature extraction.

  1. R-Peak Detection - Detect R-peaks in 12-lead ecgs using Neurokit2 tool.
  2. ECG Delineation - to detect P/QRS/T onset/peak/offset.
  3. Feature Extraction - Compute baseline features such as heart rate and ecg-related intervals (PR interval, QT interval, etc.)

Workflow

  • 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.

Installation

  1. Clone the repository:
    [email protected]:dieterich-lab/ecg_processing.git
    cd ecg_processing
    
  2. Install the package:
    pip install -r requirements.txt
    
  3. To run the script:
    python main.py
    

Configuration

Edit the config.json file to specify dataset paths and output directories.

Data Loader and Formats

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

  1. A NumPy array of ECG signals (signal_array) with shape (n_samples, n_leads, n_timepoints).
  2. The sample frequency (samp_freq).
  3. A predefined list of channel sequences (CHANNELS_SEQ).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages