vtkImageViewer2 is meant to display grayscale images. It uses an instance of vtkImageMapToWindowLevelColors. This by default does a RGB(A) to RGB(A) with all components being the same. You can set your own lookup table to this class to avoid that and have colors displayed your way...<div>
<br><div><div><br></div><div><span class="Apple-style-span" style="font-family: Verdana, Geneva, Helvetica, Arial, sans-serif; font-size: 13px; border-collapse: collapse; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "><span> imageviewer2->GetWindowLevel()->SetOutputFormatToRGB();</span><br>
<span> vtkLookupTable *lut = vtkLookupTable::New();</span><br><span> lut->SetHueRange(...);</span><br><span> lut->SetSaturationRange(...);</span><br><span> lut->SetValueRange(...);</span><br><span> lut->SetAlphaRange(...);</span><br>
<span> lut->SetNumberOfColors(256);</span><br><span> lut->Build();</span><br><span> imageviweer2->GetWindowLevel()->SetLookupTable(lut);</span></span></div><div><br><br><div class="gmail_quote">On Fri, Mar 4, 2011 at 1:56 PM, alby13 <span dir="ltr"><<a href="mailto:albagarin1986@hotmail.com">albagarin1986@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Good morning,<br>
<br>
i am trying to visualize a rgb image with vtkImageViewer2 and i cannot get a<br>
correct image, dependieng on how i set the viewer i get a one component<br>
image (using only one of the 3 rgb components), or incorrect images (i check<br>
the result coz i can view the rgb image with itk-snap).<br>
anyone could help me?<br>
<br>
thanks,<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/vtkImageViewer2-tp3409087p3409087.html" target="_blank">http://vtk.1045678.n5.nabble.com/vtkImageViewer2-tp3409087p3409087.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<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://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br></div></div></div>