[vtkusers] how to display a slice of color volume?

David Gobbi dgobbi at atamai.com
Wed Sep 20 23:40:02 EDT 2006


VTK has no trouble displaying RGB or RGBA data.

The vtkImageViewer2 should be the easiest way, but vtkImageActor, 
vtkTexture, and even the old vtkImageViewer class will work, too.  The 
only special thing you need to do with vtkImageViewer is call 
SetColorWindow(255.0) and SetColorLevel(127.5).

This assumes that your data uses eight bits per component.   You can 
still display it if it doesn't, but in that case you'll have to use 
vtkImageShiftScale to convert the data to UnsignedChar before displaying 
it (either that, or use vtkImageViewer which doesn't care how many bits 
per component you use).

 - David


kdsfinger at gmail.com wrote:
> hi, all
>
> How can I display a slice of color volume? I have a stack of color
> images and I want to read them into the vtkImageData. Can vtk hold
> color volume (rgb and transparency)? Is there anyway to to this in
> vtk? This question is not about turning gray scale into color. Thanks
> for comments.
>
> zl2k
> _______________________________________________
> This is the private VTK discussion list. Please keep messages 
> on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>




More information about the vtkusers mailing list