VTK FlowVR enables to:
To compile and run VTK FlowVR, the following tools should be properly installed:
VTK FlowVR is part of the FlowVR Suite. So download FlowVR Suite, compile and install it: see the FlowVR Suite documentation.
To launch the test example:
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.
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:
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:
See next section about where to find datasets.
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:
We only describe how to render a VTK application using FlowVR Render. The other approaches are still very experimental.
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).
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.
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:
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.
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.
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.
The .mml file for the quadric example defines:
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:
The resulting makefile for the quadric example is share/vtk-flowvr/Examples/Tcl/quadric/Makefile.
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.
From the share/vtk-flowvr/Examples/Tcl/quadric/ directory, compile the application with:
To launch the application (after starting a flowvr daemon - flowvrd):
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:
The different examples are: