[vtkusers] Writing VTK filters in Python and C

David Gobbi dgobbi at irus.rri.ca
Fri Feb 15 15:20:47 EST 2002


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
>
>
> > -----Original Message-----
> > From: vtkusers-admin at public.kitware.com
> > [mailto:vtkusers-admin at public.kitware.com]On Behalf Of David Gobbi
> > Sent: Friday, February 15, 2002 12:31 AM
> > To: Robert Brown
> > Cc: VTK users list
> > Subject: Re: [vtkusers] Writing VTK filters in Python and C
> >
> >
> > To add some additional clarification,
> >
> > 1) It isn't possible to write a VTK filter in Python.
> > Maybe sometime
> >    in the future it will be.
> >
> >    Well, that's not quite true... if you look into all
> > places where you
> >    can hook callbacks into VTK it probably is possible in
> > some limited
> >    cases.  But it wouldn't be easy, and I wouldn't advise it.
> >
> > 2) Writing & wrapping your own VTK classes is a topic that
> > is covered
> >    fairly substantially in both the User's Guide and in the
> > archives.
> >    In VTK 3.x it basically amounts to adding your class to
> > the appropriate
> >    VTK subdirectory (usually 'local') and adding the class name to
> >    the Makefile.in in that directory, then running 'configure'
> >    (or pcmaker), then make (or nmake).  For VTK 4.x this topic was
> >    recently discussed to death, and I can't tell you my
> > method because
> >    the VTK gods have declared it to be heresy ;)
> >
> >  - David
> >
> > --
> >   David Gobbi, MSc                       dgobbi at irus.rri.ca
> >   Advanced Imaging Research Group
> >   Robarts Research Institute, University of Western Ontario
> >
> > On Fri, 15 Feb 2002, Prabhu Ramachandran wrote:
> >
> > > >>>>> "RB" == Robert Brown <robb at sophitia.tera-byte.com> writes:
> > >
> > >     RB> I want to write a filter to modify a dataset.  I'd like to
> > >     RB> implement it in Python to see how it works, then in C if I
> > >     RB> like it.  Is it possible to write a class in
> > Python that can
> > >     RB> be used in the VTK pipeline as a filter?  What's involved?
> > >
> > > With the latest CVS tree you can subclass another VTK
> > class.  However,
> > > you need to be a little careful.  This post from David
> > should help.
> > >
> > >
> http://public.kitware.com/pipermail/vtkusers/2002-January/009142.html
> >
> > prabhu
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at:
> <http://public.kitware.com/cgi-bin/vtkfaq>
> > Follow this link to subscribe/unsubscribe:
> > http://public.kitware.com/mailman/listinfo/vtkusers
> >
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>




More information about the vtkusers mailing list