[vtkusers] Re: vtkLookupTable vlues continued...
Francois Louis LAILLIER
flaillier at eldim.fr
Wed Apr 18 09:14:01 EDT 2007
I'am not sure, but your r,g,b variable are always equal at 0. You create
a lut with 256 points but there are all the same value = 0,0,0,1 .
Increment R,g,b variable....
Soon
________________________________
From: vtkusers-bounces+flaillier=eldim.fr at vtk.org
[mailto:vtkusers-bounces+flaillier=eldim.fr at vtk.org] On Behalf Of Luca
Pamparana
Sent: mercredi 18 avril 2007 15:07
To: vtkusers
Subject: [vtkusers] Re: vtkLookupTable vlues continued...
There is a case to be made about incrementing the variables in the
loop.... boy, one of those days!
On 4/18/07, Luca Pamparana < luca.pamparana at gmail.com
<mailto:luca.pamparana at gmail.com> > wrote:
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/d4415955/attachment.htm>
More information about the vtkusers
mailing list