Muscle activity for muscle groups in selected output

Hi all,

I’ve been looking at the muscle activity for the muscles of the lower extremity in the Mocap example Lower Extremity model.

When I look at the activity of muscle groups in the selected output folder (e.g. HipFlexorMuscleActivity) there are several muscles included.

Is there a fast way to find out which muscles are included in the muscle group and which curve they are in the graph?

Kind regards and thank you for any help,
Johanna

Hi, Johanna,

Just find HipFlexorMuscleActivity from the SelectedOutput folder in the model tree, right-click, locate the anyscript, you’ll find the muscles included.

Best Regards,
Lee

1 Like

Hi Lee,

thank you. This was exactly what I was searching for!

Now I found something I’m wondering about. Sometimes the muscles stated in the comments are not the ones that are included in the calculation.

e.g.
In the calculation of the hip abductor muscle force the Gluteus medius muscle force is stated twice and the Gluteus minimus is not included.

/* Hip Abductors
o Gluteus medius
o Gluteus minimus
o Sartorius
o Tensor fasciae latae
*/

  AnyVar HipAbductorMuscleForce = MuscleForces.GluteusMedForce + MuscleForces.GluteusMedForce + MuscleForces.SartoriusForce + MuscleForces.TensorFasciaeForce;

In the statement for the hip extensor muscle activity the short head of the biceps femoris is included instead of the long head, despite the comment explaining earlier that only the long head is a hip extensor.

/* Hip extensors:
o Gluteus maximus
o Most of the hamstrings:
" Long head of biceps femoris, short head is not a hip extensor, only a knee flexor
" Semimembranosus muscle
" Semitendinosus muscle

  */
  AnyFloat HipExtensorMuscleActivity = {MuscleActivity.GluteusMaxActivity, MuscleActivity.BicepsFemorisCaputBreveActivity, MuscleActivity.SemimembranosusActivity, MuscleActivity.SemitendinosusActivity};

Meanwhile in the knee flexor muscle activity the long head of the biceps femoris is included again but not the short head.

/* Knee flexors:
o hamstrings (also hip extensors):
" biceps femoris (short head does not extend hip)
" semimembranosus
" semitendinosus
o gastrocnemius (also plantar flexor as a calf muscle)
o gracilis (also hip flexor/adductor)
o sartorius (also hip flexor/abductor/lateral rotator)
*/

  //      AnyVar KneeFlexorMuscleActivity = MuscleActivity.BicepsFemorisCaputLongActivity + MuscleActivity.GastrocActivity + MuscleActivity.GracilisActivity + MuscleActivity.SartoriusActivity;
  #if BM_FOOT_MODEL == _FOOT_MODEL_DEFAULT_
  AnyFloat KneeFlexorMuscleActivity = {MuscleActivity.BicepsFemorisCaputLongActivity, MuscleActivity.GastrocActivity, MuscleActivity.GracilisActivity, MuscleActivity.SartoriusActivity};
  #endif

Does this have a reason or are those typos?

Regards,
Johanna

Hi Johanna,

This is typos… thanks a lot for making us aware of this,
The error was also present in same objects for both activity and force

We have fixed it on AMMR beta

Best regards
Søren

Hi Søren,

I am glad I could help.

Regards,
Johanna

Thanks for your help Johanna (@JMichel). You can can get access to the Beta version of the model repository if you like.

The procedure is:

  1. Sign up/in on Gitlab.com
  2. Visit https://gitlab.com/anybody/beta and click “Request access”
    image
  3. Visit the merge-request fixing your bug-report: https://gitlab.com/anybody/beta/ammr/merge_requests/441

When you have access you can also download the AMMR beta. Either using the ‘git’ version control client or as ordinary zip file.

Hi Morten,

I’ve got the AMMR beta version now. Thank you for suggesting it.

I’ve got some other questions about the muscle group activities why I originally created this topic. Any advise would be greatly appreciated.

I am interested in the activity for the knee extensors. Is there a specific reason why there is no data for the knee extensor muscle activity in the selected output folder?

Can I recreate the graph similar to the other muscle group activity profiles by searching the muscle activity of the single knee extensor muscles in the Output.Right.Leg.Mus folder?
How can I unite the muscle activity of all parts of the muscle into one value? Do I just need to take the maximum value for each time step?

Kind regards,
Johanna

I was also looking for same issue. Thanks it helped! Hopefully it should work in my system.
regards,
Lewis

Hi Johanna,

The knee extensor muscles could have been added, i do not see a specific reason for not doing that.

One way to get one number out would be to take the max value like this e.g.

AnyVar ModelEnvelope = max({ Main.Model.HumanModel.Right.Leg.Mus.GluteusMedius1.Activity,
      Main.Model.HumanModel.Right.Leg.Mus.GluteusMedius2.Activity,
      Main.Model.HumanModel.Right.Leg.Mus.GluteusMedius3.Activity});

Best regards
Søren

Hi Søren,

thank you for your opinion.

I calculated the muscle activity and muscle force of the knee extensors similar to the definition of the other muscle group forces and activities in RightLegSelectedOutput.any.

It worked fine for me so I’ll provide my code here in case others want to do something similar.

// Add Muscle Activity of Vasti muscle group to the Selected Output folder
Main.HumanModel.BodyModel.SelectedOutput.Right.Leg.Muscles.MuscleActivity=
{
AnySearchFun VastusLateralisActivityList= {
Search = “Main.HumanModel.BodyModel.Right.Leg.Mus.VastusLateralis*.Activity”;
};

AnySearchFun  VastusMedialisActivityList=  {
  Search = "Main.HumanModel.BodyModel.Right.Leg.Mus.VastusMedialis*.Activity";
 };    

AnySearchFun  VastusIntermediusActivityList=  {
  Search = "Main.HumanModel.BodyModel.Right.Leg.Mus.VastusIntermedius*.Activity";
};     


AnyVar VastusLateralisActivity = max(VastusLateralisActivityList());
AnyVar VastusMedialisActivity = max(VastusMedialisActivityList());
AnyVar VastusIntermediusActivity = max(VastusIntermediusActivityList());  

};

// Add Knee extensor muscle activity to the Selected Output folder
Main.HumanModel.BodyModel.SelectedOutput.Right.Leg.Muscles =
{

/* Knee Extensors
o Vastus lateralis
o Vastus medius
o Vastus intermedius
o Rectus femoris
*/

AnyFloat KneeExtensorMuscleActivity = {MuscleActivity.VastusLateralisActivity, MuscleActivity.VastusMedialisActivity,
MuscleActivity.VastusIntermediusActivity,MuscleActivity.RectusFemorisActivity};

};

// Add Vasti muscle forces to the Selected Output folder

Main.HumanModel.BodyModel.SelectedOutput.Right.Leg.Muscles.MuscleForces=
{
AnySearchFun VastusLateralisForceList = {
Search = “Main.HumanModel.BodyModel.Right.Leg.Mus.VastusLateralis*.Fout”;
};
AnySearchFun VastusMedialisForceList = {
Search = “Main.HumanModel.BodyModel.Right.Leg.Mus.VastusMedialis*.Fout”;
};
AnySearchFun VastusIntermediusForceList = {
Search = “Main.HumanModel.BodyModel.Right.Leg.Mus.VastusIntermedius*.Fout”;
};

AnyVar VastusLateralisForce = sum(VastusLateralisForceList());
AnyVar VastusMedialisForce=sum(VastusMedialisForceList());  
AnyVar VastusIntermediusForce=sum(VastusIntermediusForceList());


// Add Knee Extensor muscle force to the Selected Output folder
 Main.HumanModel.BodyModel.SelectedOutput.Right.Leg.Muscles=
 {
    /*  Knee Extensors
o	Vastus lateralis
o	Vastus medius
o	Vastus intermedius
o	Rectus femoris
*/

AnyVar KneeExtensorMuscleForce =
MuscleForces.VastusLateralisForce+ MuscleForces.VastusMedialisForce + MuscleForces.VastusIntermediusForce + MuscleForces.RectusFemorisForce;

 };

};

Kind regards,
Johanna

1 Like

Hi Johanna,

Thanks a lot for sharing the script

Best regards
Søren