[vtkusers] Molding an image slice

David Gobbi david.gobbi at gmail.com
Tue Mar 21 08:54:58 EDT 2017


Hi Shark,

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.

Then you can use e.g. vtkGridTransform or vtkBSplineTransform with
vtkTransformPolyDataFilter to warp the plane, or perhaps vtkWarpVector.

Regards,
 - David


On Tue, Mar 21, 2017 at 6:26 AM, Shark <m.nunes at fratoria.com> wrote:

> Hello,
>
> I have been trying for some days to "mold" a 3D image slice. (imagine a
> towel in the wind)
>
> What I mean is that I have a 2D slice, extracted from a 3D vtkImageData,
> and
> one 3D vector for each pixel of the slice. I want to
> translate/transform/move each pixel from the 2D slice to a 3D position (and
> augmenting the extent of the 2D slice in x,y,z when necessary) while
> keeping
> these pixel stitched together. I believe my knowledge of all VTK filters is
> not that great, so I think something is already implemented for this, but I
> cannot find it.
>
> Currently, my line of thinking is: create an unstructured grid, apply the
> vectors transformation, create a new vtkImageData from this transformation
> and map the pixel values through ids (cell IDs? point IDs? ).
>
> In the end I would see a slice stretched, compressed and bent up, down and
> to the sides.
>
> Thank you!
> shark
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170321/740209bb/attachment.html>


More information about the vtkusers mailing list