MGait: Real-World Gait Pipeline for Wrist-Worn Devices
MGait (Multimorbidity Gait) is a Python implementation of a gait analysis pipeline for real-world assessment, primarily developed for wrist-worn inertial measurement units (IMUs). This pipeline integrates signal-processing algorithms for gait detection, initial contact detection, and stride-length estimation, providing a streamlined workflow for mobility research in people with multiple long-term conditions (multimorbidity). While the pipeline is wrist-focused, fine-tuned versions for lower-back devices are also provided for use in custom workflows.
The individual algorithms included in this library have been developed and validated in multimorbidity cohorts [1]. However, the full integration of these algorithms into a complete pipeline has not yet been formally evaluated, so we do not currently recommend any specific pipeline configuration. In future releases, we plan to systematically assess combinations of algorithms and provide recommended pipelines tailored to different multimorbidity clusters.
Planned future releases include:
- Fully validated pipelines for different multimorbidity clusters.
- Novel algorithm implementations.
- Validated wear-time detection algorithms.
Note on biomechanical definitions : The biomechanical logic and gait event definitions implemented in MGait are based on the specifications defined within Mobilise-D.
Table of Contents
- Installation
- Usage
- Citation
- Validation reference for the underlying algorithms
- Funding and Support
- License
Installation
Install MGait directly from GitHub:
pip install git+https://github.com/DMegaritis/mgait.git
Or clone the repository and install locally:
git clone https://github.com/DMegaritis/mgait.git
cd mgait
pip install .
Usage
The package is designed to be used in two main modes:
Pipeline Use
High-level pipelines allow loading raw IMU data and obtaining gait outcomes end-to-end. Example:
from mgait.pipeline.mgait_pipeline import MGaitPipelineSuggested
pipeline = MGaitPipelineSuggested()
pipeline.safe_run(long_trial)
Note: At this stage we offer a suggested pipeline with the best-performing algorithms from [1], but the full pipeline has not been fully validated yet. Please interpret results cautiously.
Additional note: While this library has been primarily developed as a complete gait pipeline for wrist-worn devices, it also includes support for lower-back algorithms. Fine-tuned versions for lower-back devices are provided and can be used in custom pipelines.
Specific Algorithms
You can also use individual algorithms separately to build custom workflows. Example modules include:
- Gait Sequence Detection (GSD)
- Initial Contact Detection (ICD)
- Stride Length Estimation (SL)
For usage examples and input/output formats, see the examples in this repository or in DMegaritis/multimobility_wrist.
Citation
If you use MGait in your research, please cite:
@software{megaritis2025wristmobility,
author = {Megaritis, Dimitrios and Alcock, Lisa and Scott, Kirsty and Hiden, Hugo and Cereatti, Andrea and Vogiatzis, Ioannis and Del Din, Silvia},
title = {MGait: Real-World Gait Pipeline for Wrist-Worn Devices for Multimorbid Populations},
year = {2025},
publisher = {Zenodo},
doi = {https://doi.org/10.5281/zenodo.17903930},
url = {https://zenodo.org/records/17903930}
}
Validation reference for the underlying algorithms
[1] Megaritis, D., Alcock, L., Scott, K., Hiden, H., Cereatti, A., Vogiatzis, I., & Del Din, S. (2025). Real-World Wrist-Derived Digital Mobility Outcomes in People with Multiple Long-Term Conditions: A Comparison of Algorithms. Bioengineering, 12(10), 1108. https://doi.org/10.3390/bioengineering12101108
Funding and Support
This work was supported by the Medical Research Council (MRC) Gap Fund award (UKRI/MR/B000091/1).
License
The MGait library is licensed under the Apache License 2.0. It is free to use for any purpose, including commercial use, but all distributions must include the license text.
Metadata
Release files for mgait 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mgait-0.1.0.tar.gz | 111.5 kB | Without provenance | Details for mgait-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mgait-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for mgait-0.1.0-py3-none-any.whl |
Total release size: 265.9 kB
Release files / mgait-0.1.0.tar.gz
| Download URL | mgait-0.1.0.tar.gz |
|---|---|
| Size | 111.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2b6ee060336fa6b9c0e0c9389589277f5ee4088a8181c06cb1e4bda9b6470767
|
|
BLAKE2b-256 checksum How to use checksums |
f097b6238772c126e75f1646588d04f87a343472ff4397c099c0f1908623e329
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / mgait-0.1.0-py3-none-any.whl
| Download URL | mgait-0.1.0-py3-none-any.whl |
|---|---|
| Size | 154.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
979f283bdec2e711724abbe7ecc7fff446fe9bcd9ac7013bcc58d21cb774a766
|
|
BLAKE2b-256 checksum How to use checksums |
873218fccdf6fa6d386841493ddb5746ffa0e4019d8a1cd42da4262ac8ad189a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Security for mgait 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.