<div dir="ltr">So you want first channel to be rendered as R, second as B, and third as G? I am not sure what you mean by you were able to set <span style="font-family:arial,sans-serif;font-size:16px">scalar components in my ImageData to 3? So you have multi-component data that you are trying to render? </span><div>
<font face="arial, sans-serif"><span style="font-size:16px"><br></span></font></div><div><font face="arial, sans-serif"><span style="font-size:16px">If you can send us a sample dataset, I can have a look at it. <br></span></font><div>
<font face="arial, sans-serif"><span style="font-size:16px"><br></span></font></div><div><font face="arial, sans-serif"><span style="font-size:16px">- Aashish<br></span></font><div><br></div></div></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, Jun 25, 2014 at 1:49 PM, Cory Jones <span dir="ltr"><<a href="mailto:cjayjones@gmail.com" target="_blank">cjayjones@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">I am trying to render a volume from 3D ImageData and I want to be able to control the color of each voxel independently using the color channels. I am able to set the number of scalar components in my ImageData to 3 and set each channel separately. I am rendering using vtkSmartVolumeMapper. Is there a way to set the vtkVolumeProperty so that the image renders the 3 channels as RGB? I have tried using the vtkColorTransferFunction SetColorSpaceToRGB(), but this does not work. Again, I don't want to do scalar color mapping. My current code is:<br>
<div><br></div><div><br></div><div><div> vtkSmartPointer<vtkSmartVolumeMapper> volumeMapper = </div><div> vtkSmartPointer<vtkSmartVolumeMapper>::New();</div><div> volumeMapper->SetBlendModeToComposite(); </div>
<div> volumeMapper->SetInputConnection(outputImageData->GetProducerPort());</div><div><br></div><div> vtkSmartPointer<vtkVolumeProperty> volumeProperty = </div><div> vtkSmartPointer<vtkVolumeProperty>::New();</div>
<div> volumeProperty->ShadeOff();</div><div> volumeProperty->SetInterpolationType(VTK_LINEAR_INTERPOLATION);</div><div> </div><div> vtkSmartPointer<vtkColorTransferFunction> color = </div><div> vtkSmartPointer<vtkColorTransferFunction>::New();</div>
<div> color->SetColorSpaceToRGB();</div><div> volumeProperty->SetColor(color);</div><div><br></div><div> vtkSmartPointer<vtkVolume> volume = </div><div> vtkSmartPointer<vtkVolume>::New();</div><div>
volume->SetMapper(volumeMapper);</div><div> volume->SetProperty(volumeProperty);</div></div></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><font face="trebuchet ms, sans-serif"><i>| Aashish Chaudhary <br>| Technical Leader <br>| Kitware Inc. <br></i></font><div>
<i><font face="trebuchet ms, sans-serif">| </font><a href="http://www.kitware.com/company/team/chaudhary.html" target="_blank">http://www.kitware.com/company/team/chaudhary.html</a></i></div></div>
</div>