[vtkusers] Help with vtkLookupTable
Luis Roberto P. Paula
luisrpp at gmail.com
Tue Jul 6 10:54:19 EDT 2010
Hi All,
I have created this LUT:
lut = vtkLookupTable::New();
lut->SetNumberOfColors(MAX_PIXEL+1);
lut->SetTableRange(MIN_PIXEL, MAX_PIXEL);
lut->SetRange(0.0,MAX_PIXEL);
lut->SetHueRange(0.667,0.0);
lut->Build();
I'm using this LUT in two different ways. The first one is:
vtkImageMapToColors *img_rgb = vtkImageMapToColors::New();
img_rgb->SetInput(img);
img_rgb->SetLookupTable(lut);
img_rgb->SetOutputFormatToRGBA();
img_rgb->Update();
img_viewer->SetInput(img_rgb);
The input is a gray scale image. It gives me an image that goes from
*BLUE*to green, yellow and red.
The second one is:
int window, level;
window = MAX_PIXEL - MIN_PIXEL;
level = (0.5 * (MAX_PIXEL + MIN_PIXEL));
img_viewer2->SetInput(img);
img_viewer2->SetColorLevel(level);
img_viewer2->SetColorWindow(window);
img_viewer2->GetWindowLevel()->SetLookupTable(lut);
I'm using the same input and the same LUT, but the displayed image goes from
*BLACK* to blue, green, yellow and red.
How can I get the same result of the second approach using the first one?
Without having to set the window/level parameters.
Thanks & Regards,
Luis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100706/53c324cb/attachment.htm>
More information about the vtkusers
mailing list