3

I want to visualize some graph in paraview: a bunch of points with coordinates with a bunch of edges between them. I also want to color points and edges lines. I think this is not something hard to do with vtk format since i found that vtk format examples have almost something that i needed.

As i understand paraview uses point data to assign some scalar value to the point, and color lookup table to bind correspondence between scalar values and colors. But i barely can understand something from a description of lookup tables how to declare this. I've started with some modifications on vtk example of cube:

# vtk DataFile Version 2.0
Cube example
ASCII
DATASET POLYDATA
POINTS 8 float
-1.0 -1.0 -1.0
1.0 -1.0 -1.0
1.0 1.0 -1.0
-1.0 1.0 -1.0
-1.0 -1.0 1.0
1.0 -1.0 1.0
1.0 1.0 1.0
-1.0 1.0 1.0
LINES 12 36
2 0 1
2 0 3
2 0 4
2 1 2
2 1 5
2 2 6
2 2 3
2 3 7
2 4 7
2 4 5
2 5 6
2 6 7

POINT_DATA 8
SCALARS sample_scalars float 1
LOOKUP_TABLE my_table
0.0
1.0
2.0
3.0
4.0
5.0
6.0
7.0
LOOKUP_TABLE my_table 8
0.0 0.0 0.0 1.0
1.0 0.0 0.0 1.0
0.0 1.0 0.0 1.0
1.0 1.0 0.0 1.0
0.0 0.0 1.0 1.0
1.0 0.0 1.0 1.0
0.0 1.0 1.0 1.0
1.0 1.0 1.0 1.0

0) I really don't understand how coloring was performed on the result visualization. ( http://i49.tinypic.com/igksqa.png ) . How does the numbers in this file corresponds to this coloring?

What i want to modify:

1) How can i implement visible points. In this vtk file points are just anchors for the lines and are not visible. I want to display them as well and be able to vary their size in paraview just like line width could be modified (Display -> Style -> Point size). Also i want those points to be colored as well.

2) Can i somehow be able to turn on\off come colors. Let's say i have 5 colors and i want to be able to display only nodes\edges with one of the color. If i understand correctly, this could be achieved using several scalar tables, where each scalar table has colors with opacity = 0 for those nodes\edges which i do not want to display.

3) Am i right that lines couldn't be referenced directly and they are colored only using the two points' data ?

polotenchiko
  • 91
  • 2
  • 9
  • Only a partial answer (#3), but you can color lines directly like this: http://www.vtk.org/Wiki/VTK/Examples/Cxx/GeometricObjects/ColoredLines – David Doria Aug 14 '15 at 19:12

1 Answers1

0

File Formats in VTK

Hi, in the link you will find the answers you want about the lookup tables(the examples made it more clear)

The best fit would be Unstructured Grid, using differente cell types "vtk_vertex" and "vtk_line"

About the size, just apply a Glyph Filter to your data. You can set a scalar "Size" on your file, then you will be able to glyph each vertex by the size value you gave it.

Leo Pessanha
  • 141
  • 12