[vtkusers] Volume Rendering for 4 Compoents Image ~ HELP !!!!

Yi-Yu Chou yiyu.chou at gmail.com
Wed Sep 22 13:51:30 EDT 2004


Dear vatkusers:

I am trying to display a 4 components image under Python with VTK4.2.
I used the following code to do the volume rendering, but I only got a
black box.

 		compositeFunction = vtkVolumeRayCastCompositeFunction()				
 		volumeMapper = vtkVolumeRayCastMapper()
 		volumeMapper.SetVolumeRayCastFunction(compositeFunction)
		volumeMapper.IndependentComponentsOff()
		volumeMapper.SetInput(image) ## image is a 4-component vtkImageData

                opacityTFunc = vtkPiecewiseFunction()
		opacityTFunc.AddPoint(0,0)	       		
		opacityTFunc.AddPoint(255,255)

		volumeProperty = vtkVolumeProperty()
		volumeProperty.SetScalarOpacity(opacityTFunc)

		self.volume = vtkVolume()
		self.volume.SetMapper(volumeMapper)
		self.volume.SetProperty(volumeProperty)
....................................................................................................................

Any help is appreciated in advance !!!!!!!



More information about the vtkusers mailing list