[vtkusers] errors from vtkParallelCoordinatesRepresentation with vtkDelimitedTextReader

Hal Canary hal at cs.unc.edu
Thu Sep 8 09:42:43 EDT 2011


Hi, everyone,

I'm trying to make use of VTK's vtkParallelCoordinates* classes, 
starting by simply viewing a CSV file, but I'm getting some errors that 
I'm having trouble understanding.

Here's the test code:

###########################################################
#!/usr/bin/env python
import vtk
import random
print vtk.VTK_VERSION
with open('tmp.csv','w') as tmpcsv:
   tmpcsv.write('"col0","col1"\n')
   for i in xrange(10):
     tmpcsv.write('%g,%g\n' %
       (random.random(), random.random()))
reader = vtk.vtkDelimitedTextReader()
reader.SetHaveHeaders(True)
reader.SetFileName('tmp.csv')
reader.Update()
table = reader.GetOutput()
for i in xrange(table.GetNumberOfColumns()):
   print '  Column(%d) = "%s"' % (i, table.GetColumnName(i))
print "  Number of rows:", table.GetNumberOfRows()

rep = vtk.vtkParallelCoordinatesRepresentation()
rep.SetInputConnection(reader.GetOutputPort())
rep.SetInputArrayToProcess(0,0,0,0,'col0')
rep.SetInputArrayToProcess(1,0,0,0,'col1')
view = vtk.vtkParallelCoordinatesView()
view.SetRepresentation(rep)
view.Render()
view.GetInteractor().Start()
###########################################################

And here is the output when I run it:

###########################################################
$ ./ParallelCoordinatesFromDelimitedTextVTK.py
5.8.0
   Column(0) = "col0"
   Column(1) = "col1"
   Number of rows: 10
ERROR: In /playpen2/local/VTK-5.8.0/Filtering/vtkAlgorithm.cxx, line 529
vtkParallelCoordinatesRepresentation (0x9cbe0e8): Attempt to get point 
or cell data from a data object

ERROR: In /playpen2/local/VTK-5.8.0/Filtering/vtkAlgorithm.cxx, line 529
vtkParallelCoordinatesRepresentation (0x9cbe0e8): Attempt to get point 
or cell data from a data object

ERROR: In 
/playpen2/local/VTK-5.8.0/Views/vtkParallelCoordinatesRepresentation.cxx, line 
501
vtkParallelCoordinatesRepresentation (0x9cbe0e8): No valid input arrays 
specified.

ERROR: In /playpen2/local/VTK-5.8.0/Filtering/vtkExecutive.cxx, line 756
vtkStreamingDemandDrivenPipeline (0x9cc30b0): Algorithm 
vtkParallelCoordinatesRepresentation(0x9cbe0e8) returned failure for 
request: vtkInformation (0x9de1828)
   Debug: Off
   Modified Time: 2572
   Reference Count: 1
   Registered Events: (none)
   Request: REQUEST_DATA
   FORWARD_DIRECTION: 0
   FROM_OUTPUT_PORT: 0
   ALGORITHM_AFTER_FORWARD: 1
###########################################################

Any help would be appreciated. Thanks!

-- 
Hal Canary
http://cs.unc.edu/~hal/



More information about the vtkusers mailing list