[Paraview] Python questions

James Perry j.perry at epcc.ed.ac.uk
Thu Feb 10 05:35:17 EST 2011


Hello,

We are attempting to use Paraview to visualise some data from a 
simulation. At present we have a standalone Python script that converts 
the data into a legacy VTK file which Paraview can read. Ideally we'd 
like to integrate the script into Paraview as a programmable source so 
that the data can be imported directly.

I have got the script running inside Paraview, but have encountered two 
problems and wondered if anyone knew how to avoid them:


1. The data is in the form of a vtkStructuredGrid. However the grid 
produced by the script won't display in Paraview and the information tab 
says it contains 0 points and 0 cells. (If the same data is written out 
to a VTK file and read in from there, it displays fine). We found this 
bug report:

http://public.kitware.com/Bug/view.php?id=2974

which suggests this behaviour is the result of a bug in VTK. Does anyone 
know if there is a workaround which would allow us to create a valid 
structured grid object from Python?


2. We would like to pop up a file selection dialog when the script runs 
instead of having the input filename hard-coded into it. According to 
this message:

http://www.paraview.org/pipermail/paraview/2010-April/017010.html

it should be possible to access PyQt functionality from within Paraview. 
However when I run the minimal example from the message it crashes 
Paraview. Does anyone know if there is something else I need to do to 
make this work? I'm aware it's not officially supported, but if someone 
has managed to do it I'd be interested to hear from them.


I'm running ParaView 3.8.1, built from source on Windows XP using Visual 
Studio 2008. I have Qt 4.7.1 and Python 2.6 with PyQt installed.

Many thanks,
James

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



More information about the ParaView mailing list