Scaling

// Todo: Add points for grounding of the model here

};  // Global reference frame

AnySeg Sourcefemur = 
{
  
  Mass = 0;
 Jii = {0, 0, 0};
 
 AnyDrawSurf Surface = 
 {
   
   FileName = "right leg from standardscaling.stl";
  AnyFunTransform3D &ref = ..AffineTransform;

 };
 };
 AnySeg Targetfemur = 
{
  Mass = 0;
 Jii = {0, 0, 0};

// scaleXYZ={1, 1, 1}*0.001;
AnyDrawSurf Surface =
{
FileName = “AN XIAO PING_Right_Leg-femur-end-1.stl”;
ScaleXYZ={1, 1, 1}*0.001;
};
};
AnyFunTransform3DLin2 AffineTransform =
{
//PreTransforms = {};
Points0 = {
{0.128637, 0.673726, 0.137192},
{0.109035, 0.644260, 0.101925},
{0.0892733, 0.675726, 0.150444},
{0.0821476, 0.671872, 0.0779451},
{0.118291, 0.683727, 0.112291}
};

Points1 = {
{-86.55320, -19.04790, 3.89089}*0.001,
{-43.30340, -14.70030, -6.82591}*0.001,
{-98.86160, 21.40300, 12.54800}*0.001,
{-18.11930, 23.02600, 17.62470}*0.001,
{-67.7000,-15.2959,7.12995}*0.001
};
Mode = VTK_LANDMARK_AFFINE;
};

}; // MyModel

// The study: Operations to be performed on the model
AnyBodyStudy MyStudy = {
AnyFolder &Model = .Scaling;
Gravity = {0.0, -9.81, 0.0};
};
}; // Main

in these procedures, i used two different modes to achieve the scaling. In the VTK_LANDMARK_RIGDBODY mode, the scaling picture was shown below:

In the VTK_LANDMARK_AFFINE mode, the scaling picture was shown below:

The total femur from the anybody model was scaled to the subject-specific femur. why the total femur from the anybody has such a strange transformation in which the total femur after scaling was fully different from the source ? what is the difference between VTK_LANDMARK_RIGDBODY and VTK_LANDMARK_AFFINE in detail?
Best regards.

Dear Matthew,

The difference in these modes of scaling using AnyFunTransform3DLin2 is that the VTK_LANDMARK_RIGIDBODY mode will translate the bone without morphing, i.e. the transformation matrix will only contain translation and rotation, whereas the VTK_LANDMARK_AFFINE allows affine scaling of the bone. So the first option is needed when you want to align bones based on the inserted landmarks, and the second one is when you want to align and get an initial fit.

Unfortunately the images are not loaded. But if you have something strange - it means that either the landmarks are not well selected (please check that they match the original bone) or there is an error.

Kind regards,
Pavel