<div dir="ltr">Hi David,<br>Thank you for your answer, I&#39;d appreciate a further advice:<br><br>I managed to map the right values (scalars) into the right colors (green, yellow and red).<br>However, I haven&#39;t found the method to get the color gradients in each color range.<br>

I mean that I&#39;d like to obtain the scalars data (which have been mapped to those three colors) into the gradient of each color.<br>Thus, I should get something like a topological map.<br><br>Here is my code snippet:<br>

<br>    vtk_lut-&gt;SetNumberOfColors(3);<br>    vtk_lut-&gt;Build();<br>    vtk_lut-&gt;SetTableValue(2,0,1,0); //green<br>    vtk_lut-&gt;SetTableValue(1,1,1,0); //yellow<br>    vtk_lut-&gt;SetTableValue(0,1,0,0); //red<br>

<br>If it possible, please represent in which functions I should use.<br>Thanks in advance!<br><br><br><div class="gmail_quote">On Thu, Jan 12, 2012 at 3:18 PM, David Doria <span dir="ltr">&lt;<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, Jan 12, 2012 at 2:47 AM, Miri Trope &lt;<a href="mailto:miritrope@gmail.com">miritrope@gmail.com</a>&gt; wrote:<br>


&gt; Hi David,<br>
&gt;<br>
</div><div class="im">&gt; I&#39;d like to get a colored surface with three colors like a traffic light:<br>
&gt; green  -  (which represents  low values)<br>
&gt; orange -  (which represents  middle values)<br>
&gt; red     -   (which represents high values)<br>
&gt;<br>
&gt; each of those values should get its brightness due to the value its range.<br>
&gt; for example:<br>
&gt; lets say that my vtkFloatArray consists of six elements s.t.:<br>
&gt;   [5,2,1,6,4,1]<br>
&gt; -divide the elements to three groups and normalized each value s.t:<br>
&gt; lighter    (LI)     color x {green,orange,red}<br>
&gt; stronger (ST)    color x { &quot; }<br>
&gt;   [LI red, ST green, LI green, ST red, ST orange, LI green]<br>
&gt;<br>
&gt; Hope that now my question is clearer.<br>
&gt; Thanks in advance :-)<br>
<br>
</div>I&#39;d suggest you insert the colors in the color map as HSV values. I<br>
don&#39;t think there is direct support for doing this, but you can<br>
convert them manually.<br>
<br>
You&#39;ll want to end up with something like:<br>
<br>
ColorMap = { {H_g, S_g, V_light}, {H_g, S_g, V_dark}, {H_o, S_o,<br>
V_light}, {H_o, S_o, V_dark}, {H_r, S_r, V_light}, {H_r, S_r, V_dark}<br>
}<br>
<br>
That is, choose a green hue (H_g), a green saturation (S_g), hues for<br>
orange and red, and then the values of &quot;light&quot; and &quot;dark&quot; you want.<br>
<br>
But you&#39;ll have to insert them as RGB values. You can convert the HSV<br>
values to choose to RGB using functions from vtkMath<br>
(<a href="http://www.vtk.org/doc/nightly/html/classvtkMath.html#a432c7d56d981a3030cb0d6f4a8789b79" target="_blank">http://www.vtk.org/doc/nightly/html/classvtkMath.html#a432c7d56d981a3030cb0d6f4a8789b79</a>)<br>
such as vtkMath::HSVToRGB.<br>
<br>
For reference:<br>
<a href="http://en.wikipedia.org/wiki/HSL_and_HSV#From_HSV" target="_blank">http://en.wikipedia.org/wiki/HSL_and_HSV#From_HSV</a><br>
<br>
Good luck,<br>
<font color="#888888"><br>
David<br>
</font></blockquote></div><br></div>