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"><<a href="mailto:circass@gmail.com">circass@gmail.com</a>></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>
><br>
> Could you please try SetValueRange(1,0).<br>
><br>
> Regards<br>
><br>
> Jothy<br>
><br>
> On Fri, Jan 22, 2010 at 2:06 PM, circass <<a href="mailto:circass@gmail.com">circass@gmail.com</a>> wrote:<br>
><br>
>><br>
>> I think Alessandro understood me wrong, so i m trying to explain what i<br>
>> want<br>
>> more clearly.<br>
>><br>
>> I have dicom files that i read with itk and vtk.<br>
>><br>
>> my images are already greyscale, i want to change the blacks with whites<br>
>> and<br>
>> vice versa.<br>
>><br>
>> Thanx.<br>
>> Circass<br>
>> --<br>
>> View this message in context:<br>
>> <a href="http://old.nabble.com/Reversing-Color-tp27272638p27273652.html" target="_blank">http://old.nabble.com/Reversing-Color-tp27272638p27273652.html</a><br>
>> 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<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>
> _______________________________________________<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>
<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>