GaitPy
GaitPy: An Open-Source Python Package for Gait Analysis Using an Accelerometer on the Lower Back - Published in JOSS (2019)
Science Score: 93.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 1 DOI reference(s) in JOSS metadata -
✓Academic publication links
Links to: joss.theoj.org -
○Committers with academic emails
-
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Scientific Fields
Repository
Basic Info
- Host: GitHub
- Owner: matt002
- License: mit
- Language: HTML
- Default Branch: master
- Size: 11.1 MB
Statistics
- Stars: 39
- Watchers: 3
- Forks: 22
- Open Issues: 13
- Releases: 0
Metadata Files
README.md
GaitPy
Read and process raw vertical accelerometry data from a sensor on the lower back during gait; calculate clinical gait characteristics.
Disclaimer
This package is not maintained anymore. I would recommend using Scikit Digital Health, a python package that includes a newer version GaitPy and various other sensor processing modules (https://github.com/PfizerRD/scikit-digital-health).
Overview
GaitPy provides python functions to read accelerometry data from a single lumbar-mounted sensor and estimate clinical characteristics of gait.
- Device location: lower back/lumbar
- Sensing modality: Accelerometer
- Sensor data: Vertical acceleration
- Minimum sampling rate: 50Hz
Installation
GaitPy is compatible with python v3.6 on MacOSX, Windows, and Linux and is available through Anaconda.
Installation via Anaconda (recommended):
Once you have Anaconda installed, open a terminal window and create a new environment using the following command.
sh
conda create --name my_env python=3.6
Then, activate your environment using the following command for Mac and Linux.
sh
source activate my_env
For Windows use the following.
sh
activate my_env
Lastly, to install GaitPy, use the following command.
sh
conda install gaitpy
Alternatively, you can install via pip:
sh
pip install gaitpy
You can also install GaitPy from source:
sh
git clone https://github.com/matt002/gaitpy
cd ~/gaitpy
python setup.py install
Basic usage
GaitPy consists of the following 3 functions: 1. classifybouts: If your data consists of gait and non-gait data, run the classifybouts function to first classify bouts of gait. If your data is solely during gait, this function is not necessary to use. 2. extractfeatures: Extract initial contact (IC) and final contact (FC) events from your data and estimate various temporal and spatial gait features. 3. plotcontacts: Plot the resulting bout detections and IC/FC events alongside your raw accelerometer signal.
GaitPy accepts a csv file or pandas dataframe that includes a column containing unix timestamps and a column containing
vertical acceleration from a lumbar-mounted sensor. GaitPy makes three assumptions by default:
1. Timestamps and vertical acceleration columns are labeled 'timestamps' and 'y' respectively, however
this can be changed using the 'vacccolname' and 'tscolname' arguments respectively.
2. Timestamps are in Unix milliseconds and data is in meters per second squared, however this can be be changed
using the 'tsunits' and 'vaccunits' arguments respectively.
3. Baseline vertical acceleration data is -9.8m/s^2 or -1g. If your baseline data is +9.8m/s^2 or +1g, set the 'flip'
argument to True.
Additionally, the sample rate of your device (at least 50Hz) and height of the subject must be provided.
More details about the inputs and ouputs of each of these functions can be found in the documentation and Czech et al. 2019.
```sh from gaitpy.gait import Gaitpy
rawdata = 'raw-data-path or pandas dataframe' samplerate = 128 # hertz subject_height = 170 # centimeters
Create an instance of Gaitpy
gaitpy = Gaitpy(rawdata, # Raw data consisting of vertical acceleration from lumbar location and unix timestamps samplerate, # Sample rate of raw data (in Hertz) vacccolname='y', # Vertical acceleration column name tscolname='timestamps', # Timestamp column name vaccunits='m/s^2', # Units of vertical acceleration tsunits='ms', # Units of timestamps flip=False) # If baseline data is at +1g or +9.8m/s^2, set flip=True
Classify bouts of gait - Optional (use if your data consists of gait and non-gait periods)
gaitbouts = gaitpy.classifybouts(resultfile='/my/folder/classifiedgait.h5') # File to save results to (None by default)
Extract gait characteristics
gaitfeatures = gaitpy.extractfeatures(subjectheight, # Subject height subjectheightunits='centimeter', # Units of subject height resultfile='/my/folder/gaitfeatures.csv', # File to save results to (None by default) classifiedgait=gaitbouts) # Pandas Dataframe or .h5 file results of classifybouts function (None by default)
Plot results of gait feature extraction
gaitpy.plotcontacts(gaitfeatures, # Pandas Dataframe or .csv file results of extractfeatures function resultfile='/my/folder/plotcontacts.html)', # File to save results to (None by default) showplot=True) # Specify whether to display plot upon completion (True by default)
```
Running the demo
The demo file provided lets you to test whether GaitPy outputs the expected results on your system.
You may run the demo directly from a terminal window:
sh
cd gaitpy/demo
python demo.py
You may also run the demo via a python interpreter. In a terminal window start python by typing:
sh
python
In the interpreter window you can then import and run the demo with the following two commands:
sh
from gaitpy.demo import demo
demo.run_demo()
The demo script will prompt you to type in a results directory. Following the run, results will be saved in the provided results directory (less than 250kB of data will be saved). Running the demo should take less than a minute, though this may vary depending on your machine.
Contributing to the project
Please help contribute to the project! See the CONTRIBUTING.md file for details.
Acknowledgements
The Digital Medicine & Translational Imaging group at Pfizer, Inc supported the development of this package.
Author
Matthew Czech
License
GaitPy is under the MIT license
Owner
- Name: Matt
- Login: matt002
- Kind: user
- Repositories: 1
- Profile: https://github.com/matt002
JOSS Publication
GaitPy: An Open-Source Python Package for Gait Analysis Using an Accelerometer on the Lower Back
Tags
GaitPy Accelerometer Actigraphy Algorithms Lumbar Gait Digital Medicine Wearable SensorsGitHub Events
Total
- Watch event: 1
Last Year
- Watch event: 1
Committers
Last synced: 5 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Matt-pfz | M****h@p****m | 44 |
| Matt | c****7@g****m | 27 |
| Peter Megyesi | p****i@i****g | 4 |
| Arfon Smith | a****n | 3 |
| Henrik Finsberg | h****f@s****o | 1 |
| Abhishektha Boppana | a****a@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 25
- Total pull requests: 13
- Average time to close issues: 21 days
- Average time to close pull requests: 10 days
- Total issue authors: 13
- Total pull request authors: 7
- Average comments per issue: 2.24
- Average comments per pull request: 0.08
- Merged pull requests: 12
- Bot issues: 0
- Bot pull requests: 1
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- finsberg (8)
- ezeid (4)
- abhishektha (3)
- frsnjung (1)
- nie911 (1)
- gupta-divy (1)
- Nadano (1)
- IRuotsa (1)
- gcosne (1)
- AKuederle (1)
- albertmartga (1)
- joergheintz (1)
- aravishdatabricks (1)
Pull Request Authors
- matt002 (5)
- arfon (3)
- dependabot[bot] (2)
- finsberg (1)
- Matt-pfz (1)
- abhishektha (1)
- ezmegy (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- pypi 68 last-month
-
Total dependent packages: 0
(may contain duplicates) -
Total dependent repositories: 1
(may contain duplicates) - Total versions: 16
- Total maintainers: 1
pypi.org: gaitpy
Read and process raw vertical accelerometry data from a lumbar sensor during gait; calculate clinical gait characteristics.
- Homepage: http://github.com/matt002/gaitpy
- Documentation: https://gaitpy.readthedocs.io/
- License: MIT
-
Latest release: 1.6.1
published almost 6 years ago
Rankings
Maintainers (1)
conda-forge.org: gaitpy
GaitPy provides python functions to read accelerometry data from a single lumbar-mounted sensor and estimate clinical characteristics of gait. GaitPy has been tested using python v3.6.
- Homepage: https://github.com/matt002/GaitPy
- License: MIT
-
Latest release: 1.6.1
published almost 6 years ago
Rankings
Dependencies
- PyWavelets >=0.5.2
- bokeh >=0.12.10
- deepdish >=0.3.4
- dill >=0.2.7.1
- numpy >=1.13.3
- pandas >=0.20.3
- scikit-learn ==0.21.3
- scipy >=1.2.0
- statsmodels >=0.8.0
