This is my first post to this list.
I would like to announce the first release of a Python module I wrote to export
scientific data to binary VTK files. The source code for the module can be
downloaded from its Mercurial repository at bitbucket. To get a copy, type on
terminal window:
hg clone https://pau...@bitbucket.org/pauloh/pyevtk
PyEVTK (Python Export VTK) package allows exporting data to binary VTK files for
visualization and data analysis with any of the visualization packages that
support VTK files, e.g. Paraview, VisIt and Mayavi. EVTK does not depend on any
external library (e.g. VTK), so it is easy to install in different systems.
The package is composed of a set of Python files and a small C/Cython library
that provides performance critical routines. PyEVTK provides low and high level
interfaces. While the low level interface can be used to export data that is
stored in any type of container, the high level functions make easy to export
data stored in Numpy arrays. In addition, it provides a helper class to create
pvd files that can be imported into Paraview to visualize time dependent data
series.
PyEVTK is released under the GPL 3 open source license. A copy of the license is
included in the src directory.
Please see below for an example of how to use the high level routines. More examples
are included in the package.
I hope you will find this package useful and I look forward to getting your feedback.
Paulo
High-level interface example:
=============================
from evtk.hl import imageToVTK
import numpy as np
# Dimensions
nx, ny, nz = 6, 6, 2
ncells = nx * ny * nz
npoints = (nx + 1) * (ny + 1) * (nz + 1)
# Variables
pressure = np.random.rand(ncells).reshape( (nx, ny, nz), order = 'C')
temp = np.random.rand(npoints).reshape( (nx + 1, ny + 1, nz + 1))
imageToVTK("./image", cellData = {"pressure" : pressure}, pointData = {"temp" : temp} )
_______________________________________________
SciPy-User mailing list
SciPy...@scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user
> PyEVTK (Python Export VTK) package allows exporting data to binary VTK files for
> visualization and data analysis with any of the visualization packages that
> support VTK files, e.g. Paraview, VisIt and Mayavi. EVTK does not depend on any
> external library (e.g. VTK), so it is easy to install in different systems.
That sounds very useful - thank you for posting it.
> PyEVTK is released under the GPL 3 open source license. A copy of the license is
> included in the src directory.
Would you consider changing to a more permissive license? We
(nipy.org) would have good use of your package, I believe, but we're
using the BSD license.
Thanks a lot,
Matthew
> Hi,
>
>> PyEVTK (Python Export VTK) package allows exporting data to binary VTK files for
>> visualization and data analysis with any of the visualization packages that
>> support VTK files, e.g. Paraview, VisIt and Mayavi. EVTK does not depend on any
>> external library (e.g. VTK), so it is easy to install in different systems.
>
> That sounds very useful - thank you for posting it.
Good to hear you think you could use it in your project.
>> PyEVTK is released under the GPL 3 open source license. A copy of the license is
>> included in the src directory.
>
> Would you consider changing to a more permissive license? We
> (nipy.org) would have good use of your package, I believe, but we're
> using the BSD license.
I'd like to release it with a license that is compatible with the GPL license. It seems that the FreeBSD license satisfies that requirement (http://en.wikipedia.org/wiki/BSD_licenses). Would the FreeBSD be useful for you?
Paulo
>>> PyEVTK is released under the GPL 3 open source license. A copy of the license is
>>> included in the src directory.
>>
>> Would you consider changing to a more permissive license? We
>> (nipy.org) would have good use of your package, I believe, but we're
>> using the BSD license.
>
> I'd like to release it with a license that is compatible with the GPL license. It seems that the FreeBSD license satisfies that requirement (http://en.wikipedia.org/wiki/BSD_licenses). Would the FreeBSD be useful for you?
That's great - thank you. We use the 3-clause BSD license mainly [1],
and the MIT license in one project, but the 2-clause 'simplified' BSD
that FreeBSD uses is ideal.
Thanks again,
Matthew
[1] http://www.opensource.org/licenses/bsd-license.php
Hi Paulo,
how hard would it be to read back the types of VTK files that you can write ?
This would be not only be useful to write tests ...
But also to - say - write some basic data filters, or just using the
VTK format for all I / O needs...
- Sebastian Haase
I don't think it would be very difficult to read data back from a VTK file. In fact, I implemented a similar module in Java that also allowed reading back the data.
The best approach to parse back the data is to read the XML header and process it with some standard XML library. From the XML header, one can get the position of the beginning of data array in the file. Then, one only need to go to the position in the file where the data is stored and read it back.
On the other hand, I'm not sure the current VTK format is the best option to store large amount of data. So far, I've been using h5py to write HDF5 files for long-term storage and I only use my module to export data for visualization when I need it. My hope is that the VTK developers will adopt HDF5 as the future basis for a new VTK binary file format. XDMF is a good starting point but it seems it still needs more time before it becomes the default storage format.
Paulo
I just changed the license of the files in the repository to a FreeBSD
license. I hope this will make easier to use the module.
Paulo
On Tue, Nov 30, 2010 at 9:19 AM, Matthew Brett <matthe...@gmail.com> wrote: