[vtkusers] Rotate vtkImageData

KS Jothybasu jothybasu at gmail.com
Mon Mar 15 10:15:17 EDT 2010


Hi,

I wanted to rotate the vtkImageData and I am using vtkTransform to do that.
But how to rotate around the Image centre. I get the Image centre from
vtkImagedata.GetCenter() method. But when I view the image it seems to be
shifted.Here is the code

xform=vtk.vtkTransform()
xform.PostMultiply()
#xform.RotateWXYZ(10,218.0732421875, 218.0732421875, 158.75)
x,y,z=Image.GetCenter
xform.RotateWXYZ(50,x,y,z)# rotate 50 degs
res=vtk.vtkImageReslice()
res.SetInput(Image.GetOutput())
res.SetInformationInput(Image.GetOutput())
res.SetResliceTransform(xform)
res.SetInterpolationModeToLinear()
res.Update()

Whats wrong??

Thanks

Jothy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100315/9080cedb/attachment.htm>


More information about the vtkusers mailing list