Page 1 of 1
Analyze MuscleAnalysis outputs different to plotter
Posted: Tue Feb 06, 2024 6:56 am
by emmaj285
Hi,
I am using the osim model gait2392_AlteredPelvisFrame3DoFkneeNoTorso.osim to process retrospective clinical gait data (Vicon PiG) from our gait lab. Following scaling, I have run the Inverse Kinematic tool using converted marker data from a trial as an input. The intention is to output key muscles normalized muscle-tendon lengths and velocities. I can see sensible data in the plotter when I plot normalized fiber length v time, however if I try to use 'MuscleAnalysis' in the Analyze function, the data output in the .sto files is different to what is available in the plotter; the normalized fiber-length and velocities are not changing over time. Has anyone else come across this issue and could point me in the direction of where i'm going wrong?
Thanks,
Emma
Re: Analyze MuscleAnalysis outputs different to plotter
Posted: Wed Feb 07, 2024 1:35 am
by kernalnet
Hi, Plotter basically plots muscle quantities with respect to coordinates range of motion not time, i.e., it doesn't take IK output into account; please see:
https://simtk-confluence.stanford.edu:8 ... t-inCurves. Unless you load the outputs of MuscleAnalysis; then, you can plot the quantities vs time.
If you select the IK output as motion file in the Analyze tool with MuscleAnalysis [nothing else is required], you will be able to get muscle quantities at each time frame. Please see:
https://simtk-confluence.stanford.edu:8 ... he%20input
Hope this helps.
Re: Analyze MuscleAnalysis outputs different to plotter
Posted: Fri Feb 09, 2024 3:01 am
by emmaj285
Thank you for your reply.
I have been plotting Normalized fiber length v IK results in the plotter - and this appears to show the outputs v time (the outputs from the IK e.g. pelvic tilt when plotted against time are exactly the same when plotted against IK results).
I have been using the same IK results as the motion file in the Analyze tool, and selecting the MuscleAnalysis, however the values in the resulting MuscleAnalysisNormalizedFiberLength.sto file do not vary with time. I can't understand this as there are clearly outputs in the plotter.
Could anyone advise what could be happening?
Many thanks!
Emma
Re: Analyze MuscleAnalysis outputs different to plotter
Posted: Fri Feb 09, 2024 3:06 am
by emmaj285
I've attached the files i'm using in-case this is any help!
Re: Analyze MuscleAnalysis outputs different to plotter
Posted: Fri Feb 09, 2024 3:35 am
by kernalnet
Make sure that "Solve for equilibrium for actuator states" is checked in Analyze tool and let me know how it works.
Re: Analyze MuscleAnalysis outputs different to plotter
Posted: Fri Feb 09, 2024 4:14 am
by emmaj285
Thank you! With "Solve for equilibrium for actuator states" selected I get outputs that vary in time from in the output Normalizedfiberlength.sto file.
I note in the messages view there are some errors (see below), which I presume reduce the confidence I should have with the outputs produced. I'm unsure of the implications on the normalized muscle fiber length and velocity outputs however - as these are the only outputs i'm using.
In Object 'bifemlh_l' of type Thelen2003Muscle.
Thrown at Thelen2003Muscle.cpp:376 in computeInitialFiberEquilibrium()..
AnalyzeTool::run() unable to equilibrate muscles at time = 0.64. Reason: Model::equilibrateMuscles() Unable to compute equilibrium for this muscle.
Please verify that the initial activation is valid and that the length of the musculotendon actuator doesn't produce a pennation angle of 90 degrees or a negative fiber length.
Solution error 0.808376 exceeds tolerance of 5.12e-06
Newton iterations reached limit of 20
Activation is 0.05
Fiber length is nan
Re: Analyze MuscleAnalysis outputs different to plotter
Posted: Sat Feb 10, 2024 12:11 am
by kernalnet
One potential reason could be the muscle model, I suggest substituting
Thelen2003Muscle with
Millard2012EquilibriumMuscle. More info can be found here:
https://simtk-confluence.stanford.edu:8 ... blications.
Simply open your generic model with a text editor, e.g. npp or vscode, and replace the texts; then update the model using either [Tools > Convert Files...] or [open and save].
This model in the OpenSim installation directory has better muscles paths [OpenSim-4.5-win64\Resources.zip\Models\Rajagopal\RajagopalLaiUhlrich2023.osim]
There is also a tool for optimizing muscle-tendon parameters:
https://simtk.org/projects/opt_muscle_par
But, when getting muscle quantities with MuscleAnalysis tool with only motion data, the output is subject to the activation level and the
default_activation of 0.05 is being used in your model. You may want to use full activation instead.
-Mohammadreza
Re: Analyze MuscleAnalysis outputs different to plotter
Posted: Tue Feb 13, 2024 2:29 am
by emmaj285
Thanks! I'll give your suggestions a go.