Morphing vertebra issues

Hello AnyBody Community,

I am seeking your assistance regarding an issue I am facing with morphing the L4 vertebra from the AnyBody model into my CT scan L4 vertebra.

I followed the same steps as outlined in this tutorial (Lesson 1: Personalizing individual segments based on geometric data from medical images — AnyBody Tutorials v7.4.3); however, I am encountering some unusual results when using the affine transformation and the rigid body transformation.

For the landmarks, I utilized the insertion points of the ligaments on the surface of the L4 vertebra, as they were present in my model, and I could obtain the coordinates of those points from AnyBody.

Here, you can see the landmarks that I selected. In the Point0 matrix are the coordinates on the AnyBody model (source), and in Point1 are the coordinates of the Abaqus Model (target):

When I follow the tutorial I get this result :

LinTransf

In grey is the "morphed" vertebra, and in yellow is the original one.

If you have any insights into why it is not working, whether it's a coding error or an issue with my chosen landmark, I would greatly appreciate your assistance.

Thank you in advance for your help.

Kind Regards,
Mariam

Hi Mariam,

Could you show the code how you are drawing these surfaces and applying the scaling function?

I am also a bit suspicious about the target landmarks (13mm from smallest to largest value on Y component). Could you try visualizing your landmarks against your surface?

AnyDrawPointCloud landmarksTarget = { // Same ref. frame as the surface
PointStyle = {
Style = PointStyleSphere;// Marker style.
Size = 0.005;// Size of markers.
};
Points3D = On;
RGB= {1,0,0};
Points= 0.001*..MyTransform.Points1; //CORRECT THIS PATH
};

If all landmarks match the surfaces and you apply transformations correctly it should make sense.

Kind regards,
Pavel

Hi Pavel,

Thank you for your answer.

Regarding the code, I followed the same syntax as the tutorial. Below, you can find the code that describes how the drawing and transformations are applied to the segment.

codescaling

I visualized my landmarks and some of them were indeed out of place. I also deleted some of them and it worked better. I was able to do all of the other transformations afterwards.

Thank you for your help,

Mariam

Good to hear.

But I cannot help but notice that your AnyBody surfaces are called "L4Any_GlobalRef". For morphing, we always use local ref. frame and non-scaled model to export surfaces and landmarks. This may cause that your scaling would work for your test disconnected test, but not when you include it into the human model. I hope it is just naming :slight_smile:

Kind regards,
Pavel

Hi Pavel,

You guessed the name right. I initially utilized the STL file in the global reference frame for scaling. I recognized my mistake while doing the tutorial on implementing scaling directly into my model. However, I followed the tutorial instructions without using the TSeg2ScaleFrame Transform, and it surprisingly seems to work. Below is a picture showing the scaled L4 vertebra (circled in red) inside the model. Do you think there might still be issues if the scaling is done this way ?

L4ScaledPNG

Nevertheless, I also re-did the entire scaling process using the local reference frame of the vertebra to ensure accuracy.

Kind Regards,

Mariam

Hi Mariam,

If you are happy - then I am happy :))
But generally speaking we want the source surface and landmarks to be exactly in the non-scaled configuration in the local ref. frame. This is because our morphing function will be exactly to those entities. If it is not - it might introduce an error that hard to find - just be aware. Sometimes it is difficult visually to assess scaling from 120% to 118%. May not look critical, but there will be a difference.

Kind regards,
Pavel

Hi Pavel,

Thank you for the explaination, I will keep it in mind while working with model.

Kind Regards,
Mariam