Discussion:
[vtkusers] vtkWarpInverseTransformPoint
Ruurd Kuiper
2018-11-19 15:57:02 UTC
Permalink
Dear all,

I am trying to understand the vtkWarpTransform
method vtkWarpInverseTransformPoint, so I can implement it in my own code.
My goal is to inverse a 3D displacement field image (so 4 dimensions
including the displacement vector). However, my results are always
different from the results I get by using the vtk.

I think my problem might be caused either by the way points that reside on
the borders of the image are handled, or by a misunderstanding of
TemplateTransformPoint(inverse,deltaP,derivative) (line 145) in
vtkWarpTransform. I was not able to find the source code in which either of
this is described. Does anyone have a link to this?

Kind regards,

RK
David Gobbi
2018-11-19 16:21:16 UTC
Permalink
Hi RK,

Take a look at the subclasses of vtkWarpTransform shown here:
https://www.vtk.org/doc/nightly/html/classvtkWarpTransform.html

The vtkGridTransform and vtkBSplineTransform subclasses probably already do
what you need, i.e. both of them can be used to invert a 3D displacement
field image. The vtkGridTransform method is easier to use, while the
vtkBSplineTransform provides a smoother result.

More information about the vtkBSplineTransform is provided at the following
link (use the "Download Paper" button). In order to use this class, the
displacement field image must be converted into spline coefficients via the
vtkBSplineCoefficients class. The following code shows how
vtkBSplineCoefficients can be used for this purpose:
https://gitlab.kitware.com/vtk/vtk/blob/master/Filters/Hybrid/Testing/Cxx/TestBSplineTransform.cxx#L158

A description of the implementation of vtkWarpTransform and
vtkGridTransform is provided in the following publication. Apologies for
the paywall. https://www.ncbi.nlm.nih.gov/pubmed/12631510

Regards,
David
Post by Ruurd Kuiper
Dear all,
I am trying to understand the vtkWarpTransform
method vtkWarpInverseTransformPoint, so I can implement it in my own code.
My goal is to inverse a 3D displacement field image (so 4 dimensions
including the displacement vector). However, my results are always
different from the results I get by using the vtk.
I think my problem might be caused either by the way points that reside on
the borders of the image are handled, or by a misunderstanding of
TemplateTransformPoint(inverse,deltaP,derivative) (line 145) in
vtkWarpTransform. I was not able to find the source code in which either of
this is described. Does anyone have a link to this?
Kind regards,
RK
Loading...