[vtkusers] RGBA data set volume rendering

Dr. Daniel James White PhD dan at chalkie.org.uk
Thu Sep 23 04:49:11 EDT 2004


Hi,

As  understand it,
the VTK volume mappers are not able to render a RGBA data set, since  
the mappers only read a single scalar value for each voxel/point.
In a RGBA volume there are of course 3.

(Yi-Yu, in your case you have to use the vtk  image liminance filter to  
essentially turn the RGBA volume into grayscale, single gray scale  
values for each voxel, then volume render)


I would also love to have a raycast/shearwarp/2Dtexturemapper that  
handles RGBA data, or RGB data with a user definable opacity transfer  
function.
I have  a programming student who has this on his to do list. Our  
microscopy data is RGB tiff image stacks, and it would be great to  
volume render in "real" colour.

Is there anyone out there who has already done this?

Wouldn't the code be very similar to the existing ray cast mapper,
only the ray would pick up the RGB colour as it passes through the  
volume,
so there would be no colour transfer function?
There could be a window level type contrast/brightness control to  
adjust the appearance of the rendering.
And you could either use the alpha channel for opacity, or use a user  
defined LUT(opacity transfer function.

I have  volume pro 1000 board, and I think this kind of data is  
supported by the volume pro driver vli3 library and the board,
but not in the vtk code for accessing the vli3 library. Is this  
correct... rtviz folks?

Anyone have any ideas or existing code?

cheers
Dan


Message: 3
Date: Wed, 22 Sep 2004 13:51:30 -0400
From: Yi-Yu Chou <yiyu.chou at gmail.com>
Subject: [vtkusers] Volume Rendering for 4 Compoents Image ~ HELP !!!!
To: vtkusers at vtk.org
Message-ID: <8c82113e040922105136f440aa at mail.gmail.com>
Content-Type: text/plain; charset=US-ASCII

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 !!!!!!!


Dr. Daniel James White BSc. (Hons.) PhD
Cell Biology, Ambiotica C242
Department of biological and environmental science
PO Box  35
University of Jyväskylä
Jyväskylä FIN 40014
Finland
+358 14 260 4183 (work)
+358 468102840 (mobile)

http://www.chalkie.org.uk
dan at chalkie.org.uk
white at cc.jyu.fi



More information about the vtkusers mailing list