A Python package for musculoskeletal modelling (version 0.0.16)
Project description
msk_modelling_python (pre-release)
A Python package for musculoskeletal modelling.
Author: Basilio Goncalves, PhD, University of Vienna, 2024
Pre-requisites for Installation
-
Download a Code Interpreter
I recommend Visual Studio Code, but use your preferred one. -
Download and Install Python (>= 3.8)
Make sure it is the correct bit version: Python 3.8 -
Download and Install OpenSim (suggest >=4.3)
OpenSim Downloads -
Install Rapid Env Editor (optional)
Rapid Env Editor -
MOKKA (optional / only Windows users) Open-source and cross-platform software to easily analyze biomechanical data
Pip installation
Create a Virtual Environment**
python -m venv msk
Note: replace 'msk' if you want a different name
Install uv package manager
pip install uv
Install msk-modelling-python
uv pip install msk-modelling-python
Test usage
import msk_modelling_python as msk
msk.bops.greet()
Install opensim
import msk_modelling_python as msk
msk.install_opensim.run()
Work with the code
- Activate your virtual enviroment (assume name 'msk')
.\msk\Scripts\activate
- Clone this Module "msk_modelling_python" to your virtual environment
cd .\msk\Lib\site-packages
Note: Ensure the name of the package is exactly "msk_modelling_python"git clone https://github.com/basgoncalves/msk_modelling_python.git
- Run OpenSim Setup from Installation Folder
See OpenSim Scripting in Python.\msk\Scripts\activate
cd 'C:\OpenSim 4.5\sdk\Python'
python setup_win_python38.pypython -m pip install .
Note: run commands from shell or terminal
- Add the Path to the OpenSim Libraries to Your Environment Variables
Add the following paths to yourPATHvariable:
Note: see for help https://answers.microsoft.com/en-us/windows/forum/all/change-system-variables-on-windows-11/f172c29e-fd9e-4f0b-949d-c4696bd656b8C:\OpenSim 4.5\bin C:\OpenSim 4.5\lib
- Verify the OpenSim Installation.
python
import opensim as osim model = osim.Model()
- Install requirements (in the terminal)
cd .\msk\Lib\site-packages\msk_modelling_python pip install -r requirements.txt
- Testing msk_modelling_python (in python)
import msk_modelling_python as msk msk.run_bops()
Note: to change the performance of msk.run_bops() edit the settings file in .\msk_modelling_python\src\bops\settings.json
- Basic Usage
import msk_modelling_python as msk # test msk msk.bops.Platypus().happy() # export c3d c3d_file_path = r'path\to\your\file.c3d' msk.bops.export_c3d(c3d_file_path) # run IK trial = msk.Project
- Use Example Scripts Use example scripts in the "ExampleScripts" directory to get started with common tasks and workflows.
This package includes a combination of other packages and custom functions to manipulate and analyze biomechanical data. Inspired by the MATLAB version of BOPS (Batch OpenSim Processing Scripts) - BOPS
Tools to be Included:
- BTK
BTK Documentation - c3dServer
c3dServer - OpenSim
OpenSim Scripting in Python - 3D Slicer
3D Slicer - FEbioStudio
FEbioStudio - MeshLab 2023.12
MeshLab
Code Structure
-
msk_modelling_python This is the main package including all the modules needed for msk modelling, stats, data_processing, etc. This package contains subpackages that can be used independently.
-
bops Batch Opensim Processing Software
Package with functions and classes to use Opensim, CEINMS, stats, and others for easier processing. -
ui Functions to create user interface.
-
osim commands
Examples
Find examples under ".\example_data\example_modules".
Contact
For any questions or inquiries, please contact:
- Name: Basilio Goncalves
- Email: basilio.goncalves@univie.ac.at
- ResearchGate: Basilio Goncalves
References
Thelen, D. G. -2003- J. Biomech. Eng. 125, 70–77
Lloyd, D. G. et al. -2003- J. Biomech. 36, 765–776
Delp, S. L. et al. -2007- IEEE Trans. Biomed. Eng. 54, 1940–1950
Pizzolato, C. et al. -2015- J. Biomech. 48, 3929–3936
Hicks, J. L. et al. -2015- J. Biomech. Eng. 137,
Rajagopal, A. et al. -2016- IEEE Trans. Biomed. Eng. 63, 2068–2079
Goncalves, B. A. M. et al. -2023- Gait Posture 106, S68
Goncalves, B. A. M. et al. -2024- Med. Sci. Sport. Exerc. 56, 402–410
Version updates 0.3.0
- fix import bops
- testing the inclusion of opensim (v.4.5)
- classes should be working
Version: 0.0.16
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file msk_modelling_python-0.0.16.tar.gz.
File metadata
- Download URL: msk_modelling_python-0.0.16.tar.gz
- Upload date:
- Size: 42.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef287dde3da9440fad5f27ba2fcdd26240d0e60658da6945c4dd4919a117ef74
|
|
| MD5 |
9264a076df7a7bbfc29d5e3837420b9d
|
|
| BLAKE2b-256 |
3713cfa67aba99368b5fb9d0c82386dfc6539cbda5a0b9813865f3061f2c9571
|
File details
Details for the file msk_modelling_python-0.0.16-py3-none-any.whl.
File metadata
- Download URL: msk_modelling_python-0.0.16-py3-none-any.whl
- Upload date:
- Size: 42.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e98ac7f81a22e3398c3f375257f4a614d94bb541255587e9a9cd1b05c8c12791
|
|
| MD5 |
e741d78da5dd2912cae292869a0eccc5
|
|
| BLAKE2b-256 |
533e76d9fcb3e3f8972da7dd32b94185b47a4f00f59ad109b18fad0917355829
|