Scaling

Dear Pavel,

I could sent you something in your personal message like a photo and the code so you can have a better idea of the whole problem.

regards,
Giorgos

Dear Giorgos,

Yes, you could send it. But please try changing the landmarks and parameters yourself - I cannot promise a very quick solution. We are quite busy these days.

Best regards,
Pavel

Giorgos,

I had a quick look. Even the affine transform does not work for your selection of landmarks. I see obvious problems:
{ 0.00629325 , 0.11751 , -3.25E+00 },
{ 0.00676 , 0.124999 , -4.46E-01 },
{ 0.00661026 , 0.130443 , -5.37E+00 },

{ 0.00429133 , 0.144111 , 0.021373 },
{ 0.00413596 , 0.14571 , 0.017558 },
{ 0.00192623 , 0.148398 , 0.0157126 },
{ 8.38E+00 , 0.135894 , 0.0226991 },

These landmarks are over 3-4-5-8 meters away from each other, which is not really a landmark belonging to the geometry. Thus, it will not work and the morphing would produce something long and strange.

The landmarks have to correspond to each other in order to work. Try visualizing them on both geometries and see how they were selected. They should make perfect sense once visualized.

Try including the transforms one by one to ensure that all steps work well.

Regards,
Pavel

Dear Pavel,

In a previous post of yours, you say how I can include my scaling into my model. I cannot understand though if I have to #define and #include my scaling law directly into my model or I have to do it inside the predefined Scaling of AMMR.
I want to use it in a gait scenario.

Best regards,
George

Goerge,

you should not change anything in the body folder, but by including the “ScalingLawL2.any” into your model, you define the scaling in there.

Dear Amir,

When I include the “ScalingL5.any” for example in the “StandingLiftFEA.any” , it seams to work just fine (it runs ok).
The Problem is though, that it has no effect at the final result.
To make it more clear, I run the operation first with no modification and I export the “stl” file and the “.txt” file with the forces.
Then I run the operation again while I have used the Scaling. The results are exactly the same.
My assumption is that I have done my scaling based on other vertebra file which AnyBody no longer uses. What do you think ?

George

George,

can you upload your model to the debug section?

Dear Pavel,
some months ago I was trying to scale the original vertebrae into my CT scanned vertebrae. I had some problems back then but with your help, I finished the scaling algorithm.
I didn’t use the algorithm till today, and now that I try to use it (I have the tutorial as a guidance) I get a message that says “…/…/…/StandingModelScalingDisplay/Model/‘Scaling_L1Seg’ was not found!”
The problem is that I follow this exact path and I paste the “Scaling_L1Seg” in the Model folder. I even copy-paste the exact name of the #include function.
Do you have any idea what may be going wrong?

Thank you very much.

Best regards,
George

Hi George,

Seem like it might be the problem
"…/…/…/StandingModelScalingDisplay/Model/‘Scaling_L1Seg’ " - remove single quotes ’ ’

Regards,
Pavel

Dear Pavel,
I follow the example of the femur in StandingModelScalingDisplay.any file.
I do everything as it has to be, it seams to work just fine (I get no error messages) and finally, when I use the “Model View”, I see nothing.
It is blank. The only transformation that I have made is the following include file

// This is a place holder for the inclusion of custom scaling laws
HumanModel.Scaling.GeometricalScaling = {

#define CUSTOM_SCALING_L1Seg
L1Seg = {
#include “Scaling_L1Seg.any”
AnyFunTransform3D &ScaleFunction = Scaling_L1Seg.Transform;
};
};

Regards,
George

Dear George,

Most likely it is a units conversion problem. Looks like something that you morph is way too small. Please make sure that all units are consistent. Otherwise we need to see the scaling code.

Pavel

P.S. Please ignore the message I sent privately. I thought that I received another message from you - must be a very slow weekend thinking :slight_smile:

Dear Pavel,
You may be right but I also have some problems when I try to RUN the Inverse Dynamics.

The error message is



Constraint no. #0 in ‘Main.Model.ModelEnvironmentConnection.Drivers.RHeelGroundConstraint’ above error tolerance 0.000001, error = 0.169744.
Constraint no. #0 in ‘Main.Model.ModelEnvironmentConnection.Drivers.RAnkleX’ above error tolerance 0.000001, error = 0.089817.
Constraint no. #0 in ‘Main.Model.ModelEnvironmentConnection.Drivers.LToeGroundConstraint’ above error tolerance 0.000001, error = 0.160343.
Constraint no. #0 in ‘Main.Model.ModelEnvironmentConnection.Drivers.LHeelGroundConstraint’ above error tolerance 0.000001, error = 0.169744.
Constraint no. #0 in ‘Main.Model.ModelEnvironmentConnection.Drivers.LAnkleX’ above error tolerance 0.000001, error = 0.089817.
ERROR(OBJ.MCH.KIN3) : C:/U…s/A…n/D…p/G…y/a…y/AMMR/A…n/E…s/S…y/StandingModelScalingDisplay.Main.any(81) : Study.InitialConditions : Kinematic analysis failed in time step 0

I attach you the files so you can take a look,.
If you have any problem with the attachments, please let me know so I can reattach it.

Thank you very much.

George,

There are several problems. The source landmarks that you selected are not in the segmental ref. frame. That breaks the morphing. Secondly, as i said before, there is also the unit conversion problems. Make sure everything is consistent. AnyBody operates in meters - you mix mm and m in the same scaling law.

Please ensure consistency of surface/landmarks, units. That should help.

Regards,
Pavel

P.S. I have only looked at L1 scaling.

Dear Pavel,
I will check the points again as you said but I cannot understand the segmental frame you mention.
In the tutorial in StandingModelScalingDisplay.any, you do nothing about frame.
Last time I sent you the scaling of the vertebrae without trying to input them to a specific model, you said that they should work fine.
Also, when I was visualizing them (the same as the appendix was), it seamed to work fine.
Do I have to change something inside the scaling law (beside some points that may be wrong)?

Thank you very much for your patience.

Best regards,
George

Hi Giorgios,

I have tried your files and it all seems to work. Please see attached image.

I am not sure what you are doing, but here is how it is supposed to be:
I created a model from the template, I copied all CUSTOM_SCSALING_LXSeg.any files into the Model folder of application, and in the main before #include “<path>\HumanModel.any” I added the following lines to produce the attached image.

  #define CUSTOM_SCALING_L1Seg
  HumanModel.Scaling.GeometricalScaling.L1Seg = {
    #include "Model\CUSTOM_SCALING_L1Seg.any"
    AnyFunTransform3D &ScaleFunction = SCALING_L1Seg.GlobalRef.Scaling.Transform;
  };

Could you please remind me which version of AnyBody you use, but from what i see you should not have any problem if you followed the tutorials.
Regards,
Pavel

P.S. The vertebra seem to come from a child or a very small person - it differs significantly from the generic model.

Dear Pavel,
Thank you for your quick answer.
I will try to do exactly the same, but I think I will have some more problems.
Let me explain what I mean.
The vertebrae you use as a source for the scaling, were provided to me while I was in Aalborg last year for the Advanced Muscleoskeletal Modeling seminar.
The vertebrae I want to use as source, are exported from the latest AMMR.

I have imported both vertebrae (old and new) in MeshLab and measured their main body diameter. The vertebra of the new AMMR is 1000 times bigger than the other. Do you have any idea why this happens ?

Thank you,

George

Dear George,

Please make sure units are the same.

Regards,
Pavel

Dear Pavel,

thank you for the nice Scaling-Tutorials! I made the lessons 3 and now I’m getting confused. I tested my own scaling law and it works fine so far. It is somehow similar to your suggestion. I opend the model of lesson 1 and included and defined my own scaling law. To check my law again I displayed the transformed geometry like in lesson 3 (AnySeg … AnyDrawSurf …) and it looks wonderful. But the final geometry of the BodyModel is definetly not the same. It seems that there are some transformations between my scaling and the final one BodyModel) are not working as vdk_landmark_rigidbody. I tried to understand the predefined scaling laws but couldn’t get it deeply.

Can you get me a brief description of how the transformation between the scaled source geometry and the final geometry works?

I also replaced my scaling law with the one of lesson 4, which makes almost no difference in my displayed scaled source geometry. But the strange thing is that the final geom in the BodyModel changes significant! :confused:

Attached you can find a picture of my final geom which I get with my own scaling law. It seems to be altered in z-dimension.

Thank you in advance and have a nice day,
felix

Dear Felix,

Could you please specify the version of AMS you are using? Is it 6.0.3? If so the tutorial contains a small change as compared to the previous version, which most likely will help you. Do you have access to the latest version?

But briefly the problem is that the scaling is now supposed to be happening in the anatomic reference frame. And the rigid body transform from the segmental to the scaling ref. frame is missing as you have noticed. The latest version of tutorial explains how to deal with it. And if you have an access it might the quickest to grab it in make adjustments accordingly.

Regards,
Pavel

Dear Pavel,

you are right, I’m not working with the latest one. It’s 6.0.2. Tank you very much for the hint. I’ve to wait until my admin got time for me … :slight_smile:

Kings Regards,
felix