Join members of the OpenSim Team on Wednesday July 26th for an introduction to OpenSim and new tools for rapidly developing musculoskeletal simulations.
...
Please follow the instructions below to prepare for the workshop. Note that there are separate software environments for each
Install Anaconda
Anaconda is a Python distribution that includes package and environment management. It is required for the OpenCap portion of the workshop. , and optional for the AddBiomechanics portion. If using Python for both, we will use Anaconda to create separate environments for the OpenCap and AddBiomechanics examples.
- Download and install Anaconda.
Part 1: OpenCap
1. Create account
...
The second demo of the OpenCap portion of the workshop may be completed in Windows, Mac, or Linux. It will require cloning/downloading the opencap-processing Github repository and setting up a Python environment using Anaconda. Follow the install instructions here or perform the following steps:
- Download and install Anaconda.
- Open the Anaconda Prompt (or, Powershell on Windows, Terminal on Mac, etc).
Create environment (python 3.9 recommended)
Code Block (base) C:\Users\me> conda create -n opencap-processing python=3.9
Activate environment
Code Block (base) C:\Users\me> conda activate opencap-processing
Install OpenSim within environment
Code Block (opencap-processing) C:\Users\me> conda install -c opensim-org opensim=4.4=py39np120
(Optional): Install an IDE such as Spyder
Code Block (opencap-processing) C:\Users\me> conda install spyder
- Clone/download the repository to your machine
- Using Git
Navigate to the directory where you want to download the code. For example:
Code Block (opencap-processing) C:\Users\me> cd Documents
Clone the repository
Code Block (opencap-processing) C:\Users\me\Documents> git clone https://github.com/stanfordnmbl/opencap-processing.git
- Without using Git
- Download the repository by visiting https://github.com/stanfordnmbl/opencap-processing/archive/refs/heads/main.zip
- Unzip the folder
- We will assume your PATH looks like C:\Users\me\Documents\opencap-processing and that the path to the README file is C:\Users\me\Documents\opencap-processing\README.md
- Using Git
- Install required Python packages
Navigate to the repository (make sure you are in Documents)
Code Block (opencap-processing) C:\Users\me\Documents> cd opencap-processing
Install packages
Code Block (opencap-processing) C:\Users\me\Documents\opencap-processing> python -m pip install -r requirements.txt
Create environment variable for authentication, you will be prompted to provide your OpenCap credentials. An environment variable (
.env
file) will be saved after authenticating.Code Block (opencap-processing) C:\Users\me\Documents\opencap-processing> python createAuthenticationEnvFile.py
Run example.py to verify that everything was correctly installed so far. If you get some plots popping out, then you can proceed to step 10.
Code Block (opencap-processing) C:\Users\me\Documents\opencap-processing> python createAuthenticationEnvFile.py
If you're a Mac user, you can stop here. If you're on Windows or Linux, you'll need this extra step. This part of the workshop will involve running dynamic simulations of walking using OpenSimAD, which is a custom version of OpenSim with support for Automatic Differentiation (AD). OpenSimAD requires a compiler, which is not installed by default on Windows, and the OpenBLAS libraries, which you need to manually install on Linux.
(Windows only): Install Visual Studio
The Community variant is sufficient and is free for everyone.
During the installation, select the workload Desktop Development with C++.
- The code was tested with the 2017, 2019, and 2022 Community editions.
(Linux only): Install OpenBLAS libraries
Code Block sudo apt-get install libopenblas-base
Run Examples/example_walking_opensimAD.py to verify that everything was correctly installed so far. If you see some IPOPT iterations, then you're all set. We'll go through the example during the workshop.
Code Block (opencap-processing) C:\Users\me\Documents\opencap-processing> cd Examples (opencap-processing) C:\Users\me\Documents\opencap-processing\Examples> example_walking_opensimAD.py
...
OpenSim with Python (Windows only)
...
- Open the Anaconda Prompt (or, Powershell on Windows, Terminal on Mac, etc).
If not using the Anaconda Prompt, you may need to initialize conda for shell interaction by running
Code Block > conda init <shell-name>
where <shell-name> is one of the following: cmd.exe (Windows default), bash (macOS default), powershell, fish, zsh, tcsh, xonsh.
Create a new conda environment for Python 3.10.
Code Block (base) C:\Users\me> conda create -n addbio-processing python=3.10 matplotlib
Activate the conda environment.
Code Block (base) C:\Users\me> conda activate tgcs2023
- If paths to previous OpenSim versions exist on your PYTHONPATH environment variable, remove them and restart the shell.
Install the OpenSim conda package. This installs a version of OpenSim including Moco that is compatible with Python 3.10 and includes NumPy 1.21.
Code Block (addbio-processing) C:\Users\me> conda install -c opensim-org opensim-moco=4.4.1=py310np121
Launch a Python interpreter from your conda environment.
Code Block (addbio-processing) C:\Users\me> python
Test the OpenSim configuration by checking the timestamp from running
Code Block >>> import opensim >>> opensim.GetVersionAndDate()
in the Python interpreter; the date should be in June 2023.
...
Visit the Moco website here.
Slides
TODO
Publications
Uhlrich SD, Falisse A, Kidzinski L, Muccini J, Ko M, Chaudhari AS, Hicks JL, Delp SL (2022) OpenCap: 3D human movement dynamics from smartphone videos. bioRxiv. https://doi.org/10.1101/2022.07.07.499061
View file name 2022.07.07.499061v1.full.pdf height 250
Werling K, Bianco NA, Raitor M, Stingel J, Hicks JL, Collins SH, Delp SL, Liu CK (2023) AddBiomechanics: Automating model scaling, inverse kinematics, and inverse dynamics from human motion data through sequential optimization. bioRxiv. https://doi.org/10.1101/2023.06.15.545116
View file | ||||
---|---|---|---|---|
|
Dembia CL, Bianco NA, Falisse A, Hicks JL, Delp SL (2020) OpenSim Moco: Musculoskeletal optimal control. PLoS Comput Biol 16(12): e1008493. https://doi.org/10.1371/journal.pcbi.1008493
View file | ||||
---|---|---|---|---|
|
...