Hi Obada,<br><br>Thanks for replying!<br><br>I actually have those
calls and the code for constructing the red color map is the same as
for the green and blue... I just have no idea why it would do this!<br><br>Would someone happen to know how I can use the HSV values for setting the color map?
<br><br>I am currently doing...<br><br>vtkLookupTable * lut = vtkLookupTable::New();<br>lut->SetHueRange( 2.0/3.0, 2.0/3.0);<br>lut->SetSaturationRange(0.0, 1.0);<br>lut->SetValueRange(0.0, 1.0);<br>lut->SetAlphaRange(
1.0, 1.0);<br>lut->SetNumberOfColors(256);<br>lut->SetTableRange(range[0], range[1]);<br>lut->Build();<br><br>What I want is a pure blue mapping. The resulting image is a bit of a weird blue color.<br><br><div><span class="gmail_quote">
On 9/4/06, <b class="gmail_sendername">Obada Mahdi</b> <<a href="mailto:omahdi@gmx.de">omahdi@gmx.de</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Luca,<br><br>here are some suggestions:<br><br>On 04.09.2006, at 11:55, Luca Pamparana wrote:<br>> Someone please help me with this vtkLookupTable problem. I was<br>> trying all weekend but cannot figure out what I am doing wrong!
<br>><br>> I am constructing a vtkLookupTable manually as follows:<br>><br>><br>> double * range = reader->GetOutput()->GetScalarRange();<br><br>Just to be sure: Is the output of `reader' up-to-date? Try a
<br>"reader->Update()", at least before using `range' below.<br><br>> vtkLookupTable * greenMap = vtkLookupTable::New();<br>> greenMap->SetNumberOfTableValues(256);<br>> greenMap->Build();<br>>
<br>[calls to greenMap->SetTableValue()]<br>> greenMap->SetAlphaRange(1.0,1.0);<br>><br>> greenMap->SetTableRange(range[0], range[1]);<br><br> From the documentation and source code it seems that values provided by
<br>SetAlphaRange() etc. are used when constructing the lookup table in<br>vtkLookupTable::Build() (based on linear ramps), so they should<br>probably go<br>before the call to Build().<br><br><br>Try doing something like this:
<br><br>| double* range;<br>| vtkLookupTable* greenMap;<br>|<br>| reader->Update();<br>| range = reader->GetOutput()->GetScalarRange();<br>| greenMap = vtkLookupTable::New();<br>| greenMap->SetNumberOfTableValues(256);
<br>| greenMap->SetAlphaRange(1.0, 1.0);<br>| greenMap->SetTableRange(range[0], range[1]);<br>| greenMap->Build();<br>|<br>| [for loop with calls to SetTableValue()]<br><br>> I see nothing but a black screen. However, when I generate the
<br>> table for<br>> red... like:<br>[...]<br>> then my image is mapped correctly to red values...<br>No idea about this one.<br><br>I have no experience actually using vtkLookupTable; if the<br>suggestions above
<br>do not help, I could try and have a closer look (maybe the output of<br>greenMap->PrintSelf(cerr, vtkIndent(0))<br>can help in understanding what goes wrong, and whether the lookup<br>table is<br>the problem after all).
<br><br><br>Regards<br><br>Obada<br></blockquote></div><br>