<div dir="ltr">Note: if you get a warning when you click the link to the example, try again without https:<div><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/TextureMapPlane">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/TextureMapPlane</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 21, 2017 at 7:10 AM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Here is an example of applying a texture map to a plane (the warping step would have to be added).</div><a href="https://www.vtk.org/Wiki/VTK/Examples/Cxx/Visualization/TextureMapPlane" target="_blank">https://www.vtk.org/Wiki/VTK/<wbr>Examples/Cxx/Visualization/<wbr>TextureMapPlane</a><br><div><br></div><div>To properly set up the vtkPlaneSource to match the image geometry, it would be necessary to use these methods:</div><div>plane->SetResolution(xdivs, ydivs);</div><div>plane->SetOrigin(<coords of image corner (0,0)>)</div><div>plane->SetPoint1(<coords of image corner (1,0)>)</div><div>plane->SetPoint2(<coords of image corner (0,1)>)<br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 21, 2017 at 6:54 AM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Shark,<div><br></div><div>I think the most efficient option would be a vtkTexture on a vtkPolyData. You can use vtkPlaneSource to make a polydata that has as many points as your image has pixels. If necessary, you can use vtkTransformTextureCoords to tweak the texture coords.</div><div><br></div><div>Then you can use e.g. vtkGridTransform or vtkBSplineTransform with vtkTransformPolyDataFilter to warp the plane, or perhaps vtkWarpVector.</div><div><br></div><div>Regards,</div><div> - David</div><span><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 21, 2017 at 6:26 AM, Shark <span dir="ltr"><<a href="mailto:m.nunes@fratoria.com" target="_blank">m.nunes@fratoria.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
I have been trying for some days to "mold" a 3D image slice. (imagine a<br>
towel in the wind)<br>
<br>
What I mean is that I have a 2D slice, extracted from a 3D vtkImageData, and<br>
one 3D vector for each pixel of the slice. I want to<br>
translate/transform/move each pixel from the 2D slice to a 3D position (and<br>
augmenting the extent of the 2D slice in x,y,z when necessary) while keeping<br>
these pixel stitched together. I believe my knowledge of all VTK filters is<br>
not that great, so I think something is already implemented for this, but I<br>
cannot find it.<br>
<br>
Currently, my line of thinking is: create an unstructured grid, apply the<br>
vectors transformation, create a new vtkImageData from this transformation<br>
and map the pixel values through ids (cell IDs? point IDs? ).<br>
<br>
In the end I would see a slice stretched, compressed and bent up, down and<br>
to the sides.<br>
<br>
Thank you!<br>
shark<br><br>
</blockquote></div><br></div></div></span></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>