modenaxe / muscleparamoptimizer Goto Github PK
View Code? Open in Web Editor NEWScripts and models to optimize musculotendon parameters in musculoskeletal models.
Home Page: https://simtk.org/projects/opt_muscle_par
License: Apache License 2.0
Scripts and models to optimize musculotendon parameters in musculoskeletal models.
Home Page: https://simtk.org/projects/opt_muscle_par
License: Apache License 2.0
Hi,
Thanks for providing this great toolbox. Given that this may take ~3 hours for every subject, I have a suggestion to reduce this time by 50%. I see that this function, sampleMuscleQuantities.m is the most time consuming one. Lots of users may use generic models as reference, e.g. modified Rajagopal model in my case. My suggestion is to store the sample muscle quantities of the reference model once forever and use it for each subject.
First, collate the sample quantities of all muscles into one struct using Mus_ref_all.(curr_mus_name) = sampleMuscleQuantities(osimModel_ref,curr_mus,'all',N_eval);
instaed of the following line of code and save the Mus_ref_all
variable as a MAT file. Then, load the file before the loop and use Mus_ref = Mus_ref_all.(curr_mus_name);
instead of:
Best - Mohammadreza
would be nice to have it.
It would be nice to have a pubs section on the readme (awesome-biomechanics style, maybe?):
What do you think @eravera ?
The second test does not seem to pass although the alterations introduced with the updates were minor and not muscle related.
Test 1 works, so joint identification should be correct.
Hi @eravera, apparently one of the packages in the python version has a vulnerability (see security tab of the repository).
Do you think it's ok to update lxml to:
lxml>=4.6.5
in the requirements?
Thanks for the tool! This optimizer has been great for my simulations. I've bumped into a rare bug that I thought I'd share: if you are using this tool on a model that has muscles whose origin and insertion points are on different branches of the model topology tree, the tool crashes.
I ran into this when scaling the Arnold2010 model which has an (inactive) "dummy muscle" representing the patellar tendon, but another common instance where this error would crop up is in models where the psoas inserts on the femur and originates on the torso.
The error occurs because of the way getJointsSpannedByMuscle()
seeks out the joints that a muscle spans. To do this, it starts at the body of the most distal PathPoint, then "climbs" the model topology tree going body-to-joint-to-body until it reaches the body with the most proximal PathPoint. This works fine for almost all cases, but if the origin point of a muscle is on a different branch of the topology tree, the function will never reach that body: it will just keep going, from femur to pelvis to ground and then crashing, since no joint exists above the ground. I can't think of any easy fixes, other than an exhaustive search of every branch of the model tree to find the right path from insertion to origin.
I've attached a zip file with a reproducible example showing a case with a simple model that works (psoas_r muscle goes from the femur to the pelvis) and a model that causes the crash (the same model but the psoas_r attaches on the torso). The figure below illustrates the difference between these models.
This is not a pressing issue for me—since I'm only using a dummy muscle to get the patellar tendon's line of action, I can just tweak the code to skip this muscle entirely. However other users might run into this same issue for full-body models incorporating a psoas muscle and possibly some other rare cases.
Hopefully this info proves useful!
Hi there,
Thank you for sharing your code. I am trying to run the tool using this model: https://simtk.org/frs/?group_id=1302
I am not able to optimise the gastroc, soleus and plantar flexors with the following error:
Do you know why this occurs?
Thanks
I think this would help maintaining the functionalities
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.