[vtkusers] Re: Rewirte vtkImageData

Yi-Yu Chou chouyiyu at hotmail.com
Thu Aug 14 11:13:36 EDT 2003


Hi Janne,

Thanks for your suggestions.
For the second model, is it possible to "clean" self.image before rewriting 

self.reslice to it ? Therefore, my code would be like :
                ..................................(skip)
 	        img_reslice.SetInput(self.image)
                ..................................(skip)
         	img_reslice.SetResliceTransform(img_transform)
                clean_img(self.image)   ????    
                .................................. 
        	self.image = img_reslice.GetOutput()    
If possible, how to set "clean_img" ?
thanks !!!!

YY

>
>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鄝鄟鄜nen
>Research Assistant
>Helsinki University Central Hospital
>X-ray Department
>
>email   janne.hamalainen at hus.fi
>
>
> > ----------
> > L鄣ett鄠�: 	Yi-Yu Chou[SMTP:chouyiyu at hotmail.com]
> > L鄣etetty: 	13. elokuuta 2003 23:56
> > Vastaanottaja: 	vtkusers at vtk.org
> > Aihe:  	競tkusers� 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
> >
>_______________________________________________
>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

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




More information about the vtkusers mailing list