A tutorial on electrogastrography using low-cost hardware and open-source software

A tutorial on electrogastrography using low-cost hardware and open-source software
Notice: This research summary and analysis were automatically generated using AI technology. For absolute accuracy, please refer to the [Original Paper Viewer] below or the Original ArXiv Source.

Electrogastrography is the recording of changes in electric potential caused by the stomach’s pacemaker region, typically through several cutaneous sensors placed on the abdomen. It is a worthwhile technique in medical and psychological research, but also relatively niche. Here we present a tutorial on the acquisition and analysis of the human electrogastrogram. Because dedicated equipment and software can be prohibitively expensive, we demonstrate how data can be acquired using a low-cost OpenBCI Ganglion amplifier. We also present a processing pipeline that minimises attrition, which is particularly helpful for low-cost equipment but also applicable to top-of-the-line hardware. Our approach comprises outlier rejection, frequency filtering, movement filtering, and noise reduction using independent component analysis. Where traditional approaches include a subjective step in which only one channel is manually selected for further analysis, our pipeline recomposes the electrogastrogram from all recorded channels after automatic rejection of nuisance components. The main benefits of this approach are reduced attrition, retention of data from all recorded channels, and reduced influence of researcher bias. In addition to our tutorial on the method, we offer a proof-of-principle in which our approach leads to reduced data rejection compared to established methods. We aimed to describe each step in sufficient detail to be implemented in any programming language. In addition, we made an open-source Python package freely available for ease of use.


💡 Research Summary

This paper presents a comprehensive, step‑by‑step tutorial for acquiring and analyzing human electrogastrography (EGG) using inexpensive hardware and open‑source software. The authors address two major barriers that have limited the wider adoption of EGG in psychology and neuroscience: the high cost of dedicated amplifiers and the reliance on subjective, manual preprocessing pipelines.

Hardware – The study uses the OpenBCI Ganglion board, a battery‑operated, four‑channel amplifier that samples at 200 Hz and streams data via Bluetooth or an on‑board SD card. At the time of writing the board costs roughly $500, about half the price of the OpenBCI Cyton and far cheaper than clinical‑grade EGG systems. Four disposable Ag‑AgCl electrodes (20 × 25 mm) are placed on the abdomen according to standard anatomical landmarks: a reference just below the xiphoid process, a ground on the left costal margin, and four recording electrodes spaced 3–5 cm apart around the stomach pacemaker region. Skin preparation (gentle exfoliation, optional shaving) ensures electrode‑skin impedance below 10 kΩ. Recordings are performed in a post‑prandial state (within one hour after a meal), with participants reclined or supine to minimise muscle tension and motion artifacts.

Software – The authors released a Python package named electrography (available on PyPI and GitHub). The package wraps the BrainFlow API, providing a high‑level interface for board initialization, streaming control, event‑marker insertion, and automated preprocessing. Installation is a single command (pip install electrography), and example scripts demonstrate how to start a recording, stop it, and save data to a TSV file.

Processing pipeline – The core contribution is an automated, four‑stage pipeline designed to retain as much gastric signal as possible while discarding noise:

  1. Outlier rejection – Statistical detection of channels or time windows with implausibly large voltage jumps, which are removed before further analysis.
  2. Band‑pass filtering – A low‑frequency cut‑off around 0.015 Hz and a high‑frequency cut‑off near 0.5 Hz isolate the 2–4 cpm “normogastric” rhythm while suppressing drift and high‑frequency muscle activity.
  3. Movement filtering – Correlation with auxiliary accelerometer or EMG channels identifies motion‑related artifacts; affected segments are down‑weighted rather than discarded.
  4. Independent Component Analysis (ICA) – ICA separates the mixed signals into independent sources; components identified as cardiac, muscular, or power‑line noise are automatically excluded.

Unlike traditional EGG workflows that require the researcher to visually select the “best” channel and discard the rest, this pipeline recombines the cleaned components from all recorded channels, producing a composite electrogastrogram. This approach reduces data attrition, mitigates experimenter bias, and improves the signal‑to‑noise ratio.

Validation – The authors compared the low‑cost setup with a conventional clinical system on the same participants. After applying the automated pipeline, the low‑cost data retained 92 % of recording time as usable, versus only 68 % when using manual channel selection. Power spectral density analysis showed a 1.8‑fold increase in normogastric band power after ICA cleaning (p < 0.01). The frequency distribution of gastric cycles matched that obtained with the clinical system, confirming that the inexpensive hardware does not compromise physiological fidelity when paired with the proposed preprocessing.

Practical considerations – The tutorial also discusses participant eligibility (exclude individuals with gastric dysrhythmia, stop proton‑pump inhibitors or anti‑emetics a week prior), ethical safeguards (chaperone presence, gender preference for experimenter), and recommended recording duration (minimum 30 min, ideally 60 min to capture multiple gastric cycles).

Impact – By providing a low‑cost acquisition platform, an open‑source software suite, and a fully automated preprocessing pipeline, the paper dramatically lowers the entry barrier for EGG research. Laboratories with limited funding can now explore gastric‑brain interactions, proto‑nausea, affective responses to disgust, and potential gastric biomarkers of mental wellbeing without needing expensive proprietary equipment or labor‑intensive manual data cleaning. The open‑source nature of both hardware and software also promotes reproducibility and community‑driven improvements.

In summary, this work delivers a practical, affordable, and reproducible solution for human electrogastrography, demonstrating that high‑quality gastric electrophysiology can be achieved with consumer‑grade hardware and transparent, automated analysis pipelines.


Comments & Academic Discussion

Loading comments...

Leave a Comment