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"><<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>></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->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 <<a href="mailto:luisrpp@gmail.com">luisrpp@gmail.com</a>> wrote:<br>
> Hi All,<br>
><br>
> I have an image in gray scale. In this image, there are just three possible<br>
> values: 0, 50 and 100.<br>
><br>
> I need to set 50 to red and 100 to green, so I have created the following<br>
> lookup table:<br>
><br>
> vtkLookupTable *lut = vtkLookupTable::New();<br>
> lut->SetNumberOfColors(101);<br>
> lut->SetTableValue(0,0,0,0,0);<br>
> lut->SetTableValue(50,1,0,0,1);<br>
> lut->SetTableValue(100,0,1,0,1);<br>
> lut->Build();<br>
><br>
> And here I'm using converting this image to RGB:<br>
><br>
> vtkImageMapToColors *img1_rgb = vtkImageMapToColors::New();<br>
> img1_rgb->SetInput(img_grey);<br>
> img1_rgb->SetLookupTable(lut);<br>
> img1_rgb->SetOutputFormatToRGBA();<br>
> img1_rgb->Update();<br>
><br>
> The problem is that the pixels with values 50 and 100 are always being<br>
> converted to green, with the same intensity.<br>
><br>
> Does anyone know what I'm doing wrong?<br>
><br>
> Thanks & Regards,<br>
> Luis<br>
><br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <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:<br>
> <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>
><br>
><br>
</blockquote></div><br>