about scaling tutorials

Dea sir
im doing subject specific scaling . I have created my own created femur bone as target. So im using my own created femur bone as target and source femur as given in tutorials. But when im reloading the model,then in the model view only targetfemur is showing and sourcefemur diappears from model view.
Plz look into problem. Im attaching my own femur created file.

Dear Mohit,

Your target mesh is in millimeters. It will look much bigger if you put it next to the object in meters. Please use consistent units for both drawing objects and scaling entities such as landmarks and surfaces.

Kind regards,
Pavel

Dear sir
i have done following steps to resolve this problem-

  1. i scale down the target femur by multiplying .001. then the result is source femur appears in model view but still target femur is so many large than the sourcefemur. Then i measure the lengths of both source (.430m)and target femur(.420m) in mimics ,there i found that the sizes are approximately same.So question is that why this problem is still occuring if the sizes are same.
  2. then i scale source femur 1000000 times in anybody then in the model view source and target femur looks equal or same.So i want to know that is it a right apporach?
    Now one problem is that that when i apply affine transform to the model after reloading both the bones are not merging to themself properly.How can they merge properly as given in tutorials?How i can i use the same reference frame?
    Thanks.

Dear Mohit,

The first one sounds like you still have a problem in the code - you need to check it yourself. Unfortunately you did not post the code for this scaling and I cannot see what is exactly wrong. But judging from the description that you provided it looks like you scaled the SOURCE femur, not the target one (if x1000000 helps to make them the same).

Secondly, once you get your objects to the right dimensions you need to select landmarks on corresponding bones and ONLY if the units right and you selected correct landmarks it will do the correct registration. I would recommend to repeat the tutorial to get a feeling how it is supposed to work.

Kind regards,
Pavel

Dear sir
Thanks for ur support. Im attaching the snapshot of coding.If i not multipy with 1000000 then source bone remians too small or invisible. But i read in the tutorials that stl cad file should scale like that xyz (.001,.001,.001). First i done this way in coding but result was same.
We do not have the mimics landmark simulation versions. How can be the coordianate points of source and target bones can be aligned to get proper merge. i was enalble to find out the tutorials regarding that how to stl files can be aligned.Plz give the link of that tutorials.
Thanks.
Regards,
Mohit.

Dear Mohit,

Your image quality is very bad - i cannot see the code. I think you still have the same problems that i described in my previous message. So please reread it.

Secondly, to align to bone you need to construct a AnyFunTransform3DLin2 transformation that will align two bones based on the anatomic landmarks (REMEMBER the units). The code should look like:


AnyFunTransform3DLin2 reg_rigidbody = {
Points0 = {.. matrix of points here..}; // for unscaled AnyBody femur
Points1 = {.. matrix of points here..}; // for the target femur
Mode = VTK_LANDMARK_RIGIDBODY;  // Rigid body registration
};
AnyFunTransform3DLin2 reg_affine = {
Points0 = {.. matrix of points here..}; // for unscaled AnyBody femur
Points1 = {.. matrix of points here..}; // for the target femur
Mode = VTK_LANDMARK_AFFINE;  // Registration with affine deformation
};
// Visualize results
AnyFixedRefFrame GlobalRefFrame = {
AnyDrawSurf source = {
FileName="source_femur_file_name_here.stl";
AnyFunTransform3D &scaling = ..reg_rigidbody; // or ..reg_affine;
};
AnyDrawSurf target = {
FileName="target_femur_file_name_here.stl";
};
};

This small model should just work. Please feel the places where you need to add points and filenames.

Please also consider trying the Scaling tutorial.

Regards,
Pavel

Thanks for very quick reply.
Im attaching the file of coding and source femur.
Im again reading the tutorials.These types of problems occuring since i am working with my own created targetfemur.But before that with the bones given in the tutorials i have been successfully completed the tutorials.
Thanks again.:slight_smile:

Mohit,

Your code looks fine. Could it be that you scaled the target femur down to micrometers? Please check (I very much suspect so). Because this is the only possibility for your model to produce this result.

Here is the corrected code and explanation how you can register SourceFemur2 to TargetFemur3 - the picture will show SourceFemur2 on top of the TargetFemur3.


 // Todo: Write a small description of your model here

Main = {

  // The actual body model goes in this folder
  AnyFolder MyModel = {

    // Global Reference Frame
    AnyFixedRefFrame GlobalRef = {

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

    };  // Global reference frame

    AnyFunTransform3DLin2 reg = {
      Points0 = ... PointsConsistentWithSourceFemur2.stlHERE ...;
      Points1 = ... PointsConsistentWithTargetFemur3.stlHERE ...;
      Mode = VTK_LANDMARK_RIGIDBODY;
    };
    
    AnySeg SourceFemur2 = {
      Mass = 0; Jii = {0, 0, 0};
      AnyDrawSurf Surface = {
        AnyFunTransform3D &fun = ..reg;
        FileName = "SourceFemur2.stl";
      };
    };

    AnySeg TargetFemur = {
      Mass = 0; Jii = {0, 0, 0};
      AnyDrawSurf Surface = {
        FileName = "TargetFemur3.stl";
      };
    };
    
  }; // MyModel

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

};  // Main


The only thing you need to do is find a set of corresponding points:
Points0 = … PointsConsistentWithSourceFemur2.stlHERE …;
Points1 = … PointsConsistentWithTargetFemur3.stlHERE …;

Regards,
Pavel

Thanks .
Sir, I want to know that what is the criteria to find out the exact values of points 0 and 1 which i have to put into coding as you said for the alignment? Is it a hit and trial method or any predefined path to follow. How the value of points in the tutorial exercise problem which exactly align the source and target are found?
Regards,
Mohit Kumar.

Dear Mohit,

It’s an interpolation problem - you select points A on the source surfaces that you want to be points B on the target surface exactly. Everything else will be interpolated/extrapolated. So it is important that you select corresponding landmarks and these landmarks capture the overall shape of the bones. So typically i select most outstanding points and cavities to capture masses and curvatures of the bones.

It is difficult to give recommendation because most of the bones are very different from each other. You need to find a set that works best for you if you need to do many morphings, but if it is just one that you need - you can select matching landmarks that are easy to select for this particular case.

The suggested set in the tutorials is a good starting guess for a femur morphing. You might also try the landmark set in the Lesson3/Appendix for the vertebra. Recommendations for some other bones might be added in the future, but are not available yet.

Kind regards,
Pavel

1 Like

Thanks.
Sir one more question Let suppose my source and target not merge properly after this coding but i still perform all remaining exercise of subject specific problem.Then is it will a correct approach for my problem?

It should incrementally increase the accuracy:
Step 1) Affine registration (rough linear scaling, but bones are aligned)
Step 2) RBF deformation (rough non-linear scaling to achieve better match for the next step, bones are aligned)
Step 3) STL RBF deformation (precise non-linear scaling to achieve final result, bones are aligned and almost identical)

Just like Lesson3 of the Tutorial says. If something goes different - check your input parameters.

Regards,
Pavel

1 Like

Dear Sir,
im attaching the model view of the problem after filling points.I want to know that should now i go to the next step (RBF deformation) of scaling or still work on values of points that both the bones merge properly?
Thanks.

Sorry,file is attched here.

This is not good. You should get two bones on top of each other. You need two sets of !!corresponding!! points.

For example - Lesser Trochanter peak on the source to the Lesser Trochanter on the target surface and so on.

I see that your selection of points is still wrong.
You can visualize those sets by using AnyDrawPointCloud class. Please read the reference manual on the class. I recommend to use Points3D =On;.

Regards,
Pavel

Thanks a lot,i m trying as you suggested.
One question i want to ask that if i want to use tutorials target femur file for the fea analysis in abaqus. So this target femur file is in the ascii format. As MIMICS does not allow editing ascii files so we are enable to make the mesh.
Is there any solution to this query ?
Regards,
Mohit

Dear Mohit,

It does not sound like an AnyBody question. Unfortunately I do not know Materialise products to the extend to help with meshing options - please try the support team of Materialise.

Regards,
Pavel

Dear sir
im using the anybody target femur for fea analysis. I complete the scaling tutorial. And have been created mesh in .inp. Now im using Any2abaqus for creating anybody .inp output file.
First i created xml load file but when im trying to create the .inp output then any2abaqus is not working. i have been already check the license file is placed properly.
Im attaching the coding ad mesh.
Regards
Mohit

Dear Mohit,

I could not open your target mesh. Please upload again.

It would also be fantastic if you explain what kind of error you get.

Kind regards,
Pavel

Dear sir
The problem is that when i click on the anytoabaqus tool for generating the final .inp file. The simulating nodal window in black colur disappears automaticaly. And in the output folder .inp file is not generating.
Thanks.