[vtkusers] vtkLookupTable... cannot manually create table for red and blue values
Luca Pamparana
deluded.soul at gmail.com
Mon Sep 4 05:55:12 EDT 2006
Hi everyone,
Someone please help me with this vtkLookupTable problem. I was trying
all weekend but cannot figure out what I am doing wrong!
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:
double * range = reader->GetOutput()->GetScalarRange();
vtkLookupTable * redMap = vtkLookupTable::New();
redMap->SetNumberOfTableValues(256);
redMap->Build();
double i = 0.0;
for(int index=0;index<256;index++)
{
redMap->SetTableValue(index, 0.0, i/256.0, 0.0, 1.0);
i++;
}
redMap->SetAlphaRange(1.0,1.0);
redMap->SetTableRange(range[0], range[1]);
colorMapper->SetLookupTable(redMap);
colorMapper->Update();
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
and it is quite urgent. I really beg for some direction here.
Thanks,
Luca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060904/29eaa2f6/attachment.htm>
More information about the vtkusers
mailing list