<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi RK,<div><br></div><div>Take a look at the subclasses of vtkWarpTransform shown here: <a href="https://www.vtk.org/doc/nightly/html/classvtkWarpTransform.html">https://www.vtk.org/doc/nightly/html/classvtkWarpTransform.html</a></div><div><br></div><div>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.</div><div><br></div><div>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: <a href="https://gitlab.kitware.com/vtk/vtk/blob/master/Filters/Hybrid/Testing/Cxx/TestBSplineTransform.cxx#L158">https://gitlab.kitware.com/vtk/vtk/blob/master/Filters/Hybrid/Testing/Cxx/TestBSplineTransform.cxx#L158</a></div><div><br></div><div>A description of the implementation of vtkWarpTransform and vtkGridTransform is provided in the following publication. Apologies for the paywall. <a href="https://www.ncbi.nlm.nih.gov/pubmed/12631510">https://www.ncbi.nlm.nih.gov/pubmed/12631510</a></div><div><br></div><div>Regards,</div><div> David</div><div><br></div><div><br><div class="gmail_quote"><div dir="ltr">On Mon, Nov 19, 2018 at 8:57 AM Ruurd Kuiper <<a href="mailto:ruurd.kuiper@gmail.com">ruurd.kuiper@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><span style="font-family:Helvetica,Arial,sans-serif;font-size:14px">Dear all,</span></div><div style="font-family:Helvetica,Arial,sans-serif;font-size:14px"><br></div><div style="font-family:Helvetica,Arial,sans-serif;font-size:14px">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. <span style="font-family:Arial,Helvetica,sans-serif;font-size:small"></span></div><div style="font-family:Helvetica,Arial,sans-serif;font-size:14px"><br>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? </div><div style="font-family:Helvetica,Arial,sans-serif;font-size:14px"><br></div><div>Kind regards,</div><div><br></div><div>RK</div></div>
</blockquote></div></div></div></div></div></div>