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
Visualisation of musculotendon curves after appending parameters
- Nicos Haralabidis
- Posts: 196
- Joined: Tue Aug 16, 2016 1:46 am
- Thomas Uchida
- Posts: 1792
- Joined: Wed May 16, 2012 11:40 am
Re: Visualisation of musculotendon curves after appending parameters
You can use the printMuscleCurveToCSVFile() methods and plot in Excel or MATLAB. See, for example, https://simtk.org/api_docs/opensim/api_ ... 338abc6da9.
- Nicos Haralabidis
- Posts: 196
- Joined: Tue Aug 16, 2016 1:46 am
Re: Visualisation of musculotendon curves after appending parameters
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
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
The ActiveForceLengthCurve() class is only a method for the Millard2012 type muscles;
https://simtk.org/api_docs/opensim/api_ ... uscle.html
https://simtk.org/api_docs/opensim/api_ ... uscle.html
- Nicos Haralabidis
- Posts: 196
- Joined: Tue Aug 16, 2016 1:46 am
Re: Visualisation of musculotendon curves after appending parameters
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
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