multigait 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- multigait-0.2.0/LICENSE +201 -0
- multigait-0.2.0/PKG-INFO +142 -0
- multigait-0.2.0/README.md +120 -0
- multigait-0.2.0/multigait/CAD/__init__.py +0 -0
- multigait-0.2.0/multigait/CAD/base_cad.py +42 -0
- multigait-0.2.0/multigait/CAD/cad.py +199 -0
- multigait-0.2.0/multigait/CAD/utils/__init__.py +0 -0
- multigait-0.2.0/multigait/CAD/utils/cad_utils.py +101 -0
- multigait-0.2.0/multigait/GSD/GSD1.py +334 -0
- multigait-0.2.0/multigait/GSD/GSD2.py +477 -0
- multigait-0.2.0/multigait/GSD/GSD3.py +156 -0
- multigait-0.2.0/multigait/GSD/GSD4.py +275 -0
- multigait-0.2.0/multigait/GSD/GSD5.py +267 -0
- multigait-0.2.0/multigait/GSD/__init__.py +1 -0
- multigait-0.2.0/multigait/GSD/base_gsd.py +41 -0
- multigait-0.2.0/multigait/GSD/utils/ActivityCounts.py +182 -0
- multigait-0.2.0/multigait/GSD/utils/GSD1_utils.py +264 -0
- multigait-0.2.0/multigait/GSD/utils/GSD3_utils.py +135 -0
- multigait-0.2.0/multigait/GSD/utils/__init__.py +1 -0
- multigait-0.2.0/multigait/GSD/utils/cart_to_spher.py +36 -0
- multigait-0.2.0/multigait/GSD/utils/cwb.py +57 -0
- multigait-0.2.0/multigait/GSD/utils/gravity_remove_butter.py +78 -0
- multigait-0.2.0/multigait/GSD/utils/merge_bouts.py +45 -0
- multigait-0.2.0/multigait/ICD/ICD1.py +408 -0
- multigait-0.2.0/multigait/ICD/ICD2.py +193 -0
- multigait-0.2.0/multigait/ICD/ICD3.py +185 -0
- multigait-0.2.0/multigait/ICD/ICD4.py +130 -0
- multigait-0.2.0/multigait/ICD/ICD5.py +134 -0
- multigait-0.2.0/multigait/ICD/ICD6.py +258 -0
- multigait-0.2.0/multigait/ICD/__init__.py +1 -0
- multigait-0.2.0/multigait/ICD/base_ic.py +41 -0
- multigait-0.2.0/multigait/ICD/utils/__init__.py +0 -0
- multigait-0.2.0/multigait/ICD/utils/auto_cov_unbiased.py +28 -0
- multigait-0.2.0/multigait/ICD/utils/dominant_frequency.py +25 -0
- multigait-0.2.0/multigait/ICD/utils/dtwDasGupta.py +104 -0
- multigait-0.2.0/multigait/ICD/utils/find_maxima.py +31 -0
- multigait-0.2.0/multigait/ICD/utils/find_minima.py +31 -0
- multigait-0.2.0/multigait/ICD/utils/peakfind.py +52 -0
- multigait-0.2.0/multigait/ICD/utils/zero_crossings.py +51 -0
- multigait-0.2.0/multigait/SL/SL1.py +379 -0
- multigait-0.2.0/multigait/SL/SL2.py +331 -0
- multigait-0.2.0/multigait/SL/SL3.py +396 -0
- multigait-0.2.0/multigait/SL/__init__.py +0 -0
- multigait-0.2.0/multigait/SL/base_sl.py +44 -0
- multigait-0.2.0/multigait/SL/utils/SL_utils.py +22 -0
- multigait-0.2.0/multigait/SL/utils/__init__.py +0 -0
- multigait-0.2.0/multigait/WS/__init__.py +0 -0
- multigait-0.2.0/multigait/WS/base_ws.py +55 -0
- multigait-0.2.0/multigait/WS/walking_speed.py +133 -0
- multigait-0.2.0/multigait/__init__.py +0 -0
- multigait-0.2.0/multigait/aggregation/__init__.py +0 -0
- multigait-0.2.0/multigait/aggregation/_aggregator_base.py +69 -0
- multigait-0.2.0/multigait/aggregation/_generic_aggregator.py +462 -0
- multigait-0.2.0/multigait/aggregation/_lab_aggregator.py +335 -0
- multigait-0.2.0/multigait/data/__init__.py +0 -0
- multigait-0.2.0/multigait/data/base_data.py +86 -0
- multigait-0.2.0/multigait/data_loader/__init__.py +0 -0
- multigait-0.2.0/multigait/data_loader/cwa_data_loader.py +217 -0
- multigait-0.2.0/multigait/interpolation_ts/__init__.py +0 -0
- multigait-0.2.0/multigait/interpolation_ts/interpolation.py +229 -0
- multigait-0.2.0/multigait/pipeline/__init__.py +0 -0
- multigait-0.2.0/multigait/pipeline/iterator.py +590 -0
- multigait-0.2.0/multigait/pipeline/multimobility_pipeline.py +571 -0
- multigait-0.2.0/multigait/pipeline/pipeline_base.py +33 -0
- multigait-0.2.0/multigait/pipeline/utils/__init__.py +0 -0
- multigait-0.2.0/multigait/pipeline/utils/_operations.py +713 -0
- multigait-0.2.0/multigait/pipeline/utils/_stride_filtering.py +189 -0
- multigait-0.2.0/multigait/pipeline/utils/_thresholds.py +108 -0
- multigait-0.2.0/multigait/pipeline/utils/_var_dmos.py +187 -0
- multigait-0.2.0/multigait/pipeline/utils/_wb_assembly.py +430 -0
- multigait-0.2.0/multigait/pipeline/utils/_wb_criteria.py +210 -0
- multigait-0.2.0/multigait/pipeline/utils/alpha.py +63 -0
- multigait-0.2.0/multigait/pipeline/utils/datapoint_check.py +127 -0
- multigait-0.2.0/multigait/pipeline/utils/dmo_thresholds.csv +6 -0
- multigait-0.2.0/multigait/pipeline/utils/ic_to_stride.py +45 -0
- multigait-0.2.0/multigait/pipeline/wba_base.py +130 -0
- multigait-0.2.0/multigait/utils/__init__.py +0 -0
- multigait-0.2.0/multigait/utils/array.py +179 -0
- multigait-0.2.0/multigait/utils/data_conversions.py +61 -0
- multigait-0.2.0/multigait/utils/data_loader.py +30 -0
- multigait-0.2.0/multigait/utils/interp.py +185 -0
- multigait-0.2.0/multigait/utils/ploter.py +74 -0
- multigait-0.2.0/pyproject.toml +24 -0
multigait-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [2025] [Dr Dimitrios Megaritis]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
multigait-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: multigait
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: MultiGait: Real-World Gait Pipeline for Wrist-Worn Devices
|
|
5
|
+
License-File: LICENSE
|
|
6
|
+
Author: DMegaritis
|
|
7
|
+
Author-email: d.megaritis@northumbria.ac.uk
|
|
8
|
+
Requires-Python: >=3.9,<3.14
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Requires-Dist: matplotlib (>=3.7.2,<4)
|
|
16
|
+
Requires-Dist: mobgap (>=1.0.0,<2.0.0)
|
|
17
|
+
Requires-Dist: numpy (>=1.25.2)
|
|
18
|
+
Requires-Dist: pandas (>=2.2.0)
|
|
19
|
+
Requires-Dist: typing-extensions (>=4.15.0,<5.0.0)
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# MultiGait: Real-World Gait Pipeline for Wrist-Worn Devices
|
|
23
|
+
|
|
24
|
+
[](https://pypi.org/project/mgait/)
|
|
25
|
+
|
|
26
|
+
[](https://doi.org/10.5281/zenodo.17903929)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
MultiGait (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, stride-length estimation, cadence, and walking speed 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.
|
|
30
|
+
|
|
31
|
+
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.
|
|
32
|
+
|
|
33
|
+
Planned future releases include:
|
|
34
|
+
- Fully validated pipelines for different multimorbidity clusters.
|
|
35
|
+
- Novel algorithm implementations.
|
|
36
|
+
- Validated wear-time detection algorithms.
|
|
37
|
+
|
|
38
|
+
Note on biomechanical definitions
|
|
39
|
+
: The biomechanical logic and gait event definitions implemented in MultiGait are based on the specifications defined within Mobilise-D.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
Table of Contents
|
|
44
|
+
- [Installation](#installation)
|
|
45
|
+
- [Usage](#usage)
|
|
46
|
+
- [Pipeline Use](#pipeline-use)
|
|
47
|
+
- [Specific Algorithms](#specific-algorithms)
|
|
48
|
+
- [Citation](#citation)
|
|
49
|
+
- [Validation reference for the underlying algorithms](#validation-reference-for-the-underlying-algorithms)
|
|
50
|
+
- [Funding and Support](#funding-and-support)
|
|
51
|
+
- [License](#license)
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Installation
|
|
56
|
+
|
|
57
|
+
From PyPI (recommended)
|
|
58
|
+
```bash
|
|
59
|
+
python3 -m pip install multigait
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
From GitHub:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install git+https://github.com/DMegaritis/multigait.git
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Or clone the repository and install locally:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
git clone https://github.com/DMegaritis/multigait.git
|
|
72
|
+
cd multigait
|
|
73
|
+
pip install .
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Usage
|
|
79
|
+
|
|
80
|
+
The package is designed to be used in two main modes:
|
|
81
|
+
|
|
82
|
+
### Pipeline Use
|
|
83
|
+
|
|
84
|
+
High-level pipelines allow loading raw IMU data and obtaining gait outcomes end-to-end. Example:
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
from multigait.pipeline.multigait_pipeline import MultiGaitPipelineSuggested
|
|
88
|
+
|
|
89
|
+
pipeline = MultiGaitPipelineSuggested()
|
|
90
|
+
pipeline.safe_run(long_trial)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
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.
|
|
94
|
+
|
|
95
|
+
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.
|
|
96
|
+
|
|
97
|
+
### Specific Algorithms
|
|
98
|
+
|
|
99
|
+
You can also use individual algorithms separately to build custom workflows. Example modules include:
|
|
100
|
+
- Gait Sequence Detection (GSD)
|
|
101
|
+
- Initial Contact Detection (ICD)
|
|
102
|
+
- Stride Length Estimation (SL)
|
|
103
|
+
|
|
104
|
+
For usage examples and input/output formats, see the examples in this repository or in DMegaritis/multimobility_wrist.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Citation
|
|
109
|
+
|
|
110
|
+
If you use MultiGait in your research, please cite:
|
|
111
|
+
|
|
112
|
+
```bibtex
|
|
113
|
+
@software{megaritis2025wristmobility,
|
|
114
|
+
author = {Megaritis, Dimitrios and Alcock, Lisa and Scott, Kirsty and Hiden, Hugo and Cereatti, Andrea and Vogiatzis, Ioannis and Del Din, Silvia},
|
|
115
|
+
title = {MultiGait: Real-World Gait Pipeline for Wrist-Worn Devices for Multimorbid Populations},
|
|
116
|
+
year = {2025},
|
|
117
|
+
publisher = {Zenodo},
|
|
118
|
+
doi = {https://doi.org/10.5281/zenodo.17903930},
|
|
119
|
+
url = {https://zenodo.org/records/17903930}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Validation reference for the underlying algorithms
|
|
124
|
+
[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
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Funding and Support
|
|
129
|
+
|
|
130
|
+
This work was supported by the Medical Research Council (MRC) Gap Fund award (UKRI/MR/B000091/1).
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## License
|
|
135
|
+
|
|
136
|
+
The MultiGait 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.
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
<img width="200" height="200" alt="Northumbria_University_Logo" src="https://github.com/user-attachments/assets/4572c9f6-ad7e-4d8b-a398-5bae0547666f" />
|
|
140
|
+
<img width="200" height="200" alt="Medical_Research_Council_logo svg" src="https://github.com/user-attachments/assets/bba73ebd-3e0b-4831-b8c0-e5215c0fe14a" />
|
|
141
|
+
<img width="200" height="200" alt="newcastle-university-logo-png_seeklogo-355206" src="https://github.com/user-attachments/assets/e7a05ab0-6458-4c86-b5d0-723b76f8ac66" />
|
|
142
|
+
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# MultiGait: Real-World Gait Pipeline for Wrist-Worn Devices
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/mgait/)
|
|
4
|
+
|
|
5
|
+
[](https://doi.org/10.5281/zenodo.17903929)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
MultiGait (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, stride-length estimation, cadence, and walking speed 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.
|
|
9
|
+
|
|
10
|
+
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.
|
|
11
|
+
|
|
12
|
+
Planned future releases include:
|
|
13
|
+
- Fully validated pipelines for different multimorbidity clusters.
|
|
14
|
+
- Novel algorithm implementations.
|
|
15
|
+
- Validated wear-time detection algorithms.
|
|
16
|
+
|
|
17
|
+
Note on biomechanical definitions
|
|
18
|
+
: The biomechanical logic and gait event definitions implemented in MultiGait are based on the specifications defined within Mobilise-D.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
Table of Contents
|
|
23
|
+
- [Installation](#installation)
|
|
24
|
+
- [Usage](#usage)
|
|
25
|
+
- [Pipeline Use](#pipeline-use)
|
|
26
|
+
- [Specific Algorithms](#specific-algorithms)
|
|
27
|
+
- [Citation](#citation)
|
|
28
|
+
- [Validation reference for the underlying algorithms](#validation-reference-for-the-underlying-algorithms)
|
|
29
|
+
- [Funding and Support](#funding-and-support)
|
|
30
|
+
- [License](#license)
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
From PyPI (recommended)
|
|
37
|
+
```bash
|
|
38
|
+
python3 -m pip install multigait
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
From GitHub:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install git+https://github.com/DMegaritis/multigait.git
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Or clone the repository and install locally:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
git clone https://github.com/DMegaritis/multigait.git
|
|
51
|
+
cd multigait
|
|
52
|
+
pip install .
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Usage
|
|
58
|
+
|
|
59
|
+
The package is designed to be used in two main modes:
|
|
60
|
+
|
|
61
|
+
### Pipeline Use
|
|
62
|
+
|
|
63
|
+
High-level pipelines allow loading raw IMU data and obtaining gait outcomes end-to-end. Example:
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
from multigait.pipeline.multigait_pipeline import MultiGaitPipelineSuggested
|
|
67
|
+
|
|
68
|
+
pipeline = MultiGaitPipelineSuggested()
|
|
69
|
+
pipeline.safe_run(long_trial)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
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.
|
|
73
|
+
|
|
74
|
+
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.
|
|
75
|
+
|
|
76
|
+
### Specific Algorithms
|
|
77
|
+
|
|
78
|
+
You can also use individual algorithms separately to build custom workflows. Example modules include:
|
|
79
|
+
- Gait Sequence Detection (GSD)
|
|
80
|
+
- Initial Contact Detection (ICD)
|
|
81
|
+
- Stride Length Estimation (SL)
|
|
82
|
+
|
|
83
|
+
For usage examples and input/output formats, see the examples in this repository or in DMegaritis/multimobility_wrist.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Citation
|
|
88
|
+
|
|
89
|
+
If you use MultiGait in your research, please cite:
|
|
90
|
+
|
|
91
|
+
```bibtex
|
|
92
|
+
@software{megaritis2025wristmobility,
|
|
93
|
+
author = {Megaritis, Dimitrios and Alcock, Lisa and Scott, Kirsty and Hiden, Hugo and Cereatti, Andrea and Vogiatzis, Ioannis and Del Din, Silvia},
|
|
94
|
+
title = {MultiGait: Real-World Gait Pipeline for Wrist-Worn Devices for Multimorbid Populations},
|
|
95
|
+
year = {2025},
|
|
96
|
+
publisher = {Zenodo},
|
|
97
|
+
doi = {https://doi.org/10.5281/zenodo.17903930},
|
|
98
|
+
url = {https://zenodo.org/records/17903930}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Validation reference for the underlying algorithms
|
|
103
|
+
[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
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Funding and Support
|
|
108
|
+
|
|
109
|
+
This work was supported by the Medical Research Council (MRC) Gap Fund award (UKRI/MR/B000091/1).
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## License
|
|
114
|
+
|
|
115
|
+
The MultiGait 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.
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
<img width="200" height="200" alt="Northumbria_University_Logo" src="https://github.com/user-attachments/assets/4572c9f6-ad7e-4d8b-a398-5bae0547666f" />
|
|
119
|
+
<img width="200" height="200" alt="Medical_Research_Council_logo svg" src="https://github.com/user-attachments/assets/bba73ebd-3e0b-4831-b8c0-e5215c0fe14a" />
|
|
120
|
+
<img width="200" height="200" alt="newcastle-university-logo-png_seeklogo-355206" src="https://github.com/user-attachments/assets/e7a05ab0-6458-4c86-b5d0-723b76f8ac66" />
|
|
File without changes
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
import copy
|
|
3
|
+
|
|
4
|
+
import pandas as pd
|
|
5
|
+
from tpcp import Algorithm
|
|
6
|
+
from typing_extensions import Self, Unpack
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class BaseCadDetector(Algorithm):
|
|
10
|
+
"""Minimal standalone BaseCadDetector.
|
|
11
|
+
|
|
12
|
+
This base class mirrors the style of other small base classes in the codebase:
|
|
13
|
+
- Declares the action method name so tpcp-based code can call it generically.
|
|
14
|
+
- Documents expected attributes for implementers.
|
|
15
|
+
- Provides a clone() helper that returns a deep copy of the instance.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
_action_methods = ("calculate",)
|
|
19
|
+
|
|
20
|
+
# expected attributes for type checkers / docs
|
|
21
|
+
data: pd.DataFrame
|
|
22
|
+
sampling_rate_hz: float
|
|
23
|
+
initial_contacts: pd.DataFrame
|
|
24
|
+
cadence_per_sec_: pd.DataFrame
|
|
25
|
+
|
|
26
|
+
def calculate(
|
|
27
|
+
self,
|
|
28
|
+
data: pd.DataFrame,
|
|
29
|
+
*,
|
|
30
|
+
initial_contacts: pd.DataFrame,
|
|
31
|
+
sampling_rate_hz: float,
|
|
32
|
+
**kwargs: Unpack[dict[str, Any]],
|
|
33
|
+
) -> Self:
|
|
34
|
+
"""Implement in subclass."""
|
|
35
|
+
raise NotImplementedError
|
|
36
|
+
|
|
37
|
+
def clone(self) -> "BaseCadDetector":
|
|
38
|
+
"""Return a deep copy of this detector so callers can do clone().calculate(...)."""
|
|
39
|
+
return copy.deepcopy(self)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
__all__ = ["BaseCadDetector"]
|