[vtkusers] mapping floating image to color image using vtkImageMapToColors
Rick Frank
rickfrank at me.com
Fri Jul 19 21:20:08 EDT 2013
Hi,
I'm getting some behavior I don't understand when trying to map gray floating point image to a color image
What I'm seeing is that the output is completely white.
my code is roughly as follows
filter->SetOutputFormatToRGBA()
colorTable->SetTableRange(0,1)
colorTable->SetHueRange(0,1);
colorTable->SetSaturationRange(0,1);
colorTable->SetValueRange(0,1);
colorTable->SetRampToLinear();
colorTable->ForceBuild();
Now, when I trace through the code, the values set in the RGBA image look correct. But the ultimate rendered image is completely white.
If I modify the code so that all the RGBA values are 1,0,0,255 the image is solid red. If I change the alpha to 64 nothing changes.
So, I suspect it's the mapper - I use the same mapper - vtkImageMapper to display the color image by resetting the input connection:
mapper->SetInputConnection(filter->GetOutputPort());
imageActor->SetMapper(mapper);
Do I need to make a change to the mapper to get the proper RGBA display?
Thanks
Rick
More information about the vtkusers
mailing list