[vtkusers] 2D ImageManipulation

David Gobbi dgobbi at irus.rri.ca
Thu Jun 14 15:01:31 EDT 2001


On Thu, 14 Jun 2001, TJ Wilkinson wrote:

> I am trying to find the correct functions to manipulate a 2D image - that
> is, rotate it.  I am looking at vtkImageReslice, but I am not sure if this
> is the right tool.

It is.  The easiest way to rotate an image is like this (python syntax):

transform = vtkTransform()
transform.RotateZ(-angle)

reslice = vtkImageReslice()
reslice.SetInput(something.GetOutput())
reslice.SetResliceAxes(transform.GetMatrix())
reslice.SetInterpolationModeToCubic()

That should be sufficient.  There is also a RotateImage.tcl/py example
in the nightlies.

 - David





More information about the vtkusers mailing list