[vtkusers] Color transfer function problem

MemoreX karsten.klompmaker at gmail.com
Mon Jun 17 08:31:48 EDT 2013


Hey everyone,

i'm fairly new to VTK and been having some troubles with color transfer
functions. What i'm trying to accomplish is actually prette easy. I want
each scalar value to be mapped into one specific color. 
So i did the following:

vtkSmartPointer<vtkColorTransferFunction> color =
vtkSmartPointer<vtkColorTransferFunction>::New();
color->AddRGBPoint(2.0, 0.0, 1.0, 0.0, 0.0, 0.0);
color->AddRGBPoint(50.0, 1.0, 1.0, 0.0, 0.0, 1.0);
color->AddRGBPoint(150.0, 0.0, 1.0, 0.0, 0.0, 1.0);
color->AddRGBPoint(200.0, 0.0, 0.0, 1.0, 0.0, 1.0);
color->SetColorSpaceToRGB();
color->Build();

I thought the result would be:
2-50: yellow
51-150: green
151-200: blue

But the actual result is:
<http://vtk.1045678.n5.nabble.com/file/n5721442/Example.png> 

All the pixels in the object have the same value and i don't understand why
the colors are mixed like that.
As a mapper i'm using the vtkSmartVolumeMapper.
I hope someone can help me?



--
View this message in context: http://vtk.1045678.n5.nabble.com/Color-transfer-function-problem-tp5721442.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list