[vtkusers] Testing vtkProgrammableAttributeDataFilter in python??

Maurice van de Rijzen maurice at akst.tn.tudelft.nl
Fri Feb 28 03:33:33 EST 2003


Dear all.
I'm currently trying to understand how vtk executes its pipeline in 
combination with a programmable filter.
I've three inputs that I want to connect with the 
vtkProgrammableAttributeDataFilter, the first one is an instance of 
vtkImageData and the other two are  vectors converted to vtk.
 
data3D = vtkImageData()
dimVector = Numeric.array(full_5D.Matrix.shape,Int16)
indexVector = Numeric.array([1,2,3,0,0],Int16)

dimVector_vtk = NumpyToVtk_Short_5D(dimVector)
indexVector_vtk = NumpyToVtk_Short_5D(indexVector)

vtkSliced = vtkProgrammableAttributeDataFilter()
vtkSliced.Data5D = full_5D.GetOutput()
vtkSliced.SetInput(data3D)
vtkSliced.AddInput(dimVector_vtk.GetOutput())
vtkSliced.AddInput(indexVector_vtk.GetOutput())

def test():
  print "test"

vtkSliced.SetExecuteMethod(test)
dimVector_vtk.modified()


I expected this script to execute  vtkSliced.SetExecuteMethod(test) and 
print test because in manually send modified to dimVector_vtk but it 
didn't print.
After this I added a line after dimVector_vtk.modified():
vtkSliced.Update()
And again no test was printed on the screen.
I know vtkImageData contains no data but in this script I just want to 
see whether I understood the vtk pipline principle and as you can see I 
didn't.
Can someone explain what I'm overlooking.

Thanks,
Maurice van de Rijzen






More information about the vtkusers mailing list