[vtkusers] What am I forgetting ??
Malcolm Drummond
malcolm at geovision.co.za
Thu Jul 25 13:41:53 EDT 2002
Hi Jim
Your value range needs to be 0.0 1.0 (value is the third component of HSV,
not scalars).
Malcolm
----- Original Message -----
From: <harsh at lanl.gov>
To: <vtkusers at public.kitware.com>
Sent: Thursday, July 25, 2002 7:39 PM
Subject: [vtkusers] What am I forgetting ??
>
> 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
> ---------------------------------------------
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list