[Paraview] Difficulty in using threshold in a script

Jonathan Stott jonathan.stott at gmail.com
Mon Aug 11 12:00:45 EDT 2008


Hi all

I've been using paraview for a while, but I've recently aquirred the
need to do a lot of visualisations all at once, to save as pngs, so I
thought I would try scripting the commands.  Starting with the example
in the help, and looking through the threshold docs, as I understand
them (I've never programmed python before) I managed to get this
together:

from paraview import servermanager
if not servermanager.ActiveConnection:
	connection = servermanager.Connect()
	
reader = servermanager.sources.LegacyVTKFileReader(FileNames="D:\hetero_atrium\court0000.vtk")

thresh = servermanager.filters.Threshold(Input=reader,
ThresholdBetween=[-100,100])

view = servermanager.CreateRenderView()
rep = servermanager.CreateRepresentation(thresh, view)

view.ResetCamera()
view.StillRender()

which should, I think, read in the input file, apply a threshold of
-100 to 100 and then display the centred view on screen.  However, it
doesn't and instead I just see an empty box.  'Manual' visualization
confirms that the datafile is valid and shouldn't render as black for
the same threshold values.

Any pointers would be appreciated.

Regards,
Jon


More information about the ParaView mailing list