[vtkusers] How to use the lookup table.

Yukihiro Miyashita miyasita at sesys.co.jp
Wed Dec 27 05:27:35 EST 2000


Hello.

This is Miyashita.

I have a question as following. Please advice on me.
My E-mail is  miyasita at sesys.co.jp.
Thanks in advance.

I want to do as below:
   I make volume data.
   My software display the volume data with color.

Environment:
   Windows98,  Visual C++6.0

Now:
   I can make any shape which I want.
   But I can't paint color as I want.

I want to know the usage of lookup table.
How can I link the color table and the data.
How can I change the color of the part which I want.

Point of Program:
   this->Reader->SetFileName(strdup(lpszPathName));
   this->Mapper->SetInput(this->Reader->GetOutput());
   vtkStructuredPoints *volume = vtkStructuredPoints::New();
   volume->CopyStructure(this->Mapper->GetInput());
   volume->GetPointData()->SetScalars(this->Mapper->GetColors());
   vtkMarchingCubes *contour = vtkMarchingCubes::New();
   contour->SetValue(0,1.0);

Volume Data:
   Volume example
   ASCII
   DATASET STRUCTURED_POINTS
   DIMENSIONS 5 5 5
   ASPECT_RATIO 1 1 1
   ORIGIN -0.5 -0.5 -0.5
   POINT_DATA 125
   SCALARS volume_scalars float
   LOOKUP_TABLE my_table
   0.0 0.0 0.0 0.0 0.0
   0.0 0.0 0.0 0.0 0.0
   0.0 0.0 0.0 0.0 0.0
   0.0 0.0 0.0 0.0 0.0
   0.0 0.0 0.0 0.0 0.0
   0.0 0.0 0.0 0.0 0.0
   0.0 1.0 1.0 0.0 0.0
   0.0 1.0 1.0 0.0 0.0
   0.0 1.0 1.0 0.0 0.0
   0.0 0.0 0.0 0.0 0.0
   0.0 0.0 0.0 0.0 0.0
   0.0 1.0 1.0 0.0 0.0
   0.0 1.0 1.0 0.0 0.0
   0.0 1.0 1.0 0.0 0.0
   0.0 0.0 0.0 0.0 0.0
   0.0 0.0 0.0 0.0 0.0
   0.0 1.0 1.0 0.0 0.0
   0.0 1.0 1.0 0.0 0.0
   0.0 1.0 1.0 0.0 0.0
   0.0 0.0 0.0 0.0 0.0
   0.0 0.0 0.0 0.0 0.0
   0.0 0.0 0.0 0.0 0.0
   0.0 0.0 0.0 0.0 0.0
   0.0 0.0 0.0 0.0 0.0
   0.0 0.0 0.0 0.0 0.0
   LOOKUP_TABLE my_table 8
   0.0 0.0 0.0 0.0
   0.0 0.5 0.0 1.0
   0.0 0.0 0.5 1.0
   0.5 0.0 0.0 1.0
   0.5 0.2 0.0 1.0
   0.5 0.0 0.5 1.0
   0.0 0.5 0.5 1.0
   0.0 0.5 1.0 1.0

-----------------------------------
Best Regards,
Yukihiro Miyashita
E-mail:miyasita at sesys.co.jp




More information about the vtkusers mailing list