[vtkusers] What am I forgetting ??

harsh at lanl.gov harsh at lanl.gov
Thu Jul 25 13:39:44 EDT 2002


Hi,

It's been awhile since I worked with VTK and am forgetting how
to set up a black and white lut. My data is 2D, 256x256 values 
ranging between 0 and 20.0. I've tried that below pipeline and
what is displayed is wrong. where the values are 20.0 and 0.0 the image is
black the sloped part of the data id bands of white. Im working on 
a Linux box. Samples appear to run OK, so I think the box's display is 
OK. I'm running 4.0 of VTK.

Thanks for any suggetions,
Jim

  .
  .
  .

vtkFloatArray *farray = vtkFloatArray::New();
farray->SetNumberOfValues(NxPixels * NyPixels);
farray->SetNumberOfComponents(1);
for(i=0;i<(NxPixels*NyPixels);i++){
   farray->SetValue(i,outputImage[i]);
   }


vtkStructuredPoints *data = vtkStructuredPoints::New();
data->SetScalarTypeToFloat();
data->SetDimensions(256,256,1);
data->GetPointData()->SetScalars(farray);

vtkLookupTable *lut = vtkLookupTable::New();
lut->SetHueRange( 0.0, 0.0);
lut->SetSaturationRange( 0.0, 0.0);
lut->SetValueRange(data->GetScalarRange());
lut->SetNumberOfColors(256);
lut->Build();


vtkDataSetMapper *map = vtkDataSetMapper::New();
map->SetInput(data);
map->SetLookupTable(lut);
map->SetScalarRange(data->GetScalarRange());
map->SetColorModeToMapScalars();

  .
  .
  .





---------------------------------------------
Jim Harsh  E-Mail: harsh at lanl.gov
Los Alamos National Laboratory, MS P940
Los Alamos, NM 87545
505-665-0485, FAX - 505-665-3359
Date: 25-Jul-2002,Time: 10:31:56
---------------------------------------------



More information about the vtkusers mailing list