opensim-creator
opensim-creator copied to clipboard
Add Modenese muscle parameter scaling tool
Suggested by @JuliaVanBeesel.
Warp-based model scaling involves:
- Spatially warping the model
- Scaling any non-spatial model parameters, such as muscle parameters, masses, etc.
This issue covers part of scaling-parameters-step. @modenaxe published one method for scaling muscle parameters, which is available here:
- SimTK: https://simtk.org/projects/opt_muscle_par/
- MATLAB/python source: https://github.com/modenaxe/MuscleParamOptimizer
- C++/plugin source: https://github.com/MuscleOptimizer/MuscleOptimizer
But the plugin only really works in OpenSim 3.3. This is problematic because OpenSim Creator, and the osim
files we're developing, are all made in OpenSim 4.x, which is incompatible with 3.3.
This ticket covers:
- Porting the core C++ muscle mapping code over to OpenSim 4.4
- Re-publishing the command-line client
optimizeMuscles.exe
, so that researchers can use it to scale OpenSim 4.4 models - Potentially porting the OpenSim 3.3 Java GUI plugin to OpenSim Creator - although this might end up being quite a bit more work and isn't entirely required
This is going to be non-trivial to do, because the source repo contains a mix of C++ for the algorithm and java for the UI.
The UI code probably can't be upgraded to OpenSim 4.4 trivially, and the C++ code is somewhat designed to be called from the GUI.
I'm working on a fork to essentially rip out everything non-essential and upgrade what's left to OpenSim 4.4 here:
- https://github.com/adamkewley/MuscleOptimizer
It might be that I can port the command-line client to OpenSim 4.4, but I'll need to review each "broken" (after upgrading to 4.4) line to ensure that the 4.4 equivalent doesn't behave too differently.
Hi @adamkewley, it might be helpful to know that for the MATLAB version of the tool, which I have used the most, there are two tests available for the code:
- mapping a model on itself: it should return the same musculotendon parameters (just a sanity check, really)
- the models from the original publication are used as test The MATLAB implementation on branch https://github.com/modenaxe/MuscleParamOptimizer/tree/updOS4 works on OpenSim 4.x, I haven't merged it yet as test 2) does not give exactly the same results and I haven't investigated if this is only due to OpenSim version changes.