Page 1 of 1

Visualisation of musculotendon curves after appending parameters

Posted: Fri Jun 22, 2018 4:25 am
by nicos1993
Dear users,

I am wondering whether it is possible to plot the musculotendon curves in the GUI (as done here: https://simtk-confluence.stanford.edu/d ... don+Curves) and whether it is then possible to inspect these curves following any modifications to their underlying parameters?

Kind regards,

Nicos Haralabidis

Re: Visualisation of musculotendon curves after appending parameters

Posted: Fri Jun 22, 2018 8:39 am
by tkuchida
You can use the printMuscleCurveToCSVFile() methods and plot in Excel or MATLAB. See, for example, https://simtk.org/api_docs/opensim/api_ ... 338abc6da9.

Re: Visualisation of musculotendon curves after appending parameters

Posted: Fri Jun 22, 2018 11:34 am
by nicos1993
Thanks for the prompt reply Tom.

I have had a chance to look at the source you provided. I am attempting to access the class through the Matlab API.

Do I need to down cast the properties of a particular muscle, e.g. glut_med1_r, by implementing:
ActiveForceLengthCurve.safeDownCast(osimModel.getMuscles().get(0))

Then followed by ActiveForceLength.printMuscleCurveToCSVFile() ?

Kind regards,

Nicos Haralabidis

Re: Visualisation of musculotendon curves after appending parameters

Posted: Fri Jun 22, 2018 2:36 pm
by jimmy
The ActiveForceLengthCurve() class is only a method for the Millard2012 type muscles;
https://simtk.org/api_docs/opensim/api_ ... uscle.html

Re: Visualisation of musculotendon curves after appending parameters

Posted: Sat Jun 23, 2018 12:36 am
by nicos1993
Good morning James,

Thanks for your reply! I have managed to successfully implement the method.

For anyone else interested in visualising the musculotendon curves this is the rough code I used for Matlab:

import org.opensim.modeling.*

osimModel = Model('LaiArnold2017_refined_arms.osim');
model_muscles = osimModel.getMuscles();
muscle = model_muscles.get(0);
muscle_millard = Millard2012EquilibriumMuscle.safeDownCast(muscle);

muscle_millard.getActiveForceLengthCurve().printMuscleCurveToCSVFile('folder/folder');

The same can be done for the ForceVelocityCurve, FiberForceLengthCurve and TendonForceLengthCurve.

Nicos