[vtkusers] vtkLookupTable help...

Keator, David dbkeator at msx.hsis.uci.edu
Wed Feb 7 18:02:47 EST 2001



Hi,

I'm trying to display a 3D structured points dataset using a color LUT and
I'm having trouble getting
the scalar values mapped to colors.  I'm using the vtkVolume16Reader to
obtain the unsigned short
scalar data, min=0 max=65536.  I'm then trying to create a lookup table of
hue vales 0.6->1 (so blue
to red for starters) and display the data using this color map.  I've tried
a bunch of different variations
changing the hueLUT->SetTableRange(0,?) values and
hueLUT->SetValueRange(0,?) values but
to no avail.  With the code included below I just get the color red mapped
to every voxel. What is the 
correct way to map scalar values from 0-65536 to a LUT of blue-red?

Thanks,

Dave


 //create hue lookup table
  vtkLookupTable *hueLUT = vtkLookupTable::New();
    hueLUT->SetTableRange(0,65536);
    hueLUT->SetHueRange(0.6, 1);
    hueLUT->SetSaturationRange(1,1);
    hueLUT->SetValueRange(0,1);
        hueLUT->Build();

// extract the brain 
  vtkMarchingCubes *brainExtractor = vtkMarchingCubes::New();
    brainExtractor->SetInput(brainv16->GetOutput());
    brainExtractor->SetValue(0, 15);
  vtkPolyDataMapper *brainMapper = vtkPolyDataMapper::New();
    brainMapper->ScalarVisibilityOn();
    brainMapper->SetLookupTable(hueLUT);
    brainMapper->SetInput(brainExtractor->GetOutput());
  vtkActor *brain = vtkActor::New();
    brain->SetMapper(brainMapper);




More information about the vtkusers mailing list