[vtkusers] Medical3.cxx : need to call Build() on vtkLookupTable

Michael Dussere dussere at labri.fr
Wed Mar 24 11:48:27 EST 2004


Hi,

I'm using vtk 4.2 and I get some difficulties with vtkLookupTable class.
The example Medical3.cxx need to be fixed because the slices do not appear.

It is due to the vtkLookupTable instances that are not built. Usually, 
it seems that vtkMapper calls this method but in Medical3 example 
vtkLookupTable is used directly with vtkImageMapToColors and 
vtkImageActor. To solve this problem one can call vtkLookupTable::Buil() 
directly.

   vtkLookupTable *satLut = vtkLookupTable::New();
     satLut->SetTableRange (0, 2000);
     satLut->SetHueRange (.6, .6);
     satLut->SetSaturationRange (0, 1);
     satLut->SetValueRange (1, 1);
     satLut->Build(); // need to be added for each vtkLookupTable
   vtkImageMapToColors *saggitalColors = vtkImageMapToColors::New();
     saggitalColors->SetInput(v16->GetOutput());
     saggitalColors->SetLookupTable(bwLut);
   vtkImageActor *saggital = vtkImageActor::New();
     saggital->SetInput(saggitalColors->GetOutput());
     saggital->SetDisplayExtent(32,32, 0,63, 0,92);




More information about the vtkusers mailing list