[vtkusers] How to Display 2D image

Yi-Yu Chou chouyiyu at hotmail.com
Thu Jul 1 13:51:42 EDT 2004


Dear vtk users,

I would like to display a 3D image and it's three orthogonal plane in 4 
different renderer.
I can successfully display the 3D image by the following pipeline: (under 
python)
        # slice extractor
        self.extract = vtkExtractVOI()
        self.extract.SetInput(self.image)
        
	# texture
	self.texture = vtkTexture()
        self.texture.SetInput(self.extract.GetOutput())
	self.texture.SetLookupTable(self.colormap)

        # need a plane to texture map onto
	self.plane = vtkPlaneSource()
	self.plane.SetXResolution(1)
	self.plane.SetYResolution(1)

	# mapper for the textured plane
        self.mapper = vtkPolyDataMapper()
        self.mapper.SetInput(self.plane.GetOutput())
	
	# put everything together
	self.actor = vtkActor()
	self.actor.SetMapper(self.mapper)
	self.actor.SetTexture(self.texture)

However, in 2D, using a similar pipeline, I have to use vtkPolyDataMapper2D 
for the planeSource, but then the vtkActor2D doesn't take taxtures. How 
should I do ???
Thanks in advance !!!!

_________________________________________________________________
立即申請 MSN Mobile 服務:在您的手機上收發 MSN Hotmail 
http://msn.com.tw/msnmobile 




More information about the vtkusers mailing list