[vtkusers] vtkImageData

樱木 tonywearme at 163.com
Wed Jan 31 23:26:25 EST 2007


hi, all vtk users,

In my current project, I want to set a new origin of vtkImageData object, but fail. After testing, I find "UpdateInformation()" seems to clear away my newly-set origin. Blow is a simple piece of code from my project.How can I successively set the origin of my vtkImageData object ?   And in vtk4.2 my project runs ok but in vtk4.4 the origin cannot be set, and I compare "UpdateInformation()" in both 4.2 and 4.4, they seem to be identical ? So I've no idea now.
I'm just a new learner of VTK, is there anything I ignore ? hanks in advance!


''' reader is an instance of vtkMINCReader '''
_imageData = reader.GetOutput()		#vtkImageData

print _imageData.GetOrigin()     	#1 suppose (125, 124.981, -2.27655)
_imageData.SetOrigin(0,0,0)
print _imageData.GetOrigin()		#2 ok, (0, 0, 0)

_imageData.UpdateInformation()
print _imageData.GetOrigin()		#3 sorry, back to (125, 124.981, -2.27655) in vtk4.4, but ok (0,0,0) in vtk4.2



	

        

                                
								IGST Lab, Software School
 				                Shang Hai Jiao tong University(SJTU)

        yingmu
        tonywearme at 163.com
          2007-02-01


More information about the vtkusers mailing list