ReSurfEMG contains various notebooks you can use and adapt alongside our package. The researcher_interface folder contains notebooks that are more or less 'standard' procedures. The open_work folder contains notebooks with more experimental work. The dev folder contains notebooks that were used for feature development and debugging. This document is a work in progress overview of all notebooks. Below is a list providing a general overview of the notebooks and their purpose.
This notebook provides the basic EMG analysis: picking a data file and sample, visualization, filter and ECG removal, envelope calculation, detection of peaks including on- and offset, feature calculation, and quality assessment.
This notebook: provides the code to generate your own synthetic EMG data and store it to csv.
The analyses on neuro-muscular coupling used for the Warnaar et al. (2024) paper are in this folder. Included are the option for saving experiments, there is preprocessing pipeline with filters, ECG gating, RMS, identifying PEEP levels and occlusion pressure from ventilator data, detecting diaphragm EMG peaks, and some plotting and visualization options.
How to load data. This feature is shown here.
Methods to calculate an EMG envelope. An example is shown here.
Data classes bundle EMG data storage, processing, and plotting in an object oriented way, minimizing the lines of code needed for basic processing. An example is shown here.
A peak feature indicating the reliability of a peak by how much of the signal relative to the surroundings is under the baseline. This feature is shown here.
A peak feature indicating the reliability of a peak by how much it resembles it bell curve. This feature is shown here.
A feature indicating the reliability of an end-expiratory occlusion manoevure by how steep the release is. This feature is shown here.
A peak feature indicating the reliability of a peak by the peak amplitude relative to the baseline level.. This feature is shown here.
We encountered issues when gating windows overlapped. This resolved using this notebook.
We encountered issues with the centralization of the RMS method. This resolved using this notebook.
There are multiple entropy notebooks; this notebook provides multiple approaches to use entropy for breath detection, using different thresholds and visualization on breath by breath basis, as well as a manual check of breath count. We can use it in various ways to automatically identify inhalation using multiple cut-offs. Entropy is also used as part of some workflows to determine strength of respiratory efforts (listed in a separate section).
Reading EMG requires a pre-processing pipeline, but how much information is lost in each step? We explored this using the power spectrum in a notebook on information loss
Our historical notebooks are basically notebooks we keep around just in case we want to look back on them, or that we are still working on. If you feel one of these or your own contribution is relevant to the entire community, let us know and we will add it to the researcher interface in a more polished form.
These notebooks are: