[vtkusers] vtkThinPlateSplineTransform propogation
David Gobbi
david.gobbi at gmail.com
Wed May 4 14:06:33 EDT 2011
Yes, the vtkGridTransform just uses a vtkImageData made of
three-component scalars i.e. dx, dy, dz. Leave the shift/scale
values at their default values of shift=0 and scale=1. These
are only meant for if you want to store the displacements as
char or short to save memory.
The spacing/origin/extent of the grid data must be set so that
displacement vectors in the grid lie at the desired points on your
plane.
- David
On Wed, May 4, 2011 at 11:51 AM, Dean Inglis <dean.inglis at camris.ca> wrote:
> Hi David,
>
> I sort of understand how the spline transform works.
> As an example, say the reference lines are stored
> as vtkPoints in XYcurvedLinePoints and XYstraightLinePoints ,
> and all points are at location z = 0
>
> transform->SetTargetLandmarks( XYcurvedLinePoints )
> transform->SetSourceLandmarks( XYstraightLinePoints )
>
> tempZ = queryPoint[ 2 ]
> queryPoint[ 2 ] = 0
> transform->TransformPoint( queryPoint, transPoint )
> transPoint[ 2 ] = tempZ
>
> here the queryPoint lies on the flat surface and the transPoint
> now lies on the curved surface.
>
> I dont understand how I can use vtkGridTransform since it takes
> a vtkImageData as input and two sets of points. Would I make a 2D
> image of floats (3 components) repesenting the dx,dy,dz's from each
> pair of corresponding curve/straight point locations over both surfaces?
> What effects would the displacment shift and scale have?
>
> thanks,
> Dean
>
> ----- Original Message ----- From: "David Gobbi" <david.gobbi at gmail.com>
> To: "Dean Inglis" <dean.inglis at camris.ca>
> Cc: <vtkusers at vtk.org>
> Sent: Wednesday, May 04, 2011 12:26 PM
> Subject: Re: [vtkusers] vtkThinPlateSplineTransform propogation
>
>
> Hi Dean,
>
> Since your points are evenly spaced and one of your surfaces is
> flat, you might be better off with the vtkGridTransform. It is much
> faster, it does not slow down as you add more points, and it should
> be well-behaved over all of 3D space even if contains control points
> mapping just a single straight line to a single contour.
>
> - David
>
>
> On Wed, May 4, 2011 at 5:27 AM, Dean Inglis <dean.inglis at camris.ca> wrote:
>>
>> I have a ruled surface composed of a spline curve defined in
>> an x-y plane and extruded along the z axis. I have a corresponding
>> ruled surface which is essentially the same surface but ironed flat;
>> a rectangular plane, hence, the corresponding curve is a straight line.
>> The points are regularly spaced along the
>> curve and parallel curves along the z axis are equally spaced.
>> The number of points (can be tens to hundreds) along any x-y cut through
>> either surface
>> (ie a curve or line) is the same. I want the transform that relates
>> coordinates of points
>> forming the flattened surface to those of the curved surface. If I use
>> vtkThinPlateSplineTransform for
>> relating points in the bottom line of the flat surface to the
>> corresponding
>> points
>> in the curved suface, the transform is fast and works perfectly, but as I
>> traverse upward
>> to other areas of the surface the correspondance diminishes. If I include
>> additional points, as in from a pair of middle curves and a pair of top
>> curves,
>> the correspondance is better, but diminishes in between those regions,
>> and,
>> furthermore,
>> the number of points significantly increases, slowing the transformation
>> calculations drastically.
>> Is there a way to propogate the transformation from only one set of curve
>> pairs?
>> I have looked at the code in vtkThinPlateSplineTransform but I have no
>> idea
>> where
>> to begin making modifications.
>>
>> thanks,
>> Dean
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
>
More information about the vtkusers
mailing list