[vtkusers] Help !!! vtkImageReslice

Yi-Yu Chou chouyiyu at hotmail.com
Fri Aug 15 17:00:13 EDT 2003


Hi all,

I want to rotate a 3D volume (vtkImageData)  around  its center by using 
vtkImageReslice.
Below is my code :

self.image.SetOrigin(ori_x,ori_y,ori_z)  # set the origin of the original 
image to center
                                                      # because the (x,y,z) 
coordinate of (0,0,0) is at upper-left corner
                                                      # (ori_x,ori_y,ori_z) 
is the center    
img_transform = vtkTransform()
img_transform.RotateY(theta)		
img_reslice = vtkImageReslice()
img_reslice.SetInput(self.image)
img_reslice.SetInformationInput(self.image)
		
img_reslice.SetResliceTransform(img_transform)		
img_reslice.InterpolateOn()
img_reslice.Update()
self.new_image = img_reslice.GetOutput()
self.new_image.SetOrigin(0,0,0)

However, I got a strange resulte, the image seems not rotated around its 
center.
Any suggestions ?
Thanks in advance !!!

YY

_________________________________________________________________
免費試聽 MSN 英語學習:和真人老師線上學英文 http://www.msn.com.tw/english/ 




More information about the vtkusers mailing list