Modifying of the location of hip joint

Hi everyone,
I am trying to estimate the joint reaction force in the patients with osteoarthritis during gait. It is necessary to modify the location of the hip joint in GaitLowerExtremity model. But I don’t know which file defines the location of hip joint.
Thanks in advance.

Regards,
Ryoji

Hi Ryoki and welcome to the forums.

To find the location or definition of a joint center you could to the following:

  • Load your model.
  • Look for the joint in the model tree (in your case: Main.Studies.HumanModel.BodyModel.Right.Leg.Jnt.Hip)
  • Here you can find the reference frames defining the position of the joint (Main.Studies.HumanModel.BodyModel.Right.Leg.Seg.Thigh.HipJoint and Main.Studies.HumanModel.BodyModel.Trunk.SegmentsLumbar.PelvisSeg.Right.HipJoint)
  • Which are constructed in \AMMR.v1.5.1_Gait\Body\AAUHuman\LegTD\Seg.any(874) and \AMMR.v1.5.1_Gait\Body\AAUHuman\LegTD\HipNodes.any(2)
  • From there on you’ll have to work you way through own your own :wink:

I hope this helps.

Regards,
Patrick

Hi Patrick,

Thanks a lot for your reply. :slight_smile:
I found the definition of the center of hip joint.
I am trying to understand and modify the definition.
If any matters come up, I will ask a question.

Regards,
Ryoji

Hi Patrick,
I tried to understand the definition of the location of center hip joint following your advice. I thought that the location of the hip joint was defined by the below part. But I don’t know the wthat “sRel0” means.
Please give me any adivce.

AnyRefNode HipJoint = {
AnyVec3 sRel0 = .LegAttachmentNodes.sRel0+(.LegAttachmentNodes.ARel*.LegAttachmentNodes.StdPar.HipJoint’)’;
// The Hip Joint is positioned based on the data in the cadaver data set
sRel = .Scale( sRel0 );
#ifdef USE_AMMR14_HIP_ROTATIONS
// Setting the USE_AMMR14_HIP_ROTATIONSflag will emitate AMMR1.4 behaviour
ARel=RotMat(-24*pi/180,z);
#endif
};

Regards,
Ryoji

Hi Ryoji,

Yes, that is the right place. sRel0 in this particular case is the original value of the unscaled model. This point is then being scaled by .Scale(sRel0) to get the actual sRel.

Regards,
Pavel

Hi Patrick,

Thank a million for your help.
I’m sorry for late reply.
I have been trying to find the definition of center of the hip joint.
At last, I have found that in the …Body\AAUHuman\Trunk.PelvisSeg.any.

#if LEFT_LEG | RIGHT_LEG
/// This HipJoint definition is for the SimpleLeg model
AnyRefNode HipJointRight = {
sRel = .Scale({0.03, -0.10, 0.08});
};
I think this vector indicate the relative location of center of joint.

And new problems came up.
I can’t understand mean of the below sentence in the same file.

AnyFunTransform3D &Scale =…Scaling.GeometricalScaling.PelvisSeg.ScaleFunction;

Please give me any adivce.
Thank you for your consideration.

Regards,
Ryoji

Ryoji,

The coordinates are specified in the segmental coordinate system and are scaled using the segmetal scaling function. You have found the hip joint node on the pelvis - so it means the coordinates are in the pelvic reference frame. “Scale” is a scaling function that is given in the anthropometric scaling law or as a subject-specific morphing function. This function is defined in the scaling law folder, which can be found 2 levels up (…Scaling.GeometricalScaling). And this particular expression means that you are simply referring to the right scaling function of the right segment: …Scaling.GeometricalScaling.PelvisSeg.ScaleFunction

Hope this helps,
Pavel

Hi Patrick,

Thank you a lot for quick response.
I was able to understand the definition of the hip joint.
I am trying to modify the hip joint by specific data.
If any matters come up, I will ask a question.
Thank you for your continued advice.

Sincerely,
Ryoji

Hi Patrick,

I am trying to modify the hip joint by specific data, and have new question.
I am goint to the modify the location of hip joint after scalling model.
Is this right way?
Please give me some advice.

Sincerely,
Ryoji

Hi Ryoji,

If you are using AMMR V1.5.x then you can see the following code in the ‘\AMMR\Body\AAUHuman\LegTD\HipNodes.any’ file.

AnyRefNode HipJoint = {
  AnyVec3 sRel0 = .LegAttachmentNodes.sRel0+(.LegAttachmentNodes.ARel*.LegAttachmentNodes.StdPar.HipJoint')';
  // The Hip Joint is positioned based on the data in the cadaver data set 
  sRel = .Scale( sRel0 );
  #ifdef USE_AMMR14_HIP_ROTATIONS
  // Setting the USE_AMMR14_HIP_ROTATIONSflag will emitate AMMR1.4 behaviour
  ARel=RotMat(-24*pi/180,z);
  #endif

};

As you can see above, the sRel value of this HipJoint node is scaled.
So if you want to specify a certain value for this HipJoint, you can touch this code.

Best regards,
Moonki

Hi Moonki,

Thank you for your advice.
I am trying to input the location of hip.
Do I have to input the location by relative coordinate of pelvic?
I can’t understand the definition of the coordinate system of pelvic.
Please give me some advice.

Sincerely yours,
Ryoji Kiyama

Hi,

Sorry for late reply.

Let’s see the definition of the hip joint again:

AnyRefNode HipJoint = {
  AnyVec3 sRel0 = .LegAttachmentNodes.sRel0+(.LegAttachmentNodes.ARel*.LegAttachmentNodes.StdPar.HipJoint')';
  // The Hip Joint is positioned based on the data in the cadaver data set 
  [b]sRel = .Scale( sRel0 );[/b]
  #ifdef USE_AMMR14_HIP_ROTATIONS
  // Setting the USE_AMMR14_HIP_ROTATIONSflag will emitate AMMR1.4 behaviour
  ARel=RotMat(-24*pi/180,z);
  #endif

};
  1. If you want to see the coordinate system of this node,
    you can just put a AnyDrawRefFrame object inside this HipJoint node.

  2. Because you want to change the location of this hip joint after scaling,
    you can just do something like this:

sRel = .Scale( sRel0 ) + {0.001, 0.002, 0.003};

I hope this may help you.

Best regards,
Moonki