[vtkusers] Writing VTK filters in Python and C

Robert Brown robb at sophitia.tera-byte.com
Wed Feb 20 18:00:22 EST 2002


I've got a vtkProgrammableFilter set up but the way I was getting the vtkStructuredPoints input was not working.  I got a void pointer which Python didn't know  how to deal with.  I've got a vtkStructuredPoints object -- do I have to use the point by point get and set functions to work with it?  I'd like to copy everything into a Numpy array, then put it back into the structuredpoints (ImageData) for output.

Thanks,

Robb

Yes, Ken and Berk are right (of course).  The vtkProgrammableFilter
will do the trick.  Note that the 'vtkStructuredPoints' data type
is equivalent to vtkImageData for most intents and purposes here.

Look at the man pages for the particular data type you want to use
as well as the pages for vtkDataArray.  Building data sets has
changed slightly (for the better) in VTK 4.x compared to 3.x.

 - David


On Fri, 15 Feb 2002, Ken Martin wrote:

> Isn't this a case where vtkProgramableFilter can be used ? It is a
> class that lets you fill in the execute method for a filter etc, and
> the execute method can be written in Tcl, Python, Java. I think there
> is a test of it in VTK/Graphics/Testing/Tcl
>
> Ken



More information about the vtkusers mailing list