[vtkusers] Re: Scaling data in a vtk file

Prashanth Dumpuri prashanth.dumpuri at vanderbilt.edu
Mon May 1 12:14:57 EDT 2006


Adrian,
  Look into vtkTransform to set the scaling and vtkTransformFilter to
apply the scaling.  
http://www.vtk.org/doc/release/4.2/html/classvtkTransform.html

http://www.vtk.org/doc/release/4.2/html/classvtkTransformFilter.html

Here's a sample Tcl script.

vtkTransform xform
  xform Scale(1000,1000,1000)

vtkTransformFilter xformer
  xformer SetTransform xform
  xformer SetInput <your vtk_point_set/vtk_data_set>
  xformer Update

[xformer GetOutput] gives you the transformed point set.

Hope this helps,
Prashanth

> Message: 1
> Date: Sun, 30 Apr 2006 13:59:50 -0400
> From: "Adrian Suszko" <adriansuszko at rogers.com>
> Subject: [vtkusers] Scaling data in a vtk file
> To: <vtkusers at vtk.org>
> Message-ID: <000401c66c7f$e04f0800$667ba8c0 at prankmunky>
> Content-Type: text/plain; charset="us-ascii"
> 
> I am relatively new to VTK and I am curious if there is anyway to change the
> scale of all points in a VTK file. For instance I have two vtk files which I
> wish to perform an image registration on. One of the files was recorded in
> meters while the other was recorded in millimetres. I have obtained the
> transformation matrix correctly (after internally scaling the data) but now
> I wish to apply to the transform to the vtk file but it is still in
> millimetres. Is there any function that will take my vtk function and
> multiply all points by 1000, so that it is scaled up into meters?
> 
>  
> 
> Adrian 





More information about the vtkusers mailing list