[vtkusers] VS: ÄvtkusersÅ Rewirte vtkImageData

Hämäläinen Janne Janne.Hamalainen at hus.fi
Thu Aug 14 03:44:09 EDT 2003


As I understand (someone can correct, if I'm wrong), if you deepcopy the
contents of your reslice output to your original vtkImageData:

	1.	        self.image.DeepCopy(img_reslice.GetOutput())

the vtkImageReslice doesn't update, because the visualization pipeline
doesn't have any knowledge about it (it has only reference to the object
that lies before reslice, and that is passed to display). On the other hand,
if you copy a reference of the output to your original image:

	2.	#	self.image = img_reslice.GetOutput()      # doesn't
work either

you have an infinite loop
(self.image->img_reslice->self.image->img_reslice...); I don't remember what
vtk does in this kind of situation. 

So, my suggestion is to use the second model (2.), but make an own object
for the transformed image instead of copying it to self.image. That way,
your pipeline will be complete. Hope this helps,

-Janne


--
Janne Hämäläinen
Research Assistant
Helsinki University Central Hospital 
X-ray Department				

email   janne.hamalainen at hus.fi


> ----------
> Lähettäjä: 	Yi-Yu Chou[SMTP:chouyiyu at hotmail.com]
> Lähetetty: 	13. elokuuta 2003 23:56
> Vastaanottaja: 	vtkusers at vtk.org
> Aihe:  	ÄvtkusersÅ Rewirte vtkImageData
> 
> Hi all,
> 
> I tried to rewrite the transformed image back into the original 
> vtkImageData, but 
> nothing happened after transform. ( the image was unchanged)
> My code : 
> 		img_transform = vtkTransform()
> 		img_transform.RotateX(-10)		
> 		img_reslice = vtkImageReslice()
> 		img_reslice.SetInput(self.image)
> 	
> img_reslice.SetOutputSpacing(img_reslice.GetInput().GetSpacing())
> 	
> img_reslice.SetOutputOrigin(img_reslice.GetInput().GetOrigin())
> 	
> img_reslice.SetOutputExtent(img_reslice.GetInput().GetWholeExtent())
> 		img_reslice.SetResliceTransform(img_transform)
> 		img_reslice.SetInterpolationModeToCubic()
> 		img_reslice.Update()
> 	#	self.image = img_reslice.GetOutput()      # doesn't work
> either
> 	        self.image.DeepCopy(img_reslice.GetOutput())
> 		self.Update_Display()    # update the scene
> 
> Any suggestions ?????
> Thanks !!!!
> 
> YY
> 
> _________________________________________________________________
> ?? MSN ??:????????????????? 
> http://groups.msn.com?pgmarket=zh-tw  
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at:
> <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 



More information about the vtkusers mailing list