Using Displacement Map to Deform or Morph a Segment/Model

Hello,

Is it possible to use a displacement map/volume, like the output from the Model to Model Distance module, to deform or morph another segment/volume/model? Even if it just a simple approximation.

I am trying to simulate the stretching of the skin over the advancement of multiple skull segments.

You can very easily warp a model using displacement field stored for each point of the mesh (see VTK: vtkWarpVector Class Reference). However, I’m not sure if Model to Model Distance extension provides displacement vectors. Anyway, if you want to align surface models then you can probably get better results with model registration modules.

@lassoan,

I found this post and I am trying to repeat the process;

First, I ran Model To Model Distance and created D_rev2orig as the “displacement model”
Additionally, I have a “target” model D_ST which I would like to warp/deform.


Here is what I am doing to warp the “target” model;

dispModel = getNode("D_rev2orig")
targetModel = getNode("D_ST")

dispMesh = dispModel.GetMesh()
dispMesh.GetPointData().SetActiveVectors("PointToPointVector")

warp = vtk.vtkWarpVector()
warp.SetInputData(dispMesh)

warp.SetScaleFactor(1.0)
warp.Update()
targetModel.SetPolyDataConnection(warp.GetOutputPort())

This overrides the D_ST “target” model and generates a weird hybrid model;

This model has the PointToPointVector attribute from the displacement model D_rev2orig, but does not have the geometry of the “target” model. The geometry is not the same as the “displacement model” however, so maybe I am just missing something in the script above?

I’m not sure what “PointToPointVector” vector contains, but I guess it is something like vector to the closest point. This vector field can be very noisy and discontinuous, so I would not use it to warp a surface. Instead, I would try to use one of the surface registration methods.

Can you write a bit more about your end goal? You wrote above that “I am trying to simulate the stretching of the skin over the advancement of multiple skull segments.”, but this is not very clear for me. Displacement of rigid bone pieces and geometric interpolation between them will not tell much about how the skin will move or stretch. For that you would probably need to run FEM analysis, for example using FEBio.

Can you write a bit more about your end goal? You wrote above that “I am trying to simulate the stretching of the skin over the advancement of multiple skull segments.”, but this is not very clear for me.

Of course!
The model representative of the bone segments here, also carrying the Model To Model Distance data, is the result of a Fronto-Orbital Advancement planning done using Slicer. I ended-up creating two posts about this problem because I wanted to separate this final step from the entire planning discussion.

My goal was to use either the Bandeau Model itself or the Model To Model Distance data to then warp or deform the skin to match the overall advancement of the bones.

This vector field can be very noisy and discontinuous, so I would not use it to warp a surface. Instead, I would try to use one of the surface registration methods.

I have been using registration methods to warp the model also. So far creating a warp transform from fiducial registration has given me the best results, but the result can only be improved with the addition of more landmark and with manual registration. The limit is 30 landmarks and warp transforms do not support the automatic registration.

I was working on Python script that would use the vertices of the source and target models as landmarks, but the registration was falling apart. If you think this is a viable approach, I can continue to explore this… I was thinking of sorting the vertices along the AP so that vertices would match somewhat better between models. In this case I am still limited by the 30 point limit. Is this a hard limit or just a warning about # computations?

Displacement of rigid bone pieces and geometric interpolation between them will not tell much about how the skin will move or stretch. For that you would probably need to run FEM analysis, for example using FEBio.

I agree. In fact, I was planning to use FEBio too. My hope was to, at the very least, get some sort of nodal displacement field that I can use in FEBio to run the simulation a little more programmatically.

Perhaps I can improve the warp transform and convert it to a grid transform, vector volume, or displacement volume? :thinking:

Let me know if this is a little clearer now,

There should be no limit on number of points for registration, just the computation will get slower. To make computation fast, you can create bspline transform from the scattered landmark points using ScatteredTransform extension.

The main issue with transforms is that the deformation is constrained to be smooth, but it does not mean that the deformation will be realistic (e.g., bones may be stretched).