# msk_modelling_python (pre-release)
A Python package for musculoskeletal modelling.
**Author:** Basilio Goncalves, PhD, University of Vienna, 2024
---
## Pre-requisites for Installation
1. **Download a Code Interpreter**
I recommend [Visual Studio Code](https://code.visualstudio.com/download), but use your preferred one.
2. **Download and Install Python (>= 3.8)**
Make sure it is the correct bit version: [Python 3.8](https://www.python.org/downloads/release/python-380/)
3. **Download and Install OpenSim (suggest >=4.3)**
[OpenSim Downloads](https://simtk.org/frs/?group_id=91)
4. **Install Rapid Env Editor (optional)**
[Rapid Env Editor](https://www.rapidee.com/en/about)
5. **MOKKA (optional / only Windows users)**
[Open-source and cross-platform software to easily analyze biomechanical data](https://biomechanical-toolkit.github.io/mokka/)
---
## Pip installation (testing...)
```bash
pip install msk_modelling_python
```
## Test usage
``` python
import msk_modelling_python as msk
msk.greet()
```
## Work with the code
1. **Create a Virtual Environment**
```sh
python -m venv msk
```
Note: replace 'msk' if you want a different name
---
2. **Clone this Module "msk_modelling_python" to your virtual environment**
```
cd .\msk\Lib\site-packages
```
```
git clone https://github.com/basgoncalves/msk_modelling_python.git
```
*Note: Ensure the name of the package is exactly "msk_modelling_python"*
---
3. **Run OpenSim Setup from Installation Folder**
See [OpenSim Scripting in Python](https://simtk-confluence.stanford.edu:8443/display/OpenSim/Scripting+in+Python)
```sh
.\<myenv>\Scripts\activate
cd 'C:\OpenSim 4.5\sdk\Python'
python setup_win_python38.py
python -m pip install .
```
Note: run commands from shell or terminal
---
4. **Add the Path to the OpenSim Libraries to Your Environment Variables**
Add the following paths to your `PATH` variable:
```
C:\OpenSim 4.5\bin
C:\OpenSim 4.5\lib
```
Note: see for help https://answers.microsoft.com/en-us/windows/forum/all/change-system-variables-on-windows-11/f172c29e-fd9e-4f0b-949d-c4696bd656b8
---
5. **Verify the OpenSim Installation (in python)**
```python
import opensim as osim
model = osim.Model()
print("OpenSim model created successfully!")
```
---
6. **Install requirements (in the terminal)**
```powershell
cd .\<myenv>\Lib\site-packages\msk_modelling_python
pip install -r requirements.txt
```
---
7. **Testing msk_modelling_python (in python)**
```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
---
8. **Basic Usage**
```python
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
```
---
9. **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](https://simtk.org/projects/bops/)
## Tools to be Included:
- **BTK**
[BTK Documentation](https://biomechanical-toolkit.github.io/docs/Wrapping/Python/_getting_started.html)
- **c3dServer**
[c3dServer](https://www.c3dserver.com/)
- **OpenSim**
[OpenSim Scripting in Python](https://simtk-confluence.stanford.edu:8443/display/OpenSim/Scripting+in+Python)
- **3D Slicer**
[3D Slicer](https://www.slicer.org/)
- **FEbioStudio**
[FEbioStudio](https://febio.org/)
- **MeshLab 2023.12**
[MeshLab](https://www.meshlab.net/)
---
## Code Structure
1. **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.
2. **bops**
Batch Opensim Processing Software
Package with functions and classes to use Opensim, CEINMS, stats, and others for easier processing.
3. **ui**
Functions to create user interface.
4. **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](https://www.researchgate.net/profile/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.2
Raw data
{
"_id": null,
"home_page": "https://github.com/your_username/msk_modelling_python",
"name": "msk-modelling-python",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Bas",
"author_email": "basilio.goncalves7@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/fa/91/65f5d564dbcd59d3a4ea66a8a576343f2c18dfa00dd1285b0e4c7e876970/msk_modelling_python-0.0.2.tar.gz",
"platform": null,
"description": "# msk_modelling_python (pre-release)\r\n\r\nA Python package for musculoskeletal modelling.\r\n\r\n**Author:** Basilio Goncalves, PhD, University of Vienna, 2024\r\n\r\n---\r\n\r\n## Pre-requisites for Installation\r\n\r\n1. **Download a Code Interpreter** \r\n I recommend [Visual Studio Code](https://code.visualstudio.com/download), but use your preferred one.\r\n\r\n2. **Download and Install Python (>= 3.8)** \r\n Make sure it is the correct bit version: [Python 3.8](https://www.python.org/downloads/release/python-380/)\r\n\r\n3. **Download and Install OpenSim (suggest >=4.3)** \r\n [OpenSim Downloads](https://simtk.org/frs/?group_id=91)\r\n\r\n4. **Install Rapid Env Editor (optional)** \r\n [Rapid Env Editor](https://www.rapidee.com/en/about)\r\n\r\n5. **MOKKA (optional / only Windows users)**\r\n [Open-source and cross-platform software to easily analyze biomechanical data](https://biomechanical-toolkit.github.io/mokka/)\r\n---\r\n\r\n## Pip installation (testing...)\r\n\r\n```bash\r\npip install msk_modelling_python\r\n\r\n```\r\n\r\n## Test usage\r\n``` python\r\nimport msk_modelling_python as msk\r\n\r\nmsk.greet()\r\n```\r\n\r\n## Work with the code \r\n\r\n1. **Create a Virtual Environment**\r\n ```sh\r\n python -m venv msk\r\n ```\r\n Note: replace 'msk' if you want a different name\r\n---\r\n2. **Clone this Module \"msk_modelling_python\" to your virtual environment**\r\n ```\r\n cd .\\msk\\Lib\\site-packages\r\n ```\r\n ```\r\n git clone https://github.com/basgoncalves/msk_modelling_python.git\r\n ```\r\n *Note: Ensure the name of the package is exactly \"msk_modelling_python\"*\r\n---\r\n\r\n3. **Run OpenSim Setup from Installation Folder** \r\n See [OpenSim Scripting in Python](https://simtk-confluence.stanford.edu:8443/display/OpenSim/Scripting+in+Python)\r\n ```sh\r\n .\\<myenv>\\Scripts\\activate\r\n cd 'C:\\OpenSim 4.5\\sdk\\Python'\r\n python setup_win_python38.py\r\n python -m pip install .\r\n ```\r\n Note: run commands from shell or terminal \r\n---\r\n\r\n4. **Add the Path to the OpenSim Libraries to Your Environment Variables** \r\n Add the following paths to your `PATH` variable:\r\n ```\r\n C:\\OpenSim 4.5\\bin\r\n C:\\OpenSim 4.5\\lib\r\n ```\r\n Note: see for help https://answers.microsoft.com/en-us/windows/forum/all/change-system-variables-on-windows-11/f172c29e-fd9e-4f0b-949d-c4696bd656b8\r\n---\r\n5. **Verify the OpenSim Installation (in python)**\r\n ```python\r\n import opensim as osim\r\n model = osim.Model()\r\n print(\"OpenSim model created successfully!\")\r\n ```\r\n---\r\n6. **Install requirements (in the terminal)**\r\n ```powershell\r\n cd .\\<myenv>\\Lib\\site-packages\\msk_modelling_python\r\n pip install -r requirements.txt\r\n ```\r\n---\r\n7. **Testing msk_modelling_python (in python)**\r\n ```python\r\n import msk_modelling_python as msk\r\n msk.run_bops()\r\n ```\r\n Note: to change the performance of msk.run_bops() edit the settings file in .\\msk_modelling_python\\src\\bops\\settings.json\r\n---\r\n8. **Basic Usage**\r\n ```python\r\n import msk_modelling_python as msk\r\n\r\n # test msk\r\n msk.bops.Platypus().happy()\r\n\r\n # export c3d\r\n c3d_file_path = r'path\\to\\your\\file.c3d'\r\n msk.bops.export_c3d(c3d_file_path)\r\n\r\n # run IK\r\n trial = msk.Project\r\n ```\r\n---\r\n9. **Use Example Scripts**\r\n Use example scripts in the \"ExampleScripts\" directory to get started with common tasks and workflows.\r\n\r\n---\r\n\r\nThis 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](https://simtk.org/projects/bops/)\r\n\r\n## Tools to be Included:\r\n- **BTK** \r\n [BTK Documentation](https://biomechanical-toolkit.github.io/docs/Wrapping/Python/_getting_started.html)\r\n- **c3dServer** \r\n [c3dServer](https://www.c3dserver.com/)\r\n- **OpenSim** \r\n [OpenSim Scripting in Python](https://simtk-confluence.stanford.edu:8443/display/OpenSim/Scripting+in+Python)\r\n- **3D Slicer** \r\n [3D Slicer](https://www.slicer.org/)\r\n- **FEbioStudio** \r\n [FEbioStudio](https://febio.org/)\r\n- **MeshLab 2023.12** \r\n [MeshLab](https://www.meshlab.net/)\r\n\r\n---\r\n\r\n## Code Structure\r\n\r\n1. **msk_modelling_python**\r\n 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.\r\n\r\n2. **bops**\r\n Batch Opensim Processing Software \r\n Package with functions and classes to use Opensim, CEINMS, stats, and others for easier processing.\r\n\r\n3. **ui**\r\n Functions to create user interface.\r\n\r\n4. **osim commands**\r\n---\r\n\r\n## Examples\r\n\r\nFind examples under \".\\example_data\\example_modules\".\r\n\r\n---\r\n\r\n## Contact\r\n\r\nFor any questions or inquiries, please contact:\r\n\r\n- **Name:** Basilio Goncalves\r\n- **Email:** basilio.goncalves@univie.ac.at\r\n- **ResearchGate:** [Basilio Goncalves](https://www.researchgate.net/profile/Basilio-Goncalves)\r\n\r\n## References\r\n\r\nThelen, D. G. -2003- J. Biomech. Eng. 125, 70\u201377\r\n\r\nLloyd, D. G. et al. -2003- J. Biomech. 36, 765\u2013776\r\n\r\nDelp, S. L. et al. -2007- IEEE Trans. Biomed. Eng. 54, 1940\u20131950\r\n\r\nPizzolato, C. et al. -2015- J. Biomech. 48, 3929\u20133936\r\n\r\nHicks, J. L. et al. -2015- J. Biomech. Eng. 137,\r\n\r\nRajagopal, A. et al. -2016- IEEE Trans. Biomed. Eng. 63, 2068\u20132079\r\n\r\nGoncalves, B. A. M. et al. -2023- Gait Posture 106, S68\r\n\r\nGoncalves, B. A. M. et al. -2024- Med. Sci. Sport. Exerc. 56, 402\u2013410\r\n\r\n## Version updates 0.3.0\r\n\r\n- fix import bops\r\n- testing the inclusion of opensim (v.4.5)\r\n- classes should be working\r\n\r\n\r\n\r\nVersion: 0.0.2\r\n\r\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python package for musculoskeletal modelling (version 0.0.2)",
"version": "0.0.2",
"project_urls": {
"Homepage": "https://github.com/your_username/msk_modelling_python"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "fd81a8540d404ae966a1e1e2bd0b3a9018afe4d98e2297e773a8695de01f14e6",
"md5": "a55686b0879e8d0b1cfa9e58dfb83bcc",
"sha256": "511599f307a42557b8c96d04bbbc9aa820df1cef4325d20d226dfe930a9766fd"
},
"downloads": -1,
"filename": "msk_modelling_python-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a55686b0879e8d0b1cfa9e58dfb83bcc",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 25906,
"upload_time": "2025-04-14T20:13:09",
"upload_time_iso_8601": "2025-04-14T20:13:09.561692Z",
"url": "https://files.pythonhosted.org/packages/fd/81/a8540d404ae966a1e1e2bd0b3a9018afe4d98e2297e773a8695de01f14e6/msk_modelling_python-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "fa9165f5d564dbcd59d3a4ea66a8a576343f2c18dfa00dd1285b0e4c7e876970",
"md5": "406f539e0b14b918dc92f1a9008bfa04",
"sha256": "518b68d64736763160b4b156656ffa4472c7324aab9660e35e96693cccc4f338"
},
"downloads": -1,
"filename": "msk_modelling_python-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "406f539e0b14b918dc92f1a9008bfa04",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 27213,
"upload_time": "2025-04-14T20:13:10",
"upload_time_iso_8601": "2025-04-14T20:13:10.899189Z",
"url": "https://files.pythonhosted.org/packages/fa/91/65f5d564dbcd59d3a4ea66a8a576343f2c18dfa00dd1285b0e4c7e876970/msk_modelling_python-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-04-14 20:13:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "your_username",
"github_project": "msk_modelling_python",
"github_not_found": true,
"lcname": "msk-modelling-python"
}