The VTK/Graphics/Testing/Cxx directory contains unit tests for these integration classes which illustrate the basic usage of their interfaces. There are also Python examples located in the VTK/Examples/Infovis/Python directory.
Applications of the GNU R to VTK interface for statistical hypothesis testing are already available. More specifically, an option to perform statistical tests has recently been added to the vtkDescriptiveStatistics and vtkContingencyStatistics classes: respectively, the Jarque-Bera normality and x2 independence tests. Although the test statistics themselves are directly computed in VTK, the calculation of the corresponding p-values requires that one-tailed probability values of the x2 distribution be available. This functionality is readily available with GNU R, by the means of the pchisq(x,df) function which computes the CDF of the x2 distribution, where each xi in the vector x has df degrees of freedom (plus an optional non-centrality parameter which we are not using). We have integrated this feature with the EvalScript() method defined in the VTK to GNU R interface. A single GNU R script specifying all the p-value calculations for each set of interest in the VTK filter is generated and executed. This calculation is done once for all p-values sets of interest, in order to reduce the compute time overhead of calling GNU R from VTK.
Examples that exercise and verify this functionality are available in VTK/Infovis/Testing/Cxx/TestDescriptiveStatistics.cxx and VTK/Infovis/Testing/Cxx/TestContingencyStatistics.cxx, both of which can be executed from InfovisCxxTests program in the VTK build directory.
Building VTK with MATLAB® Integration
A licensed installation of the base MATLAB software package must be present on the build machine. The integration work has been tested with MATLAB 2008b and newer. On Windows machines, ensure that the full paths to the MATLAB installation’s bin and bin/win32 (or bin/win64) directories are present in the system PATH environment variable.
This is normally done automatically by the MATLAB installer program on Windows. For Linux machines, ensure that the PATH environment variable contains the full path to the MATLAB installation’s bin directory, and that the LD_LIBRARY_PATH environment variable contains the full path to the MATLAB installation’s bin\glnxa32 (or bin\glnxa64) directory. For Macs, ensure that the PATH environment variable contains the full path to the MATLAB installation’s bin directory, and that the DYLD_LIBRARY_PATH environment variable contains the full path to the MATLAB installation’s bin\maci directory.
The CMake option to turn on the MATLAB integration code during the build is under advanced options as VTK_USE_MATLAB_MEX. If the system environment variables are set as described above, the MATLAB integration CMake macros should find everything needed to start the VTK build.
Building VTK with GNU R Integration
A build from source of GNU R 2.9.0 or newer is required. Please consult http://www.r-project.org/ for downloads and build instructions. A word of caution, the GNU R build process is considerably easier on Mac and Linux than on Windows.
The CMake option to turn on the GNU R integration code during the build is under advanced options as VTK_USE_GNU_R. The CMake system will attempt to locate the R installation, but most likely some manual specification of library and include paths will be necessary. The CMAKE variable R_INCLUDE_DIR is the full path to the R installation include directory, normally under <R_ROOT_DIR>\include. The R libraries are normally located in <R_ROOT_DIR>\bin. The CMake variable R_LIBRARY_BASE is the full path to the main R library, libR.lib (Windows), libR.dylib (Mac), or libR.so (Linux). The CMake variables R_LIBRARY_BLAS and R_LIBRARY_BLAS specify the full paths to the R Lapack and R Blas, if built separately. If these libraries do not exist on your system, just specify the same path used for R_LIBRARY_BASE in these CMake variables. The CMake variable R_LIBARY_READLINE is necessary only if R was built with GNU READLINE support enabled. Once the above CMake variables are set, the VTK build can then be started.
Thomas Otahal is a software developer working under contract at Sandia National Laboratories. He works with the Sandia Data Analysis and Visualization department on a variety of projects using the Titan/VTK Informatics toolkit and ParaView.