HomeNews and blogs hub

Experiences with ParaView and Python

Bookmark this page Bookmarked

Experiences with ParaView and Python

Author(s)

James Perry

Posted on 16 December 2010

Estimated read time: 3 min
Sections in this article
Share on blog/article:
Twitter LinkedIn

Experiences with ParaView and Python

Posted by s.hettrick on 16 December 2010 - 12:04pm

Python.jpgWhile working with the Culham Centre for Fusion Energy on streamlining the visualisation of output from the GS2 fusion simulation suite we've had a few tussles with the ParaView visualisation tool.

Beginning with an existing Python program that post-processes GS2 output into a format that can be read by ParaView, our initial goal was to modify the program so that it could be use as a component (a Reader) in a ParaView/VTK pipeline (ParaView is built on VTK).  One main requirement was to enable the user to be able to select input files via a dialog.

We worked with ParaView 3.8.0 (version 3.8.1 is now out).  Initially we used the downloadable binary; one initial niggle we encountered was that the path to the Python version it used (2.5.1) is hard coded in the binary.  Since our starting point required Python 2.5.5, we had no option but to download the ParaView source and build a new version.

Compiling ParaView is fine, if a rather lengthy process.  Edits were needed to the makefile to point it at the version of Python we wanted.

Our main task was to create the ParaView Reader in Python.  We searched the ParaView website for information on this with limited success: whilst there was material that appeared to be relevant, an overview to help synthesise this information into a detailed solution appeared to be lacking. Further, there is out-of-date information on the wiki - some examples which we downloaded would not load because the package structure of the Python code incorporated into ParaView had changed, for instance.

On the subject of wikis, there are two main ParaView wikis: http://www.paraview.org/Wiki/ParaView, used by most users; and http://www.paraview.org/ParaView3/index.php/Main_Page, where most development information is placed.  This second one proved most useful, but hard to find.

We learned the above by joining the mailing lists - and we'd recommend this for anyone planning to develop plugins or scripts to work with ParaView.

Following discussions on the list and the wiki for a while led us to the conclusion that to create a ParaView Reader implemented in Python one should embed the code in a “programmable filter”.  However, as far as we could ascertain, it is not possible to create a dialog box from a Python script embedded in ParaView - which defeated our initial requirement before we were off the ground!

ParaView is a powerful open-source visualisation tool, but our initial impressions of developing for it in Python suggest this is trickier than we'd like.  It was certainly hard to pick up off-the-shelf.  We may take a look at VisIt instead; we'll let you know how we get on!


 

Share on blog/article:
Twitter LinkedIn