Personalizing the model with CT images

Hello AnyBody forum,

I would like to customize my model using patient specific segments for thighs, shins and kneecaps, but following the tutorial my model looks very strange.

I know that I have to use a mesh with the same topology as the starting one and I have already remeshed it using a python script. What I am not sure of at this point is if I am using the right starting mesh. I am now using a mesh exported from the unscaled StandingHuman model, extracted in local coordinates. I also tried changing some transformation parameters, but this is not working.

Another possible problem is that I'm not using the same landmarks as in the tutorial for rigid transformation, but that shouldn't be a problem as long as the points are consistent between source and target, right? And if I have to necessarily take the same points instead, where can I find these points on shank and patella?

I hope you can help me with my problem.
Looking forward to hearing from you, thanks in advance!

Hi Vera,

Yes, typically the problem is that the surfaces or landmarks do not correspond the original AnyBody geometry, and, hence, the constructed transformation becomes unrelated to the generic AnyBody bone and creates a weird shape.

When you say 'unscaled StandingHuman model' - do you mean that you used our standard StandingModel to export ? This one is actually scaled to represent the 50th percentile male. We need the scaling law to be _SCALING_NONE _

You can quickly test your input by adding this code and specifying the highlighted filename:

Main.HumanModel.BodyModel.Right.Leg.Seg.Thigh = {
  AnyDrawSurf TestMorphingFemur = {
    FileName="my_femur_file.stl";
    AnyFunTransform3D &Scale = .Scale; RGB={1,0,0};
 };
};

If the red surface matches the AnyBody right femur - everything is correct.

The consistent landmarks should work fine as long as the geometries are correct.

Let me know if this helps - if not, we can have a look at your code.

Kind regards,
Pavel

Hi Pavel,

Thank you very much for your answer!
The red femur is almost matching with the model, but the shape looks strange.

These are my femurs with the same topology, on the right is the one from "StandingHuman model" with SCALING_NONE.

And this is my model:
Cattura1

Best regards,
Vera

Hi Vera,

The surfaces do NOT match (red and the AnyBody one) - they should get 'strange' together. To me this indicates that something went wrong when the source surface was saved. This might also be the reason that the shape is strange. Could we do just one more test (without any scaling) to avoid any doubt - try the following code:

AnyFixedRefFrame MyGlobal = {
AnyDrawSurf srfAnyBodySource = {
  FileName =Main.HumanModel.BodyModel.Right.Leg.Seg.Thigh.Drw3.FileName; RGB={1,1,0};
 };
AnyDrawSurf srfMySource = {
  FileName = "my_source_femur.stl"; RGB={1,0,0};
 };
};

We need to make sure that we use correct surfaces and landmarks to construct morphing transformations - otherwise it goes wrong, because it will not be related to the undeformed AnyBody bones. Could you make sure you use this statement, when you export the right femur?

If the surfaces are exactly the same, then something else is the problem. In that case, can you share your model for me to have a quick look? I might be able to tell more.

Kind regards,
Pavel

P.S. You can also display all your landmarks using AnyDrawPointCloud to make sure everything is consistent.

Hi Pavel,

Thank you very much for your help.
image
As you can see the two femurs overlap very well, so I think the problem is not the source femur. However, when I look at the landmark points, I realized that these actually do not overlap the bone surface. So I think the error is here!
image
(black points are refered to the source, white points to the target)
When I choose the coordinates I did it through the Paraview software, is this correct or do you recommend other methods? Perhaps Paraview makes some changes to the file.

Thank very much for your help, I will try to select again the landmars and I will let you know.

Best regards,
Vera

There we go :slight_smile: I hope it goes smoothly from here.
I use MeshLab for point picking - it does the job.

Kind regards,
Pavel

Hi Pavel,

I fixed my landmarks, but unfortunately the problem persists.
image
I noticed that if I delete "TSeg2ScaleFrame" from the point definition I get the femur I want, but the rest of the model is not scaled based on that.
image
So I thought maybe I should scale the femur before I put it in the code, what do you think? Would that solve my problem?I noticed that if I delete "TSeg2ScaleFrame" from the point definition I get the femur I want, but the rest of the model is not scaled based on that. So I thought maybe I should scale the femur before I put it in the code, what do you think? Would that solve my problem? However, shouldn't this functionality already be included in the rigid transformation?

Thank you,
Vera

Hi Vera,

The rest of the model will not get scaled if you morph only the femur - unfortunately it is not that smart. You can either use corresponding anthropometric scaling and check that the bones are consistent, or add morph the rest of the bones.

Regarding the problems - I think I will need to see how everything is done. Could you make a screenshot/share your model?

Kind regards,
Pavel

Hello Pavel,

I morphed also the shank and the patella and now the model looks good, even if I didn't use the "TSeg2ScaleFrame" transformation, as recommended in the tutorial.

Thank you very much,
Vera

1 Like

This topic was automatically closed 125 days after the last reply. New replies are no longer allowed.