Thanks Bill, It is working now!!<br><br>Regards,<br>Luis<br><br><div class="gmail_quote">On Fri, Jul 2, 2010 at 4:28 PM, Bill Lorensen <span dir="ltr">&lt;<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Try<br>
lut-&gt;SetRange(0.0, 100.0);<br>
<div><div></div><div class="h5"><br>
<br>
On Fri, Jul 2, 2010 at 3:07 PM, Luis Roberto P. Paula &lt;<a href="mailto:luisrpp@gmail.com">luisrpp@gmail.com</a>&gt; wrote:<br>
&gt; Hi All,<br>
&gt;<br>
&gt; I have an image in gray scale. In this image, there are just three possible<br>
&gt; values: 0, 50 and 100.<br>
&gt;<br>
&gt; I need to set 50 to red and 100 to green, so I have created the following<br>
&gt; lookup table:<br>
&gt;<br>
&gt;    vtkLookupTable *lut = vtkLookupTable::New();<br>
&gt;    lut-&gt;SetNumberOfColors(101);<br>
&gt;    lut-&gt;SetTableValue(0,0,0,0,0);<br>
&gt;    lut-&gt;SetTableValue(50,1,0,0,1);<br>
&gt;    lut-&gt;SetTableValue(100,0,1,0,1);<br>
&gt;    lut-&gt;Build();<br>
&gt;<br>
&gt; And here I&#39;m using converting this image to RGB:<br>
&gt;<br>
&gt;    vtkImageMapToColors *img1_rgb = vtkImageMapToColors::New();<br>
&gt;    img1_rgb-&gt;SetInput(img_grey);<br>
&gt;    img1_rgb-&gt;SetLookupTable(lut);<br>
&gt;    img1_rgb-&gt;SetOutputFormatToRGBA();<br>
&gt;    img1_rgb-&gt;Update();<br>
&gt;<br>
&gt; The problem is that the pixels with values 50 and 100 are always being<br>
&gt; converted to green, with the same intensity.<br>
&gt;<br>
&gt; Does anyone know what I&#39;m doing wrong?<br>
&gt;<br>
&gt; Thanks &amp; Regards,<br>
&gt; Luis<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;<br>
&gt;<br>
</blockquote></div><br>