[vtkusers] How to color objects with RGB/HSV information?

jarv0075 jarv0075 at umn.edu
Fri Jun 18 10:49:17 EDT 2004


Try looking at the vtk file formats PDF.

What you want is to specify a lookup table for your point data, and then
below, specify the lookup table (i.e., the RGB scalars)

ASCII
DATASET POLYDATA

POINTS 149730 float
    71.991   116.657    34.780
    71.456   117.057    34.954
    71.918   116.970    34.862
    72.322   117.122    34.827
    71.833   117.411    35.008
    ......   .......    ......
    ......   .......    ......

POINT_DATA       149730
SCALARS fissure int
LOOKUP_TABLE lut
           0
           1
           2
           3
           .
           .

LOOKUP_TABLE lut 149730
      0.00000      1.00000     0.547929      1.00000
      0.00000      1.00000     0.538896      1.00000
      0.00000      1.00000     0.542680      1.00000
      0.00000      1.00000     0.554155      1.00000
      .......      .......     ........      .......
      .......      .......     ........      .......

Then after reading the file in, set your polydata to use the scalar data
specified in the file (in this case, 'fissure')




On 18 Jun 2004, ALIZIER Julien AUSY wrote:
> 
> Hi again,
> 
> This file works in ParaView :
> 
> <begin>
> # vtk DataFile Version 3.0
> ####
> ASCII
> DATASET POLYDATA
> 
> POINTS 3 float
>  0.0  0.0  0.0
>  1.0  0.0  0.0
>  0.0  1.0  0.0
> 
> POLYGONS 1 4
> 3 0 1 2
> 
> POINT_DATA 3
> VECTORS colour unsigned_char
>  255  0  0
>  0  255  0
>  0    0 255
> <end>
> 
> -- Julien
> 
> 
> 
> -----Message d'origine-----
> De : Immo Trinks [mailto:trinks at esc.cam.ac.uk]
> Envoy=E9 : jeudi 17 juin 2004 23:28
> =C0 : vtkusers at public.kitware.com
> Objet : [vtkusers] How to color objects with RGB/HSV information?
> 
> 
> Dear vtkUsers and vtkDeveloppers
> 
> Could you please help me with the following problem:
> I have a polydata set with xyz points and RGB vectors assigned to the =
> points
> 
> (see example below).
> How can I color the pixels using RGB or HSV information?
> Searching the archives and reading the book I haven't found any example =
> 
> explaining the assignment of three color values to an object via a =
> lookup=20
> table.
> I know how to color objects with one scalar value for each object.
> But I do not understand how to assign color to objects using three RGB =
> or
> HSV=20
> values.
> Is it correct to load the RGB information as vector or shall I use =
> scalars?
> I could as well provide HSV values instead of RGB if this would make =
> the=20
> process easier.
> Thank you very much for any help!
> 
> Immo
> _______________________________________________
> 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://www.vtk.org/mailman/listinfo/vtkusers
> 
---------------------------------------
 Timothy R. Jarvis                   
---------------------------------------
Graduate Research Assistant 
International Neuroimaging Consortium
VA Medical Center
612-467-2619
http://www.neurovia.umn.edu
---------------------------------------




More information about the vtkusers mailing list