Need help with removing a muscle in a model

I am keen to find out how to remove a particular muscle from a model. I am intersted in comparing the kinematics and muscle output forces of a model composed of different muscle combinations.

Taking the lower body model example of the ‘‘MoCapModel’’ provided when downloading the Anybody software, could someone walk me through the steps on how to remove a single muscle from the model?

Thanks in advance,
Háski.

Hi,

A small comment first: since this a professional forum, we would very much recommend to provide your name and institution details in your profile. Otherwise we do not really know whom we are dealing with and may opt to answer your questions with the lowest priority.

Regarding the muscle exclusion: AnyBodyStudy class contains a member, called MechObjectExclude. This member is an array of object pointers and you could remove a muscle by writing the following line:

MechObjectExclude=ObjSearch("Main.HumanModel....[i]MuscleToRemove[/i]", "[i]MuscleType[/i]"(e.g. "AnyShortestPathMuscle");

If you need to remove more than one you can check ‘arrcat’ function in the ref. manual.

The muscle will stay in the visualization, but it will not be involved in the analysis (its activity and other value will be 0).

Here is an example how it would like for removal of 2 anterior branches of Gluteus Medius:

  AnyBodyStudy Study = {
    
    tEnd = 10.0;
    Gravity = {0.0, -9.81, 0.0};
    nStep = 10;

    MechObjectExclude = arrcat(
     ObjSearch("Main.HumanModel.BodyModel.Right.Leg.Mus.GluteusMediusAnterior6", "AnyViaPointMuscle"),
     ObjSearch("Main.HumanModel.BodyModel.Right.Leg.Mus.GluteusMediusAnterior1", "AnyViaPointMuscle"));    

Best regards,
Pavel

Hi, thanks for your help Pavel. I have updated my profile information.

In which .any script would you recommend I write this code?

Háski.

Hi,

You can do it either in YourModel.Main.any after the line starting with AnyBodyStudy. Or you can make an include file, which might be easier to read in case of many exclusions, but you will write the same blocks of code.

Regards,
Pavel

I’ve been trying to remove the two muscles that you took as an example from a model I am using, but so far I have not been successful. Below is a short summary of what I have been doing. Perhaps you can find my mistake.

I am working with the example model ‘‘MoCapModel’’ that is provided with the Anybody download package. I paste the code that you provided me in the MoCap_LowerBody.main.any script, within the folder AnyFolder Studies ={, directly below the line #include “Model/RemoveMuscle.any”. I then run the MotionAndParameterOptimizationModel, and then run the InverseDynamicModel.

If I am correct, then the force output of the two muscles (Fout), should be zero. So I go into Window/Chart2D/Main/Studies/InverseDynamicStudy/Output/BodyModel/Right/Leg/Mus/GluteusMediusAnterior6/Fout. However, the graph depicts that there is a force present in the GluteusMediusAnterior6.

Could you point out what I am doing wrong?

Thanks in advance,
Háski.

  AnyFolder Studies ={
  // Usually, there is no need to make changes in the following files. PLease be aware. that
  // changes in the Kinematics and InverseDynamics may lead to model failure and/or unrealistic results:
    #if  MotionAndParameterOptimizationModel
    #include "Model/Kinematics.any"  
    #endif    
    
    #if InverseDynamicModel
    #include "Model/InverseDynamics.any"  
    
    InverseDynamicsStudy = {
      MechObjectExclude = arrcat(
        ObjSearch("Main.Studies.HumanModel...
        ObjSearch("Main.Studies.HumanModel...
        );
    };
    #endif

The structure of this model is a little different, you simply did not find those muscles because of the wrong path. To make sure it works - go to the model tree and select MechObjectExclude. In the object description window you should see that it found two objects.

Regards,
Pavel

Thanks a lot. It seems to work now.

As far as I know, arrcat only allows me to remove two muscles. My final question is: if I wanted to remove all six Gluteus Medius Anterior muscles, how would I go on about doing that? I tried creating three arrcat commands, but that did not seem to work.

Thanks in advance,
Háski.

MechObjectExclude = ObjSearch(“Main…GluteusMediusAnterior*”, “muscletype”);

Kind regards,
Pavel

Hi,
I would like to know the correct procedure to remove one entire leg from the model.
My final goal is to remove the leg and substitute with a prosthesis.

Best regards
Giordano

Hi Giordano,

How much of the leg would you like to remove? Is it everything up to the pelvis?
In this case you could use a BM statement:

#define BM_LEG_LEFT CONST_LEG_MODEL_OFF
//Possible values:  CONST_LEG_MODEL_OFF  CONST_LEG_MODEL_Leg  CONST_LEG_MODEL_TLEM  

Regards,
Pavel

Hi Pavel,
I would like to manage different level of amputation, for example: only the foot, or to knee or pelvis.

I insert this in InverseDynamicsModel.main.any to remove the entire left leg

AnyBodyStudy InverseDynamicStudy = {
      
      MechObjectExclude=
        arrcat( ObjSearch("Main.HumanModel.BodyModel.Left.Leg", "AnyMechObject"));

Yes, different levels can only be done through MechObjectExclude.
You could use arrcat to concatenate multiple search results into one.

Please try and see what works, what doesn’t - we could help further if something does not work.

Regards,
Pavel

Hello Pavel,
I would like to know if MechObjectExclude is supposed to disable the elements or even delete, even graphically, them from the model.

Regards,
Giordano

Giordano,

It doesn’t exclude the elements from the model structure, but excludes it from the analysis. Meaning that the loaded model in the memory will still have all components, but the analysis will solve a smaller problem and will not take into account excluded elements.

If you want to remove it from the model view - you could just set up your own custom view. In SpineFixationWithFDK you could find an example of using AnyProject to set up specific views without modifying the model in the memory.

Kind regards,
Pavel