Subsections


4. VTK FlowVR

4.1 Introduction

VTK FlowVR enables to:

4.2 Getting Started

4.2.1 Dependencies

To compile and run VTK FlowVR, the following tools should be properly installed:

4.2.2 Download, Compilation, Installation and Environment Variables

VTK FlowVR is part of the FlowVR Suite. So download FlowVR Suite, compile and install it: see the FlowVR Suite documentation.


4.2.3 Testing

To launch the test example:

bin/vtk-flowvr-demo.sh


4.2.4 Sample Datasets

Beside the test demo, VTK FlowVR comes with various examples (installed into share/vtk-flowvr/Examples/Tcl). Before to run these examples you need extra datasets not included into the FlowVR Suite package.


4.2.4.1 Prepare

Some datasets need to be installed in one particular directory: It is case for the 3D Fluid, XMasTree LO and Chapel Hill CT Head datasets. Use the VTK_FLOWVR_DATA_ROOT environment variable to give access to this directory. For instance put in your .bashrc:

export VTK_FLOWVR_DATA_ROOT=/where/is/the/directory

The same goes for the VTKData package: set the VTK_DATA_ROOT environment variable so it points to the directory containing the data. For instance put in your .bashrc:

export VTK_DATA_ROOT=/where/is/the/directory

See next section about where to find datasets.


4.2.4.2 Download

Extra volume rendering examples are based on datasets gathered by Roettger (http://www9.cs.fau.de/Persons/Roettger/library/):

You can use the Datasets/generate.sh script (only available in the source code) to download and install these datasets or you can just follow the steps bellow:

4.3 User Manual

4.3.1 Overview

We only describe how to render a VTK application using FlowVR Render. The other approaches are still very experimental.

4.3.2 VTK Viewer

We present in the following how to turn a VTK application into a FlowVR Render viewer module. We rely on a TCL example. Support for C++ is also provided (apply the same changes as the one proposed for TCL).


4.3.2.1 Limitations

The current VTK FlowVR version is an early release. It imposes a number of limitations on the VTK applications that can use VTK FlowVR for rendering:

These limitations will be suppressed in future releases.

4.3.2.2 Context

The chosen example is based on theVTK quadric example. The goal is to visualize the following complicated equation for a quadric:

(4.1)

The value of this function is calculated over a regular 3D array of points (i.e., a volume or structured point dataset), and then an iso-contour of the quadric , where is a constant (i.e. the contour value), is computed and assigned a color for the rendering.

To render this VTK application using FlowVR Render is a 3 step process:

These steps are detailed in the following.

4.3.2.3 Code Modifications

Based on the VTK quadric sample, we show the necessary modifications required to turn a standard VTK program into a FlowVR Render viewer.

See VTK documentation for more information about this example.

4.3.2.4 .desc File

As required by FlowVR, each module must be associated with a .desc file (metamodule description file). Because all VTK viewers only differ by their script name, we provide a generic .desc file

The script is defined by the template <template id=''script''>/path/to/script/</template> to be instantiated in the .mml file with the correct name. If a relative path is given, note that it is relative to the desc file location.


4.3.3 FlowVR Network

Following the FlowVR programming model, to set up an application we need to build a network. For that purpose we need:

In the following we detail how to set up an application launching one VTK viewer and one FlowVR Render renderer on the same machine. Starting from this configuration a user can build complex networks, for rendering on multiple displays for instance.

4.3.3.1 .mml File

The .mml file for the quadric example defines:

4.3.3.2 Perl Script

Use the standard src/perl/render-swaplock.plï¿12and src/perl/render-fifo.pl perl scripts for connecting viewers and renderers that is provided with FlowVR Render.

This is simply done by setting the PERL variable in the Makefile of the application to:

PERL= render-swaplock.pl | render-fifo.pl.

The resulting makefile for the quadric example is share/vtk-flowvr/Examples/Tcl/quadric/Makefile.

4.3.3.3 The Resulting Application

The resulting application consists in a viewer (the VTK module) and a renderer (the Visu/render/0 module and its associated module for swaplock Visu/Swaplock/0.

Figure: The network of the vtk quadric example using FlowVR Render for rendering.
Image quadric


4.3.4 Compiling and Running the Application

From the share/vtk-flowvr/Examples/Tcl/quadric/ directory, compile the application with:

make

To launch the application (after starting a flowvr daemon - flowvrd):

make run

FlowVR-GUI
None of the Tcl examples are GUI compliant for the moment.

4.4 Other Examples

Other examples are provided. They are located in the source tree under Examples/Tcl.

Some of these examples require external datasets that must have been properly installed.

To compile and execute each of these examples, go into the target directory, compile with:

make
Execute (a FlowVR daemon must be running) with
make run

The different examples are:

2009-04-06