A collection of Python scripts to convert raw data collected from Theia into OpenSim models and simulations.
Install the following dependencies with your favorite package manager on your platform (Homebrew, apt-get, etc.):
- cmake
- autoconf
- automake
- pkg-config
- libtool
- openblas
- lapack
- freeglut
- doxygen
- pcre
- pcre2
- openssl
- gcc
Consult the OpenSim build scripts for platform-specific package installation commands.
Create a file named config.yaml in the root directory of the repository with the following fields:
original_data_path, data_path, python_root_dir. original_data_path is the location of the original
Theia sample data. data_path is the full path to a folder named data in the root directory of this repository. python_root_dir is a full path to a Python installation directory.
Here is an example:
original_data_path: '/Users/nbianco/Developer/sparc/Theia-OpenSim example data'
data_path: '/Users/nbianco/Developer/sparc/theia2opensim/data'
python_root_dir: '/Users/nbianco/miniconda3/envs/opensim_dev'
Make sure the Python version you install here (e.g., 3.11) matches the Python version you point to via python_root_dir in the config.yaml file.
conda create -n theia2opensim python=3.11 numpy
conda activate theia2opensim
pip install setuptools ezc3d pyyaml casadi
Run the following command from the root directory to build OpenSim and install it into your conda environment.
python install_opensim.py
Run the data conversion pipeline. This consists of four main steps: 1) data import, 2) generic model creation, 3) model scaling, and 4) inverse kinematics.
python main.py