Skip to content

Latest commit

 

History

History
85 lines (53 loc) · 6.86 KB

notebooks_guide.md

File metadata and controls

85 lines (53 loc) · 6.86 KB

Notebooks guide 🌈

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.

Researcher_interface

Basic EMG analysis

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.

Synthetic EMG maker

This notebook: provides the code to generate your own synthetic EMG data and store it to csv.

Neuro-muscular coupling

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.

Development (dev)

Features

File-reading

How to load data. This feature is shown here.

Gating

One way to reduce the heart signal, is shown here and here.

Root-mean-square and Average-rectified (ARV)

Methods to calculate an EMG envelope. An example is shown here.

Data classes

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.

Area under the baseline (AUB)

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.

Bell fit

A peak feature indicating the reliability of a peak by how much it resembles it bell curve. This feature is shown here.

Pocc quality

A feature indicating the reliability of an end-expiratory occlusion manoevure by how steep the release is. This feature is shown here.

Pseudo SNR

A peak feature indicating the reliability of a peak by the peak amplitude relative to the baseline level.. This feature is shown here.

Debugging

Gating

We encountered issues when gating windows overlapped. This resolved using this notebook.

Root-mean-square centralization

We encountered issues with the centralization of the RMS method. This resolved using this notebook.

Open_work

Entropy

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

Information loss

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

Historical notebooks 👻

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:

Entropy

Independent component analysis

Lag lead mismatch