<html>
<body>
Hi Brian,<br><br>
VTK cannot volume render RGB volume data. You can run an averaging or
luminance filter on the data to bring it down to a single unsigned short
component, then you can volume render it. <br><br>
To see your data as RGB you may wish to look at VolView (you can get it
from the Kitware web site). VolView has an extensible plugin API so you
can actually implement your ITK filtering as a VolView plugin.<br><br>
Lisa<br><br>
<br><br>
At 09:32 AM 7/1/2004, Brian Rowe wrote:<br>
<blockquote type=cite class=cite cite="">Hello, <br>
I have a set of data that is composed of 24bit RGB images. I am
trying to load them in as a volume and process them with ITK, then
visualize them in VTK. <br><br>
I can load them in ITK and pass them to vtk fine, I verified this
by loading a single image and passing it to vtkImageMapper (etc.).
<br><br>
The problem comes when I try to pass the volume to the vtkVolume classes
(Mapper, Property, etc.) When I visualize this, I see
nothing. I am not sure what the problem is. It could be as
simple as having inappropriate ColorTransferFunctions, but at this point
I'd like to ask one of the experts if they see something. <br><br>
I thank you for your time. <br><br>
the relevant source code follows: <br>
<tt><x-tab> </x-tab>append
= vtkImageAppendComponents::New(); <br>
<x-tab> </x-tab><br>
<x-tab> </x-tab></tt><font face="Courier, Courier" size=2 color="#236E25">//////////////////////////////////</font>
<br>
<tt><x-tab> </x-tab></tt><font face="Courier, Courier" size=2 color="#236E25">/// This code ties ITK to VTK</font> <br>
<tt><x-tab> </x-tab></tt><font face="Courier, Courier" size=2 color="#236E25">//////////////////////////////////</font> <br>
<tt><x-tab> </x-tab>append->AddInput(RedConnector->GetOutput()); <br>
<x-tab> </x-tab>append->AddInput(GreenConnector->GetOutput()); <br>
<x-tab> </x-tab>append->AddInput(BlueConnector->GetOutput()); <br>
<x-tab> </x-tab></tt><font face="Courier, Courier" size=2 color="#236E25">//append->AddInput(AlphaConnector->GetOutput());</font> <br>
<tt><x-tab> </x-tab><br>
<x-tab> </x-tab></tt><font face="Courier, Courier" size=2 color="#236E25">/////////////////////////////////</font> <br>
<tt><x-tab> </x-tab></tt><font face="Courier, Courier" size=2 color="#236E25">/// 2D Image Stuff</font> <br>
<font face="Courier, Courier" size=2 color="#236E25">//<x-tab> </x-tab>vtkImageMapper *imapper = vtkImageMapper::New();</font> <br>
<font face="Courier, Courier" size=2 color="#236E25">//<x-tab> </x-tab></font><br>
<font face="Courier, Courier" size=2 color="#236E25">//<x-tab> </x-tab>imapper->SetInput(append->GetOutput());</font> <br>
<font face="Courier, Courier" size=2 color="#236E25">//<x-tab> </x-tab></font><br>
<font face="Courier, Courier" size=2 color="#236E25">//<x-tab> </x-tab>vtkActor2D *actor = vtkActor2D::New();</font> <br>
<font face="Courier, Courier" size=2 color="#236E25">//<x-tab> </x-tab>actor->SetMapper(imapper);</font> <br>
<font face="Courier, Courier" size=2 color="#236E25">//<x-tab> </x-tab>ren->AddActor(actor);</font> <br>
<font face="Courier, Courier" size=2 color="#236E25">///////////////////////////////////</font> <br>
<tt><x-tab> </x-tab><br>
<x-tab> </x-tab><br>
<x-tab> </x-tab>func = vtkVolumeRayCastCompositeFunction::New(); <br>
<x-tab> </x-tab><br>
<x-tab> </x-tab>mapper = vtkVolumeRayCastMapper::New(); <br>
<x-tab> </x-tab>mapper->SetInput(append->GetOutput()); <br>
<x-tab> </x-tab>mapper->IndependentComponentsOn(); <br>
<x-tab> </x-tab>mapper->SetComponentBlendModeToAdd(); <br>
<x-tab> </x-tab>mapper->SetVolumeRayCastFunction(func); <br>
<x-tab> </x-tab><br>
<x-tab> </x-tab>opacity = vtkPiecewiseFunction::New(); <br>
</tt><font face="Courier, Courier" size=2 color="#236E25">//<x-tab> </x-tab>opacity->AddPoint(0.0, 0);</font> <br>
<font face="Courier, Courier" size=2 color="#236E25">//<x-tab> </x-tab>opacity->AddPoint(5.0, 1);</font> <br>
<tt><x-tab> </x-tab><br>
<x-tab> </x-tab>red = vtkColorTransferFunction::New(); <br>
<x-tab> </x-tab>red->AddRGBPoint(<font face="Courier New, Courier" color="#0000FF">0.0</font>, <font face="Courier New, Courier" color="#0000FF">0.0</font>, <font face="Courier New, Courier" color="#0000FF">0.0</font>, <font face="Courier New, Courier" color="#0000FF">0.0</font>); <br>
<x-tab> </x-tab>red->AddRGBPoint(<font face="Courier New, Courier" color="#0000FF">255.0</font>, <font face="Courier New, Courier" color="#0000FF">1.0</font>, <font face="Courier New, Courier" color="#0000FF">0.0</font>, <font face="Courier New, Courier" color="#0000FF">0.0</font>); <br>
<x-tab> </x-tab>green = vtkColorTransferFunction::New(); <br>
<x-tab> </x-tab>green->AddRGBPoint(<font face="Courier New, Courier" color="#0000FF">0.0</font>, <font face="Courier New, Courier" color="#0000FF">0.0</font>, <font face="Courier New, Courier" color="#0000FF">0.0</font>, <font face="Courier New, Courier" color="#0000FF">0.0</font>); <br>
<x-tab> </x-tab>green->AddRGBPoint(<font face="Courier New, Courier" color="#0000FF">255.0</font>, <font face="Courier New, Courier" color="#0000FF">0.0</font>, <font face="Courier New, Courier" color="#0000FF">1.0</font>, <font face="Courier New, Courier" color="#0000FF">0.0</font>); <br>
<x-tab> </x-tab>blue = vtkColorTransferFunction::New(); <br>
<x-tab> </x-tab>blue->AddRGBPoint(<font face="Courier New, Courier" color="#0000FF">0.0</font>, <font face="Courier New, Courier" color="#0000FF">0.0</font>, <font face="Courier New, Courier" color="#0000FF">0.0</font>, <font face="Courier New, Courier" color="#0000FF">0.0</font>); <br>
<x-tab> </x-tab>blue->AddRGBPoint(<font face="Courier New, Courier" color="#0000FF">255.0</font>, <font face="Courier New, Courier" color="#0000FF">0.0</font>, <font face="Courier New, Courier" color="#0000FF">0.0</font>, <font face="Courier New, Courier" color="#0000FF">1.0</font>); <br>
<x-tab> </x-tab><br>
<x-tab> </x-tab>prop = vtkVolumeProperty::New(); <br>
<x-tab> </x-tab>prop->SetInterpolationTypeToLinear(); <br>
</tt><font face="Courier, Courier" size=2 color="#236E25">//<x-tab> </x-tab>prop->SetScalarOpacity(0, opacity);</font> <br>
<tt><x-tab> </x-tab>prop->SetColor(<font face="Courier New, Courier" color="#0000FF">0</font>, red); <br>
<x-tab> </x-tab>prop->SetColor(<font face="Courier New, Courier" color="#0000FF">1</font>, green); <br>
<x-tab> </x-tab>prop->SetColor(<font face="Courier New, Courier" color="#0000FF">2</font>, blue); <br>
<x-tab> </x-tab>prop->ShadeOn(); <br>
<x-tab> </x-tab><br>
<x-tab> </x-tab>vol = vtkVolume::New(); <br>
<x-tab> </x-tab>vol->SetProperty(prop); <br>
<x-tab> </x-tab>vol->SetMapper(mapper); <br><br>
<x-tab> </x-tab>ren->AddVolume(vol); <br>
<x-tab> </x-tab>ren->ResetCamera(); <br>
</tt><br>
--- <br>
1.79 x 10^12 furlongs per fortnight -- it's not just a good idea, it's the law! <br>
<br><br>
<div>_______________________________________________</div><br>
<div>This is the private VTK discussion list. </div><br>
<div>Please keep messages on-topic. Check the FAQ at: &lt;<a href="<a href="http://public.kitware.com/cgi-bin/vtkfaq" eudora="autourl">http://public.kitware.com/cgi-bin/vtkfaq</a>" EUDORA=AUTOURL><a href="http://public.kitware.com/cgi-bin/vtkfaq" eudora="autourl">http://public.kitware.com/cgi-bin/vtkfaq</a></a>&gt;</div><br>
<div>Follow this link to subscribe/unsubscribe:</div><br>
<div><a href="http://www.vtk.org/mailman/listinfo/vtkusers" EUDORA=AUTOURL><a href="http://www.vtk.org/mailman/listinfo/vtkusers" eudora="autourl">http://www.vtk.org/mailman/listinfo/vtkusers</a></a></div><br>
</blockquote></x-html> </blockquote></body>
</html>