>> Noel O'Boyle

VTK and Python

The Visualisation Toolkit (VTK) is a library for displaying 3D data. MayaVi is a Python interface to the toolkit, which provides an easy-to-use GUI as well as additional filters and visualisation modules.

Visualising Gaussian cube files with the VTK

To create a .vtk file from a Gaussian cube file, use [Cube2VTK.py] which creates cubefile.vtk. Requires: pyvtk and scipy.

You can open this in MayaVi (mayavi -d cubefile.vtk) and select the isosurface module to view the isosurface. Alternatively (although perhaps less usefully) you can visualise the volume data itself by selecting first the StructuredPointsProbe filter, and then the Volume module.

Note: VTK itself already has a Gaussian Cube Reader, but this does not read the volume data, only the atom info (or so it seems).

Things to do: use the MayaVi/Python example on the MayaVi web page to create a StructuredPoints object directly. Maybe consider also using the Gaussian Cube Reader to draw the molecule at the same time?