C3D File

Hi Sylvain,

Thank you very much for your reply. The model I have been using is Gait Lower Extremity Model. I attached the files in which I made changes and data file. Could you look at them and let me know where I should make changes?

Thanks, again.

Hi,

There is almost no motion in the c3d file, but the optimization converged anyway.

I just found two errors:

  • In ExtraDriver it should be AnyKinMeasureOrg &ref2=…HumanModel.BodyModel.Interface.Right.SubTalarEversion instead of AnkleEversion.

  • In ModelSetup you set the weight of the RTOE driver to 0 in the y direction. I think it should be 1 like the other.

Also don’t forget to adjust the position of the markers of the foot wearing the boot.

It should be fine with this.

Best regards, Sylvain.

Hi Sylvain,

Thank you very much for your reply. Optimization was able to converge itself, although it took around 2 hours. When it started to evaluate KKT conditions, an initial Previous AbsSumKinError before decrease of step length was about 137. Compared with that of the tutorial, I thought it was very big. The optimization converged, but I was concerned about validity of the optimization. I assume that the parameter optimization is supposed to converge once the cost function gets below a certain value. So, as long as it converges, the parameter optimization will be fine. Is this correct?

Also, I ran an inverse dynamic simulation and compared joint moments calculated by Anybody with those by our motion capture system. The values were far away from each other. Do you have any comment on this?

Thank you very much, again.

Hi,

It is not a problem if the initial AbsSumKinError is larger than in the tutorial. It can vary with the number of markers and the initial guess of their position.
Even when the optimization converged, you have to check that the result looks correct. Sometimes there are more than one solution and it can happen that the wrong one is chosen, leading to bones twisted around.

For the difference between the joint moment, the first thing i would check is the kinematic (as i explained above). If the optimized motion is close enough to reality and you are satisfied with it, then you have to look at the boundary conditions.

Best regards, sylvain.

Hi Sylvain,

Thank you very much for your reply. I checked the joint angles, and they were close to those calculated by our motion capture system. The differences were around 2 or 3 degrees.

But, the simulated joint moments were still very different from experimental ones. I feel that I may not be looking at right ones. I have been checking out joint moments in joint moment measure <- leg <- right or left <- selected output <- Human Model <- Output <- Inverse Dynamic Study <- Studies. Is this correct?

What unit does this lower gait model use for moments? Are they normalized to body weight? Are the moments calculated with respect to a local or global frame? Please, let me know.

Thank you very much.

Hi,

That’s the right place to look. The moments are in Nm and calculated in local reference frame (usualy the joint node of the proximal segment). Open the corresponding SelectedOutput.any file and you will find for each DoF a comment describing the reference frame used for the moment calculation.

Best regards, Sylvain.

Hi Sylvain,

Thank you very much for your help. Another issue just came cross. We have two different subject orientations; 1) a subject faces in a negative y-direction in your system, 2) a subject in a positive y-direction. I rotated PelvisRotx,y,z in TrialSpecificData.any to match the model to our marker set.

I had been using data for the 1) orientation. Then, results were close enough to the experimental ones. But, for 2) one, simulated joint angles and moments are not close to the experimental ones. I did not change anything except PelvisRot. I am not sure what I am missing.

Could you give me any suggestion or advice?

Thank you very much.

Hi,

The orientation should not affect the result if you follow the normal procedure. What you have to do is set the pelvis XYZ rotation as you did (and the linear position also if necessary), then run the optimization for each trial.
Did you run the optimization for both model orientations?

Best regards, Sylvain.

Hi Sylvain,

Thank you very much for your help. Yes, I did run the optimization for both model orientations. But, when the subject is facing in the positive Y-direction, joint angles calculated by Anybody do not match the angles calculated by our motion capture system. I am still using the same Anybody model files for this subject configuration except changes in the pelvis XYZ rotations. For this case, the pelvis XYZ rotation are as follows:

AnyVar PelvisRotZ = 90;
AnyVar PelvisRotY = 0;
AnyVar PelvisRotX = 90;

I attached the Anybody files which I have modified based on your suggestions and the C3D file in which the subject was facing in the positive Y-direction. Could you check those files and give me some suggestions?

Thank you very much, again.

Hi,

I tried your data and the optimization worked correctly. The markers are matching at the end as they should, so i do not see any problem with that.

Now you say you are comparing the joint angles with the ones computed by another software. Are you sure they are defined similarly (same orientation, same zero position, etc)? That could explain the difference you see.

Best regards, Sylvain.

Hi Sylvain,

Thank you very much for checking our data. Yes, both data were recorded in the same experimental set-up, except for the directions in which subjects were facing. We used the same lab global coordinate systems, positions and orientations for the force plates for both trials.

In the case where a subject was facing in a negative y-direction, simulated joint angles by Anybody satisfactorily matched the experimental joint angles.

However, in the case where a subject was facing in a positive y-direction, I observed around a 5 to 20 degree difference between simulated and experimental joint angles at the ankle, knee, and hip joints.

Again, I attached two data files for the above two cases. Would you be able to check them? If you find any discrepancies for either cases, please let me know.

Thank you very much.

Hi,

I tried your two files and i cannot see anything wrong. The optimization runned correctly. I don’t think there is a problem of positive or negative Y facing. It doesn’t make any difference for the optimization.

An important question is how did you get the experimental data you compare it with? How has it been measured or calculated? You have to consider that the problem can also come from the experimental data.

Best regards, Sylvain.

Hi Sylvain,

Thank you very much for your help. We collected new data and analyzed them with our motion capture system and Anybody. There were still 15-20 degrees differences between ankle joint angles calculated by our system and Anybody. I feel this might be due to the way ankle joint angles are calculated. Does Anybody take into account ankle flexion offsets and then rotate foot segments? If so, please let me know how the segments are rotated.

Thank you very again.

Hi,

I don’t really know what are those “ankle flexion offsets” you talk about, so i guess that is a sign the calculation is different…

First thing to know in AnyBody is that the global ankle joint is separated into 2 revolute joints: the ankle joint itself (flexion/extension) between shank and talus, and the subtalar joint (eversion/inversion) between talus and foot.
Then there are no offsets. Both angles are measured from the zero or neutral position, which is basically standing with the foot flat on the floor.

Does that answer your question?

Best regards, Sylvain.

Thank you very much for your help. Finally, we were able to solve the problem. We observed that joint angles estimated by Anybody were very close to experimental joint angles.

However, experimental joint moments are very different from moments predicted by Anybody. The differences were around 100 - 200%. I assume that the way we calculated joint moments is different from Anybody does. But, the differences are huge.

You mentioned that I should check a boundary condition. I can’t find any boundary conditions. Where should I go to look at them? How should I adjust them? Please, let me know.

Hi,

I am glad that you could fix the joint angles issue. Now that the kinematic of the two models is the same, the joint moment should as well…
As you mentioned it you have to take into account that the joints and therefore the moments could be defined a little differently. This is the first thing to check. But you are right that it may not explain such a difference.

Try to run the model without muscles first, so you can directly see the joint moments. I guess you have done that already.
Then you have to make sure that the force plates are correctly modelled. Check that the type is right, if it needs a calibration matrix, etc. Also check if the center of pressure is correctly located under the foot.

Best regards, Sylvain.

Hi Sylvain,

Thank you very much for your reply. I turned off all muscles in BodyPartsSetup.any file, ran an inverse dynamic simulation, and observed that joint moments with and without muscles were identical. I assume that they should be same. Have I done it correctly?

Besides that, I used AnyInputC3D and looked at values of Fx, Fy, Fz, Mx, My, and Mz directly. I noticed that signs of Fx and Mx were opposite of what I saw in our motion capture system. Except these differences, I think that forces and moments of our force plates were read correctly by Anybody.

To change the signs of Fx and Mx, I simply multiplied Fx and Mx by -1 in EnvironmentAuto Detection.any as follows:

Fx=Main.ModelSetup.C3DFileData.Analog.DataFiltered.Fx*(-1)
Mx=Main.ModelSetup.C3DFileData.Analog.DataFiltered.Mx*(-1),

But, I received the error such as ‘*(-1),’ : Unexpected character.

Our force plate type is type 2. I am noting using a calibration matrix. How can I change the signs of Fx and Mx? Please, let me know.

Thank you very much.

Hi,

It is normal that the computed joint moments are the same with and without muscles, yes. It just make it faster and easier to switch muscles Off for this kind of debugging.

For Fx and Mx, if they have not been written correctly into the C3D file i thinks the best is to edit dirrectly the C3D file to correct the sign.
If you don’t have access to a C3D editor software then you can change the sign in the file ForcePlateType2, in the objects AnyForce3D Force and AnyMoment3D Moment.

Keep an eye on the display of the center of pressure, this is a good indication if the forces are correct or not.

Best regards, Sylvain.

Hi Sylvain,

Thank you very much for your reply. I finally confirmed that joint moments are OK. We calculated joint moments differently from Anybody.

Next, I would like to export lmt, lm, lmtDot, and so on which are used to compute muscle forces as a text file. I think I need to use AnyOutputFile. To use it, I assume I have to set up correct paths to each variables. But, I can not find files which compute those variables. Which file should I look at?

In addition, I have a question about muscle activations. Does Anybody use a filter and process muscle activations? Please, let me know.

Thank you very much.

Hi

lmt, lm, and lmtdot is part of the standard output from any of the muscle models, this is why you will not be able to find a file where the calculations are done. You will need to look at the output from the muscle.

These quantities are directly calculated from the kinematic data, so there are no filter on these data other than the filters which may be applied on the input data driving the model. For a C3D driven model this is usually specified C3D input object.

Best regards
Søren