[vtkusers] problem creating lookup table

Luca Pamparana deluded.soul at gmail.com
Sat Sep 2 08:22:39 EDT 2006


Hi everyone,

Did not get an answer before so trying again....

I am constructing a vtkLookupTable manually as follows:

double * range = reader->GetOutput()->GetScalarRange();
vtkLookupTable * greenMap = vtkLookupTable::New();
greenMap->SetNumberOfTableValues(256);
greenMap->Build();

double i = 0.0;

for(int index=0;index<256;index++)
{
     greenMap->SetTableValue(index, 0.0, i/256.0, 0.0, 1.0);
      i++;
}
greenMap->SetAlphaRange(1.0,1.0);

greenMap->SetTableRange(range[0], range[1]);
colorMapper->SetLookupTable(greenMap);
colorMapper->Update();


I see nothing but a black screen. However, when I generate the table for
red... like:

redMap->SetTableValue(index,  i/256.0, 0.0, 0.0, 1.0);

then my image is mapped correctly to red values...

It is weird...red and gray color maps work but not green and blue!!

Can someone help me find what the problem is...it is driving me nuts!

Thanks,

Luca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060902/4132dd21/attachment.htm>


More information about the vtkusers mailing list