[vtkusers] vtkLookupTable vlues continued...
Luca Pamparana
luca.pamparana at gmail.com
Wed Apr 18 08:43:10 EDT 2007
Hello everyone,
I finally managed to get rid of the RGB and grayscale blending by simply
switching the connection in the vtkImageBlend filter. However, I am still
struggling with the vtkLookupTable and using it with the
vtkImageMapToWindowLevelColors filter.
So, I am creating the table as follows:
vtkImageMapToWindowLevelColors * iwlc = vtkImageMapToWindowLevelColors;
vtkLookupTable * lut = vtkLookupTable::New();
// Input is the input vtkImageData pointer.
double * range = input->GetScalarRange();
lut->SetTableRange (range[0], range[1]);
lut->SetNumberOfTableValues(256);
lut->Build();
float r, g, b;
r = g = b = 0.0;
for (int i = 0; i < 256; i++)
{
lut->SetTableValue(i, r/255.0f, g/255.0f, b/255.0f, 1.0);
}
iwlc->SetLookupTable(lut);
iwlc->SetInput(input);
Now, later when I get the output of the vtkImageMapToWindowLevelColors
filter object as:
iwic->GetOutput();
then the scalar range for the output data is always 0 - 0. I have tried
using calls to update but to no avail.
I would really appreciate some help from experts who have experience using
these filters.
Thanks,
Luca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070418/c4afc824/attachment.htm>
More information about the vtkusers
mailing list