[vtkusers] no GetOutput for vtkImageData?

Daren Scot Wilson textglutton at darenscotwilson.com
Mon Mar 9 04:45:12 EDT 2009


I am really stuck!  I think i want to feed the 3d data in a vtkImageData 
to a vtkContourFilter, but the code i tried won't work.  Expecting 
vtkImageData to have a GetOutput method, but it doesn't.   I'm using 
VTK5.2.1 and pyvtk in Python 2.6, running on Arch Linux x86_64.  I'm not 
yet experienced enough at VTK to see any obvious error; 99% sure i'm 
just missing some obvious detail.

from vtk import *

vdata = vtkImageData()
vdata.SetDimensions(nx,ny,nz)  # order?
varr = vtkFloatArray()
#  ... fill varr with numbers ...
vdata.GetPointData().SetScalars(varr)
vdata.Update()

con=vtkContourFilter()
con.SetInput(vdata.GetOutput())   <-- UNHAPPINESS HERE!

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: GetOutput




More information about the vtkusers mailing list