[Paraview] contour programmable filter

Favre Jean jfavre at cscs.ch
Wed Oct 6 15:19:44 EDT 2010


The use of a programmable filter is perhaps more than you actually needed, now that you know how to get the range of the input. I would start simply with the Python shell, create a contour and create its representation like this:

SetActiveSource(Input) # set your input here, if not already selected as "active"

c1 = Contour()
c1.Isosurfaces = [max - 0.1]
Show(c1) # this will create the geometry and add it to your view
Render()

Otherwise, if you still want to do it with a programmable filter, you're probably missing the last two lines:

c = vtk.vtkContourFilter()
c.SetInput(pdo)
c.SetValue(0, 0.01)
c.Update()
self.GetOutput().ShallowCopy(c.GetOutput())

The Update and the ShallowCopy() are the most important. 

-----------------
Jean M. Favre
Swiss National Supercomputing Center


More information about the ParaView mailing list