[vtkusers] Titan and graph vis

Wylie, Brian bnwylie at sandia.gov
Fri Mar 26 12:02:34 EDT 2010


One more option...

5) Create a vtkTable from python arrays... (see VTK\Examples\Infovis\Python\tables1.py )

:)

  Brian Wylie - Org 1424
  Sandia National Laboratories
  MS 1323 - Building CSRI/242
  (505)844-2238 FAX(505)284-2518   
       _______ __
      /_  __(_) /_____ _____
       / / / / __/ __ `/ __ \
      / / / / /_/ /_/ / / / /
     /_/ /_/\__/\__,_/_/ /_/
            Informatics Toolkit


-----Original Message-----
From: owner-titan-help at sandia.gov [mailto:owner-titan-help at sandia.gov] On Behalf Of Wylie, Brian
Sent: Friday, March 26, 2010 9:59 AM
To: 'Stephan Gerhard'
Cc: titan-help; 'vtkusers at vtk.org'
Subject: RE: Titan and graph vis

Hi Stephan,

Hmmm... a couple of options...

1) Put your data into a delimited text file (see example VTK\Examples\Infovis\Python\delimited_text_reader2.py).
2) You can create a graph from scratch (a bit harder.. see \Examples\Infovis\Python\graph1.py)
3) You could put your data into some standard graph format (like XGML... see graph3D.py)
4) You could pull data from a database (see databases.py databases2.py)

One thing to note is that for options 1 and 4 you can have two tables, one for the edges and edge attributes and one for the vertices and vertex attributes...  the vertex table is optional but if you want any attributes on your vertices you need to have one...

See databases.py 
<clip>
graph = vtkTableToGraph()
graph.AddInputConnection(edge_table.GetOutputPort())
graph.AddLinkVertex("source", "Name", False)
graph.AddLinkVertex("target", "Name", False)
graph.AddLinkEdge("source", "target")
graph.SetVertexTableConnection(vertex_table.GetOutputPort())
</clip>

I hope this helps or at least points you in the right direction, feel free to send follow up questions :)

 

  Brian Wylie - Org 1424
  Sandia National Laboratories
  MS 1323 - Building CSRI/242
  (505)844-2238 FAX(505)284-2518   
       _______ __
      /_  __(_) /_____ _____
       / / / / __/ __ `/ __ \
      / / / / /_/ /_/ / / / /
     /_/ /_/\__/\__,_/_/ /_/
            Informatics Toolkit


-----Original Message-----
From: Stephan Gerhard [mailto:connectome at unidesign.ch] 
Sent: Friday, March 26, 2010 9:20 AM
To: Wylie, Brian
Subject: RE: Titan and vtkSNL

Hi Brian,

Thank you for your quick answer. It is great to see these things in VTK
already. Yesterday, I tried a long time to do a simple thing actually.
I'll definitely learn more about VTK to understand its workings. Anyway,
you can answer me that one, or I will ask on vtkusers then.

I understand how to build the graph rendering pipeline, but I wasn't
able to get my data into it, i.e. defining the source. I simply have
three arrays (I'm on Python), two Numpy, one a label list.

nodeidx = np.array([0,1,2])
edgeidx = np.array([[0,1],[1,2]])
labels = ['a','b','c']

Now how can I initialize a GraphSource? (an object with an output_port).
I found that the ways to do it accessing a database, and then using
RowToTable, TableToGraph. I tried also to initialize a Table, which I
couldn't do. Alternatively, it would be possible to initialize a
MutableUndirectedGraph with AddVertex, looping through the array, but
I'm sure there must be another solution.

Strating from an adjacency matrix would even be better. But how can I
initialize the appropriate VTK object to be used in a similar fashion
from Python Numpy arrays?

I just need this little connection from datasource to the graph VTK
pipeline to take off :)

Hope you can help,
Stephan

Am Donnerstag, den 25.03.2010, 11:35 -0600 schrieb Wylie, Brian:
> Hi Stephan,
> 
> Good to hear of your interest in Titan. vtkSNL is just an internal staging area for us, all of the Titan work already flows in VTK on a regular basis. If you look at the tutorial at http://titan.sandia.gov all(well the vast majority) is in VTK. In fact some of the material is covered in the new book..
> 
> Feel free to contact me or titan-help at sandia.gov or vtkusers at vtk.org for help or questions.
> 
> -Bri
> 
> From: David E DeMarle <dave.demarle at kitware.com>
> Date: Fri, 19 Mar 2010 08:59:40 -0600
> To: vtkdev <vtk-developers at vtk.org>, <vtkusers at vtk.org>
> Subject: [vtk-developers] ANNOUNCEMENT : New the VTK User's Guides are finally ready!
> 
> Kitware is pleased to announce the release of the Eleventh Edition of the VTK User’s Guide. The VTK User's Guide is a companion text to The VTK Textbook <http://kitware.com/products/books/vtkbook.html> ; while The VTK Textbook stresses algorithmic and data structure details, the VTK User's Guide stresses how to use the software.
> The Eleventh Edition features a new chapter detailing VTK's information visualization functionality, including the table, graph, and tree data structures required to represent non-spatial data; enhanced details on 2D and 3D widgets and other forms of user interaction required to create an exploratory visualization application; a new chapter on geospatial visualization for geographically organized data; additional details on time dependent and composite data; and a discussion of advanced rendering techniques, including depth peeling for transparency. 
> 
>   Brian Wylie - Org 1424
>   Sandia National Laboratories
>   MS 1323 - Building CSRI/242
>   (505)844-2238 FAX(505)284-2518   
>        _______ __
>       /_  __(_) /_____ _____
>        / / / / __/ __ `/ __ \
>       / / / / /_/ /_/ / / / /
>      /_/ /_/\__/\__,_/_/ /_/
>             Informatics Toolkit





More information about the vtkusers mailing list