Subject Specific Model


I would like to produce subject specific models in AnyGait. I was wondering if it is possible to modify the following at the hip

  1. Cup inclination angle
  2. Joint Centre Location
  3. Femoral Offset

Is it also possible to produce different models for males and females as they differ in anatomy?


Dear Ammar,

1,2 & 3 are possible. You should look into the the THA knee bend model to see how that could be done.
In order to make the AnyGait model easier in terms of GUI, the code behind the model got more complex, so making those changes might not be so easy.

About the male/female scaling, the model is automatically scaled according to the markers in the standing trial.

Thank you for your response. I have been trying to change the joint centre in AnyGait using the advice given in

This was given for THA knee bend model with the following code used

AnyOperationSetValue ChangeStemPos=

AnyVec3 mydisplacement = {0, 0.01, 0}; // in meters
Source = {&mydisplacement};
Target = {&Main.HumanModel.BodyModel.Right.Leg.Seg.Thigh.HipJ ointAnatomicalFrame.sRel};

The hipantomaicalframe is in the same folder in the AnyGait model as it is in the THA knee bend model. I placed the above code just after the “main” in the script, but I get an error:

ERROR(SCR.PRS9) : C:/U…s/a…r/D…p/A…)/A…5/A…n/A…t/A…e/M…l/O…l/P…l/InverseDynamicsModel.main.any : ‘HumanModel’ : Unresolved object

I was wondering if you could give me some tips with regards to this?

Dear Ammar,
if you have the AnyGait loaded you can switch the view on the left side in the AMS from the project tabs to the Model tree. In there you see the structure of AnyGait. Unfortunately, it is quite different from a normal model. In AnyGait, you will find the HUmanModel folder in Main.AnyBodyGaitAppModel.HumanModel…

Hello Amir.

Thank you for your help. I have another question. I believe I have located the hip joint but was slightly confused by the following:

what is the difference between the following:



Secondly, I hope to use a specific hip centre as obtained from an x-ray from a hip replacement patient. The hip implant femoral head has a radius of 14mm and I was wondering what was the dimension of your femoral head are the same?

Dear Ammar

I think you are looking in the wrong place of the code to alter the hip joint centers. The idea in AnyGait is that we define a stick figure based on the standing reference trial and then morph the musculoskeletal model to match this stick figure.

If you find the stick figure definition, you will see that it basically computes the hip joint centers in a pelvis reference frame (define based on the pelvic markers) based on a regression equation. If I recall correctly, the ones of Davis et al, Bell et al and Harrington et al are implemented and can be switched between. Hence, if you compute your patient-specific hip joint center in the same reference frame, you can change that bit of code, and the musculoskeletal geometry will be morphed to match this.

We have done something similar in a previous study:
Mellon, Stephen; Grammatopoulos, George; Andersen, Michael Skipper; Pandit, Hemant; Gill, Harinderjit. 2014. Optimal acetabular component orientation estimated using edge-loading and impingement risk in patients with metal-on-metal hip resurfacing arthroplasty. Journal of Biomechanics. (In press). DOI: 10.1016/j.jbiomech.2014.11.027

Mellon, Stephen; Grammatopoulos, George; Andersen, Michael Skipper; Pegg, Elise; Pandit, Hemant; Murray, David; Gill, Harinderjit. 2013. Individual motion patterns during gait and sit-to-stand contribute to edge-loading risk in metal-on-metal hip resurfacing. Institution of Mechanical Engineers. Proceedings. Part H: Journal of Engineering in Medicine, Vol. 227, Nr. 7, 2013, s. 799-810.

Best regards