Skip to main content

Python implementation of the Oxford Foot Model (OFM) gait analysis pipeline

Project description

openOFM

Code repository for the openOFM project. See the manuscript below for full mathematical details and further instructions:

Dixon, P. C., Drew, E. E., McBride, S. P., Harrington, M., Stebbins, J., & Zavatsky, A. B. (2025). OpenOFM: an open-source implementation of the multi-segment Oxford Foot Model. Computer Methods in Biomechanics and Biomedical Engineering, 1-14. https://doi.org/10.1080/10255842.2024.2448558

Running in Python

Environment setup

Python users must set up an appropriate environment to run openOFM. The following steps assume the user has installed the Anaconda or Mini- conda python distribution and has launched a terminal (Mac OS/Linux) or command prompt (PC). Similar commands can be run via Python IDEs.

  1. Create environment: conda create --name openOFM python=3.14 -y
  2. Activate environment: conda activate openOFM
  3. Change directory to python subdirectory of the openOFM repository: cd ...\openOFM\python
  4. Install packages: conda install --y --file requirements.txt
  5. If the ezc3d package does not install, add conda-forge to channels before trying step 4 again: conda config --add channels conda-forge

Running the openOFM Python scripts

Users may run the Python scripts using two main approaches. First, users may run the openOFM_static.py and openOFM_dynamic.py files directly (also used by Nexus). Running these files without any arguments will default to processing the data within the Data_Sample folder for version 1.0. Users may append additional flags to modify settings. For example, the following command allows users to process a static trial using version 1.1 and the subject parameters defined in a settings.yml file: python openOFM_static.py --version 1.1 --use_settings

When processing data through the openOFM static or openOFM dynamic pipelines, the following arguments can be used:

  1. version can be set to “1.0” or “1.1”.
  2. data_dir is the name of subject folder relative to the root
  3. file_name is the name of the .c3d to process
  4. use_settings controls whether to use the subject parameters and processing settings from a .c3d file or a settings.yml file defined by the user
  5. make_plot (openOFM_dynamic.py only). Allows users to generate a plot of results.

Options can be reviewed via the command: python openOFM_static.py --h and python openOFM_dynamic.py --h

Second, users may run the openOFM_sample_process.py. This approach may be more appropriate for users/developers wishing to integrate openOFM into their analysis or modify computations.

Validating the openOFM code

An additional openOFM_validate.py script compares openOFM python (version 1.0) and Vicon implementations using the sample data provided. Running this script will display OFM kinematics for both implementations.

Running in Matlab

Although officially unsupported, the openOFM is available for use in Matlab. The following steps assume Matlab is installed with a valid lincense:

  1. Download the openOFM repository to a location of your choice
  2. Change the working directory to the Matlab subfolder of the repository
  3. Add the Matlab folder and its subfolders to the Matlab path
  4. Run the openOFM process.m or openOFM_validate.m script

openOFM process.m

  1. Set the desired version ’1.0’ or ’1.1’ on line 8
  2. If anthropometric measures are missing from the .c3d files, set set- tings.manualAnthro (line 9) to True, and add the measure to section 2.2 (line 30)
  3. Select subject folder when prompted, for example MA 00 in folder Data Sample

Note, the openOFM_process.m should be modified for use with a user’s own data as it defaults to running version 1.1 on the Data_Sample participant with placeholder values in the settings.

Installing a dev environment

  • conda create -n openOFM-dev python=3.14
  • conda activate openOFM-dev
  • cd openOFM root folder of the repository
  • install the dev dependencies from the pyoproject.toml file: pip install -e ".[dev]"

Citation

If openOFM was useful to you, please cite our work: Dixon, P. C., Drew, E. E., McBride, S. P., Harrington, M., Stebbins, J., & Zavatsky, A. B. (2025). OpenOFM: an open-source implementation of the multi-segment Oxford Foot Model. Computer Methods in Biomechanics and Biomedical Engineering, 1-14. https://doi.org/10.1080/10255842.2024.2448558

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openofm-1.1.0.tar.gz (10.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openofm-1.1.0-py3-none-any.whl (49.5 kB view details)

Uploaded Python 3

File details

Details for the file openofm-1.1.0.tar.gz.

File metadata

  • Download URL: openofm-1.1.0.tar.gz
  • Upload date:
  • Size: 10.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for openofm-1.1.0.tar.gz
Algorithm Hash digest
SHA256 c6ba0bb3fde96273a5f1eed93ad0572fdf67e1ed7dbf02576fe9a241faebca88
MD5 187559b7d3b11e31bca9bc363633ad22
BLAKE2b-256 9a1c73658f408a77f4c018a1d7db404013e871d78ef73715bf1bac327d1c3b95

See more details on using hashes here.

File details

Details for the file openofm-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: openofm-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 49.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for openofm-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b25003103713072d2c900dc60b41d60488ef6bc4c66479862630d77ac47aa180
MD5 5906b5a100c81bb3c62528a6bf3c03c8
BLAKE2b-256 eed94cdbeb7490ea70dca98bb6c3a901add7b88baa2b2f261242a9b2ce7923b3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page