[vtkusers] Reading a raw RGB volume in VTK
    Jason Ruiter 
    Jason.Ruiter at Altarum.org
       
    Thu Nov 14 10:19:37 EST 2002
    
    
  
Greetings,
I want to read a raw RGB volume into VTK and render it as a point
cloud.  I'm using the following to read the data:
reader=vtkImageReader2()
reader.SetFileName("vhhead.optic.vol")
reader.SetDataScalarTypeToUnsignedChar()
reader.SetDataExtent( (0,255,0,255,0,255) )
reader.SetNumberOfScalarComponents(3)
reader.SetFileDimensionality(3)
reader.Update()
It reads without errors, but when I try to render it with:
MapperVol = vtkVolumeRayCastMapper()
MapperVol.SetInput(image)
ActorVol = vtkVolume()
ActorVol.SetMapper(MapperVol)
ActorVol.SetProperty(volprop)
RenderVol = vtkRenderer()
RenderVol.AddActor(ActorVol)
renVol = vtkRenderWindow()
renVol.AddRenderer(RenderVol)
irenVol = vtkRenderWindowInteractor()
irenVol.SetRenderWindow(renVol)
irenVol.Start()
I get a segfault.  (I've posted that to the list earlier).
My question:
How does one read raw RGB Data and create a color table for it?  Is the
code above the Right Way(tm) to go about it?
Thanks
Jason
    
    
More information about the vtkusers
mailing list