In vtkLookupTable. Are you using vtkLookupTable if not here is a part of the code which might help you.<br><br><i><b><span style="color: rgb(51, 102, 255);"> # Create a greyscale lookup table</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">    table = vtk.vtkLookupTable()</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">    table.SetRange(grayscale) # image intensity range</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">    table.SetValueRange(1,0) # from black to white</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">    table.SetSaturationRange(0.0, 0.0) # no color saturation</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">    table.SetRampToSCurve()</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">    table.SetNumberOfTableValues(402)</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">    table.Build()</span><br style="color: rgb(51, 102, 255);"><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">    # Map the image through the lookup table</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">    color = vtk.vtkImageMapToColors()</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">    color.SetLookupTable(table)</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">    color.SetInputConnection(reslice.GetOutputPort())</span><br style="color: rgb(51, 102, 255);"><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">    # Display the image</span><br style="color: rgb(51, 102, 255);">
<span style="color: rgb(51, 102, 255);">    actor = vtk.vtkImageActor()</span><br style="color: rgb(51, 102, 255);"><span style="color: rgb(51, 102, 255);">    actor.SetInput(color.GetOutput())</span><br style="color: rgb(51, 102, 255);">
</b></i><br>Jothy<br><br><div class="gmail_quote">On Fri, Jan 22, 2010 at 3:36 PM, circass <span dir="ltr">&lt;<a href="mailto:circass@gmail.com">circass@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Where should i use that function ?<br>
is there a specific filter or what ?<br>
<br>
Thanx<br>
Circass<br>
<div><div></div><div class="h5"><br>
<br>
KS Jothybasu wrote:<br>
&gt;<br>
&gt; Could you please try SetValueRange(1,0).<br>
&gt;<br>
&gt; Regards<br>
&gt;<br>
&gt; Jothy<br>
&gt;<br>
&gt; On Fri, Jan 22, 2010 at 2:06 PM, circass &lt;<a href="mailto:circass@gmail.com">circass@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; I think Alessandro understood me wrong, so i m trying to explain what i<br>
&gt;&gt; want<br>
&gt;&gt; more clearly.<br>
&gt;&gt;<br>
&gt;&gt; I have dicom files that i read with itk and vtk.<br>
&gt;&gt;<br>
&gt;&gt; my images are already greyscale, i want to change the blacks with whites<br>
&gt;&gt; and<br>
&gt;&gt; vice versa.<br>
&gt;&gt;<br>
&gt;&gt; Thanx.<br>
&gt;&gt; Circass<br>
&gt;&gt; --<br>
&gt;&gt; View this message in context:<br>
&gt;&gt; <a href="http://old.nabble.com/Reversing-Color-tp27272638p27273652.html" target="_blank">http://old.nabble.com/Reversing-Color-tp27272638p27273652.html</a><br>
&gt;&gt; Sent from the VTK - Users mailing list archive at Nabble.com.<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt;<br>
&gt;&gt; Visit other Kitware open-source projects at<br>
&gt;&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt;<br>
&gt;&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt;&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;&gt;<br>
&gt;&gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;&gt;<br>
&gt;<br>
&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>
<br>
</div></div><font color="#888888">--<br>
View this message in context: <a href="http://old.nabble.com/Reversing-Color-tp27272638p27275052.html" target="_blank">http://old.nabble.com/Reversing-Color-tp27272638p27275052.html</a><br>
</font><div><div></div><div class="h5">Sent from the VTK - Users mailing list archive at Nabble.com.<br>
<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>
</div></div></blockquote></div><br>