Skip to content

Scripts to run ICA/PCA/SSP to remove cardiac artefact from ESG data

License

Notifications You must be signed in to change notification settings

EEGKit/cardiac-artefact-removal

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Release DOI License: MIT

cardiac-artefact-removal

This repository is associated with the following manuscript and the corresponding dataset. If you have any questions related to this code, please feel free to contact [email protected].

Content

This repository contains the preprocessing and analysis code used to remove the cardiac artefact from spinal electrophysiology data as presented in the above-mentioned manuscript.

Main Processing

main.py is a wrapper script which can be used to detail the stages of analysis to run. These steps include:

  • Data Import (incl. downsampling, r-peak event annotation, stimulus artefact removal, file concatenation)
  • Cardiac artefact removal via:
    • PCA_OBS (Principal Component Analysis Optimal Basis Sets)
    • ICA (Independent Components Analysis, including variants involving anteriorly re-referenced data and applying ICA separately to the lumbar and cervical spinal patch of electrodes)
    • SSP (Signal Space Projection with varying numbers of projectors)
  • Signal enhancement analysis via:
    • CCA (Canonical Correlation Analysis)

Metrics

Scripts contained in /Metrics are used to compute the:

  • SNR (Signal-to-Noise Ratio of the SEPs)
  • RI (Residual Intensity of the cardiac artefact)
  • INPSR (Improved Normalised Power Spectrum Ratio of the cardiac artefact)
  • CoV (Coefficient of Variation)

Statistics

Scripts contained in /Statistics are used to determine statistical significance via one-sample permutation t-tests for the SNR, RI, INPSR and CoV results.

Plotting_Code_Publication

Scripts contained in /Plotting_Code_Publication are used to generate all manuscript and supplement figures, as seen in the above mentioned manuscript.

QRS Timing

The R-peak latencies for each subject and condition has been provided for convenience in /QRS_Timing. To run the PCA_OBS method in particular, precise knowledge of the timing of each R-peak is required. These QRS timings should be copied into the relevant data folder and this file path should then be substituted for import_path_m within the following files:

  • import_data.py
  • rm_heart_artefact.py
  • rm_heart_artefact_tukey.py

These timings are generated using the method employed by Nierula et al., 2024 and the accompanying code can be found in the associated repository.

Archive

Scripts contained in /Archive contain old code and alternative versions of scripts which are no longer in use.

Required Software

All scripts run with python 3.9 and MNE 1.0.3, for an extensive list of required packages see requirements.txt

About

Scripts to run ICA/PCA/SSP to remove cardiac artefact from ESG data

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%