You are on page 1of 21

Alexey I.

Baranov

Visualization Plugin for


ParaView
version 1.3

Springer
Contents

1 Visualization with ParaView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1


1.1 ParaView plugin installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.1 Installation of ParaView plugins . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1.2 Compilation of ParaView plugins . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Visualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.1 Visualizing the Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.2 Basics of Grid Data Visualization . . . . . . . . . . . . . . . . . . . . . . . 8
1.2.3 Clipping in ParaView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.2.4 Saving state in ParaView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.2.5 Tips and Tricks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

v
List of Tables

vii
List of Figures

1.1 Visualization pipeline for Structure plot . . . . . . . . . . . . . . . . . . . . . . . . . 4


1.2 ParaView plugin Bonds tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 ParaView plugin Paths tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4 ParaView plugin Cell tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.5 ParaView plugin Plotting Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.6 ParaView plugin Density basin surface colored according to
laplacian values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

ix
Chapter 1
Visualization with ParaView

The visualization of DGrid generated data can also be performed with the freeware
program ParaView which is available for many platforms including Microsoft Win-
dows, Linux and MacOS. An additional ParaView plugin is necessary for that. It
provides routines which read DGrid file formats, adds handy ParaView filters and
GUI controls. Plugin consists of two shared (dynamically linked) libraries.
The ParaView plugin installation is described in Sec. 1.1. Brief introduction into
ParaView controls and basic visualization steps is given in Sec. 1.2.

Detailed information about the ParaView can be found in the Internet at


http://www.paraview.org.

1.1 ParaView plugin installation

ParaView plugins are made available as separate part of the DGrid package. There
are two ways to deploy them:

Precompiled plugin is available for x86-64 Microsoft Windows official build of


ParaView. At the time of writing this Users Guide the version of ParaView 4.2.0
is supported. The plugin was tested on x86-64 Microsoft Windows 7 Profes-
sional. It can be downloaded from DGrid website as separate packages. The next
subsection 1.1.1 describes how to install the binary plugin.

The plugins can be build from the source code. To do this, one has to build the
ParaView from the source code in advance on the same machine.
This is the way to obtain the plugins when pre-build binary plugins are not avail-
able for target ParaView version or when customized build of ParaView is used
(compiler or libraries differ from those for official built).
See the Sec. 1.1.2 for instructions how to build the plugins from source code.

1
2 1 Visualization with ParaView

1.1.1 Installation of ParaView plugins

When installing a precompiled plugin, download the package from the DGrid web-
site and unpack it. Copy the plugin files 1 :
libGUIDGridPlugin
libSMMDGridPlugin
elf mk.xml
into folder e.g.

PVDGrid

ParaView should be informed about new plugins capable to work with DGrid
files. One way to do it is to set up system variable called PV PLUGIN PATH to the
path of that plugin folder. Another way is to load plugin via Plugin Manager (menu
Tools Manage Plugins ).
ParaView Wiki (http://www.paraview.org/Wiki/Plugin HowTo#Using Plugins) con-
tains additional information on loading plugins in ParaView.

1.1.2 Compilation of ParaView plugins

ParaView plugin build process is controlled by CMake build control system


(http://www.cmake.org) in which one should set up appropriate variables and then
generate the build configuration files like Makefile under Linux or Microsoft Visual
Studio solution file (*.sln) under Microsoft Windows. Finally the plugin is build
using the generated configuration file, e.g., invoking make command under Linux
or opening the solution in Microsoft Visual Studio and building it.
Download the plugin source code from DGrid website and unpack it into folder

dgrid-4.6/PVDGrid

First of all, download ParaView source code and build ParaView. Detailed in-
structions can be obtained at ParaView website
http://paraview.org/Wiki/ParaView:Build And Install. To compile ParaView, some
other tools like Qt or CMake must be available.
The configuration and build process for plugin is similar to that for ParaView
itself. Usually, the only important variable which has to be set up when configuring
ParaView plugin build in CMake is the ParaView DIR which should point to
ParaView build directory (and NOT to the ParaView source directory).
1 The versions of plugin for ParaView < 4.2.0 includes also additional .xml files.
1.2 Visualization 3

When everything runs successfully, plugin library files called libGUIDGridPlu-


gin and libSMMDGridPlugin should appear in the plugin build folder. Together with
elf mk.xml file located at dgrid-4.6/PVDGrid they comprise the plugin. Consult the
Sec. 1.1.1 on how to configure the ParaView to use the plugins.

1.2 Visualization

Start ParaView by typing paraview or clicking the appropriate icon. Load the DGrid
plugins via Plugin Manager if they are not loaded automatically (cf. 1.1.1).

ParaView plugin can visualize two types of files prepared by DGrid:


DGrid Property files containing the calculated properties on the grid.
DGrid Structure files (STR) containing molecular/crystal structures or topologi-
cal graphs.
To test plugins prepare some property grid (for instance the electron density grid
for oxazole as described in DGrid Users Guide).
1. Select the file to open (e.g. via menu File Open ).
2. Select the grid file. It will be scanned and boxes representing data sets found
in this file appear in the Pipeline Browser window. Normally each grid file
contains Structure data set with the structure and Property data set with the
scalar field on the grid (Fig. 1.1).
A window may appears with the suggestion to select the particular format. Select
then the appropriate DGrid format.

3. Press Apply button at the Properties tab to load the data. Some controls of
the data set become then available at Properties tab. General information about
data set can be found at Information tab.
Remark 1.1. If the file is not listed in the selector box and cannot be chosen, se-
lect All files (*) in the Files of Type menu of the selector box and try to open
that file. This can happen if the file has the extention which was not recognized by
ParaView.

If there is a problem to load the file, check in the ParaView Plugin Manager
(accessible via menu items Tools Manage Plugins ) if the DGrid plugins were
found and loaded. When plugins are not found, check how to add them to ParaView
in the Sec. 1.1.1. When plugins are found but can not be loaded, consult Sec. 1.1.2
how to recompile them or reinstall the proper version of ParaView.
The detailed instructions on the visualization of the grid data and the usage of
all the tools is described in details in ParaView guide (available as hardcopy book
4 1 Visualization with ParaView

only). A lot of valuable information can also be found at http://www.paraview.org


(Wiki, Tutorials, FAQ). A brief guide how to create isosurfaces, slices and basins is
given in Sec. 1.2.2. Following section describes the visualization of Structure data
set with current ParaView plugin.

Fig. 1.1 Visualization pipeline for structure plot and Atom tab of ParaView plugin.

1.2.1 Visualizing the Structures

Property files in DGrid format include also the structure data of the molecule
or crystal structure. To visualize the structure, select the Structure data set in
the Pipeline Browser and then apply Plot Structure filter to it (select from
the menu Filters Alphabetical Plot Structure and press Apply on the
Properties tab. Two additional data sets Ball-n-Stick and Labels appear in
the Pipeline Browser . First contains the geometrical representation of molecular
structure and second contains labels of the structure elements (Fig. 1.1). Structure
plot appearance is controlled via Properties tab of PlotStructure data set.
1.2 Visualization 5

1.2.1.1 Atoms tab

The controls for the Atoms tab are shown in Fig. 1.1.

Desired atom can be selected using pop-up selector.

Each atom type has default radius and color. They can be changed via Set Radius
field and Set Color button.
When several atoms of the same element type are present, a general name like
All C appears in the atom list. This item allow to set same parameters for all
atoms of that element type. Please note, that this item will discard the actual
parameters of specific atoms!

1.2.1.2 Bonds tab

The controls for the Bonds tab are shown in Fig. 1.2.

Fig. 1.2 ParaView plugin Bonds tab

Atoms forming bond can be selected using popup selectors Bond between .
General names are also available just like for atoms.

Each bond type can have unique radius and color. They can be changed via
Set Radius field and Set Color button.

The minimal and maximal bond lengths can be modified via Set Min./Max. Distance
Fields.
6 1 Visualization with ParaView

1.2.1.3 Paths tab

To visualize the interconnection paths first the file with the data for the critical points
and the path points, written in the DGrid Structure format, must be read in. When
file is read the Plot Structure filter can be started in the same way as in case of
the structure data, cf. page 4. In contrast to the atomic data, now the Atoms tab
does not contain atomic symbols but the symbols for the critical points (and cores),
i.e., Attr, Saddle, Ring, Min and Core respectively. General names for both critical
points and path types are also available.
The controls for the Paths tab are shown in Fig. 1.3.

Fig. 1.3 ParaView plugin Paths tab

Desired path can be chosen using pop-up selector.

Each path type has default radius and color given in the DGrid Structure file,
cf. DGrid Users Guide. They can be changed via Set Radius field and
Set Color button.

Path can be made hidden using Visible checkbox.

1.2.1.4 Cell tab

The buttons for the Cell tab are shown in Fig. 1.4.
The unit cell can be visualized using Cell tab controls. The unit cell data are
taken from the Lattice vectors part of the property file, cf, DGrid Users Guide.
The color and radius of the cell cylinders can be set via Set Radius field and
Set Color button. The unit cell plot is activated when Show Unit Cell box is
checked.
1.2 Visualization 7

Fig. 1.4 ParaView plugin Cell tab

1.2.1.5 General scale

The field Scale below the tab control sets up the general scale factor for all the
spheres and cylinders used in the structure plot.

1.2.1.6 Plotting labels

Labels can be shown for atoms, critical points and path fragments to make them
recognizable on the plot. Labels are created by Plot Structure filter and are shown
as additional data set called Labels. To plot the labels on the screen (see Fig. 1.5)
do the following:

Fig. 1.5 ParaView plugin Plotting labels


8 1 Visualization with ParaView

1. Go over ALL BUT Label data set boxes in Pipeline Browser , select Properties
tab and deactivate Pickable checkbox. Alternatively one may switch off the
visibility of the data set by clicking on the eye icon left to the box in the
Pipeline Browser and turn it on back when the labels are plot.

2. Click on Select Points Through button at the top of the visualization win-
dow (small buttons below Layout #1 text label on Fig. 1.5) and select with the
mouse the part of scene for which the labels should be shown.

3. Go to menu View and activate Selection Display Inspector checkbox if not


activated yet.

4. Go to the Selection Display Inspector and click on Point Label .

5. Activate Labels checkbox.

6. If numbers appears instead of text labels, press Edit Selection Label Properties
button (with gear label) below Point Labels button and modify Point Label Format
field to %s. Press Apply or OK button.
7. Label appearance (size, font, color etc.) can be tuned by pressing Edit Selection Label Properties
button (with gear label).

1.2.2 Basics of Grid Data Visualization

1.2.2.1 Isosurface

Select the desired data set in the Pipeline Browser and apply Contour filter
(from menu Filters ). The filter control panel appears on the Properies tab. Spec-
ify the isosurface level at the Value Range window there and press Apply to
show the isosurface. The color of the isosurface can be modified at Properties
tab.

1.2.2.2 Slice

Select the desired data set in the Pipeline Browser and apply Slice filter (from
menu Filters ). The filter control panel appears on the Properies tab. For flat
slice plot select Plane as slice type. Its position and orientation can be modified
1.2 Visualization 9

by the visual controls shown on the 3D plot or via Origin and Normal fields on
the Properties tab.
The colormap settings can be modified on the Properties tab. For instance, to
load a classic ELF colormap click on Edit Color Map button, press in the window
appeared a Choose Preset button and import elf mk.xml file, shipped as a part of
ParaView plugin. Then close the Preset Color Scale window.
To set custom range of values, corresponding to the full colorscale, press Rescale to custom range
button and modify the range min and max values in the window appeared.

1.2.2.3 Basin

The basin file contains a field of integer values which can be read in with the inter-
face as described for the property grids on page 3. Special route must be followed
for the visualization of the basins as separate solid objects:

1. After the basin file is read, apply Generate Basin Surfaces filter (from
menu Filters ) on its Property data set. This will create new data set called
GenerateBasinSurfaces .

2. Apply Plot Basin filter on this new data set. The basin to be visualized can be
selected on the Property tab.

3. Additionally, basin shape can be smoothed to produce more nice-looking plots.


This is done by extracting the basin surface with ParaView Extract Surface
filter and smoothing it with ParaView Smooth filter. The degree of smoothing
can be controlled by Number of iterations parameter. One should be careful
with very fine smoothing (> 500) since it may spoil out important shape features
and is time-consuming.

Basin color and other visualization settings can be modified on the Properties
tab.

The color of the isosurface or basin can not only be constant for all the points of
the object but be controlled by the value of other property at that point (Fig. 1.6). To
make such plots, data sets containing property for generating object (e.g. basin or
isosurface) and property used to color it should be merged into new combined data
set using Append Attribute filter from menu Filters . More than 2 properties
can be merged as well. The property used to color the object can be selected, using
popup control in the Coloring section of the Properties tab.
10 1 Visualization with ParaView

Fig. 1.6 ParaView plugin Density basin surface colored according to laplacian values

1.2.3 Clipping in ParaView

The visualization elements in ParaView can be clipped with the Clip filter (from
menu Filters ). Several types of clipping surfaces are available (e.g. Box, Sphere)
and one can clip either internal or external of that (activate Inside Out for the
latter). One can also clip the Ball-n-Stick structure plots.

1.2.4 Saving state in ParaView

The visualization scene produced with ParaView can be very complex. When Par-
aView is closed the whole arrangement, called state, is lost unless saved. The sav-
ing of a state is performed with File Save State . The state can then be later
loaded with File Load State .

1.2.5 Tips and Tricks

In ParaView 4.2.0 the control for selection of parallel/perspective projection has


been moved from Edit View Settings menu to Properties tab. To access it,
select builtin element in the Pipeline Browser and press settings button with
gear label. Advanced options will appear, including Camera Parallel Projection
1.2 Visualization 11

checkbox. Modify it when necessary and click on the button with floppy label right
to View(Render View) button to save the settings.
In ParaView 4.2.0 colormap is shown automatically by default for any kind of
data, i.e. also for the structures. To switch it off permanently, go to menu Edit
Settings , select tab General and modify under
Color/Opacity Map Range Options middle popup control from
Automatically Show and/or Hide Color Bars to
Automatically Hide Unused Color Bars .
In ParaView 4.2.0 the option Map Scalars, which maps the colors assigned to
visual objects using a colormap is activated by default. This means, that the color
for an atom, bond, path etc. set at the corresponding tab of Plot Structure filter
will be mapped and the object appears on the screen with different color. To switch
this option off, uncheck box Map Scalars under section Scalar Coloring on
the Property tab of Plot Structure filter and press a button with the floppy logo
right to the Display (GeometryRepresentation) control.
Index

Basin smoothing, 9 Property file, 3

colormap, 9

merging dataset attributes, 10 Structure file, 3

13

You might also like