Thursday, May 22, 2008

[Installer] Automatic installer for the pre-compiled libraries of VTK-5.0.2 in MinGW, Windows XP

Compilation of VTK in MinGW is even harder. It is really troublesome to get the libraries bulit.

The automatic installer for the MinGW version of pre-compiled libraries of VTK-5.0.2 in MinGW on Windows XP is also available now.

The download link can be found here:
http://www.driveway.com/n6i5y6n8o1

The screenshot of the installer is here (with embeded license of VTK):



For path settings, please view the install guide.

Wednesday, May 21, 2008

[Installer] Automatic installer for the pre-compiled libraries of VTK-5.0.2 in Visual Studio 7.1 (2003), Windows XP

After reviewing the license in VTK, I figured out that it is possible (and legal) to redistribute pre-compiled libraries in VTK.

I know it is very troublesome to compile the libraries by users. So, I have packed up the automatic installer for the pre-compiled libraries of VTK.

Currently, it is only available for VTK-5.0.2 in Visual Studio 7.1 (2003), Windows XP (But, it should be compatitable with future versions of Visual Studio compilers). I will add more kinds of distributions on request.

The download link can be found here: http://www.driveway.com/r2c6e0s6v0

The screenshot of the installer is here (with embeded license of VTK):
Screenshot of the installer

After installing the libraries, you need to set up the search pathes (i.e. include path and libraries path) for the IDE (in this case, Visual Studio 7.1). Please see the previous "Build VTK in Visual Studio" guideline to learn how to set up the pathes (Actually, you are not needed to go into the detail. You can just view the bottom few figures in the install guide).

The un-installer is provided in the install directory you specified.

Wednesday, May 14, 2008

Build VTK from source using MinGW/MSys

Here is the reference document on how to build VTK from source in MinGW/MSys



The minimal project for MinGW/MSys can be found here:



Two files are potentially useful in the build process:

http://code.hkpeterpeter.googlepages.com/CMakeLists.txt


http://code.hkpeterpeter.googlepages.com/jconfig.h


(Note: Although not quite accurate, you can think MinGW is a thin abstraction layer which allows you to port softwares in Unix-like environment to Windows with the minimal changes of code. MSys provides a Unix-like shell environment, just like bash/csh).

Wednesday, May 07, 2008

[Announcement] Invitation of editor

Dear all,

I have not updated for nearly a year. My previous goal is to accompany the weakness of the VTK mailing list. The mailing list is good source of information, but unfortunately lacking organized structure. The example programs given in the VTK source distributions are also nice, but most of them are written in scripting language which may not be suitable for C++ developers. That is the reason why I would like to write up some illustrative examples with demo figures and source codes using C++ programming language (instead of scripting language such as TCL and Python).

Dues to some personal issues, I can't fit this goal yet. For example, I am not an expert in medical imaging, but I have been asking some examples in C++ related to this field.

So, I would like to invite some volunteers to design and write some tutorials with are in similar format. The invited editors have ability to post some new articles, or edit the previous articles.

The requirements for the content are
===========================
1. Programming language (Must be C++)
2. Preferred codebase (Pure VTK is preferable, adding other libraries are okay, but need to explain how to get them in the post)
3. Platform (May not need to in Windows, other platforms are okay)
4. Source codes (Must include the source code - zipped or in a single cpp file, you can upload them to some free web spaces - e.g. Google Page Creator)
5. How to compile and build
6. (Optional) With a single image/video clip to illustrate what it is (to save time of viewers...)

Some possible topics may be interesting
============================
1. A survey of how to use VTK with other GUI libraries (e.g. such as FLTK, Qt)
2. Many illustrative examples of how to use VTK in different fields (such as volume rendering, medical imaging....)
3. Some latest features in VTK (such as GPU acceleration using shaders)
4. Using VTK with ITK (how to bridge them)
5. More....

For volunteers who are interested, please feel free to contact me via hkpeterpeter@gmail.com. I can grant the editing permission of this blog for volunteers.

Peter

Wednesday, June 13, 2007

Point and Line Plotter in VTK - A simple wrapper class

*Purpose: Beginners of VTK usually create a lot of actors for some primitive geometric objects (e.g. such as some simple points and lines). It is a waste to construct so many high level objects. Instead, we can always group multiple geometric primitives into a single actor. The rendering speed increases a lot when you do so.

I have created two simple wrapper classes to help us do the job. Their names are MyVTKPointPlotter and MyVTKLinePlotter. The classes are not well designed yet, but it works for many cases.

Sample usage:
// In demo.cpp

// Generate some random line and random points to plot
for (....)
{
pointPlotter.PlotPoint(....)
linePlotter.PlotLine(....)
}

// Add actors to the renderer
ren->AddActor(pointPlotter.CreateActor());
ren->AddActor(linePlotter.CreateActor());



(Please first follow the VTK installation guide to build VTK from source)




(P.S.) I haven't update this blog for almost a month. Sorry~

Tuesday, May 01, 2007

How to improve this blog?


The blog lanuches for about a month. The visiting rate is not good. I am busying with other stuff and unable to think of more interesting materials. I think that my materials are not interesting enough. What kind of things I should place here to make fun in VTK?

Thursday, April 19, 2007

Camera model in VTK

*Purpose: There are two wonderful examples to explain the camera model used in the VTK textbook. Unfortunately, they are in tcl scripts and not ready to run using C++. I have made some modifications and ported them to C++.

You can notice that we have only one version of roll (they are the same no matter you are at the camera position or at the focal point)!

(Please first follow the VTK installation guide to build VTK from source)



Sunday, April 15, 2007

Text output in VTK (2D and 3D)

*Purpose: VTK supports both 2D and 3D text rendering. For 2D, it usually uses vtkTextActor. We can control its font, shadow and display position (in 2D screen coordinates). For 3D, many possible options can be used. One favorable option is to use vtkVectorText with vtkLinearExtrusionFilter. It gives high-quality 3D text rendering.

(Please first follow the VTK installation guide to build VTK from source)




There major VTK classes are used in this demo: vtkTextActor, vtkVectorText, vtkLinearExtrusionFilter.

Friday, April 13, 2007

Examples package (ALL in C++)

Learning VTK in C++ may be difficult, because there are few C++ VTK examples with the standard source code package. Instead, it contains many tcl scripts which needs quite a lot of time to convert back to C++ source code.

I have written a converter to help the conversion. Here is the examples package (ALL in C++) that I have been ported. It contains more than 35 c++ examples.

(Please first follow the VTK installation guide to build VTK from source)
Examples package (ALL in C++):


Many examples in this pack need VTK data package. Please download it from http://public.kitware.com/VTK/get-software.php#latest and extract to any folder you preferred.

Then open project_config.h, locate the following source code and make changes

// In project_configure.h

#define VTK_DATA_ROOT "D:\\Users\\Peter\\bin\\VTKData\\Data\\"

// Change it into ...

#define VTK_DATA_ROOT <your VTK Data directory>

VTK: TCL script to C++ source code conversion

I have used C++ and FLTK to write up a simple tcl script to C++ source code converter. The conversion is quite primitive, but it saves me a lot of time to learn VTK.

Here is my test version of vtktcl2cpp converter (binary in Windows):


Features currently supported:

Simple GUI or Command line processing (vtktcl2cpp [in.txt] [out.txt] [header.txt])

Generate header files


Comments are welcomed!

Download VTK data

Besides download VTK source code from the VTK homepage, we can also download the VTK dataset to help us learning VTK.

http://public.kitware.com/VTK/get-software.php#latest

Multiple vtkRenderers

*Purpose: Create simple source objects. Demo the functionalities of multiple renderers.

(Please first follow the VTK installation guide to build VTK from source)





Many standard objects are used in this demo: cone, sphere, cube, disk, cylinder and arrow.

A simple interactive sphere in VTK

*Purpose: Create a simple sphere, users can interact with it.

(Please first follow the VTK installation guide to build VTK from source)






Basic interaction functionalities:

Mouse: zoom, pan, rotate...
'w': wireframe
's': surface rendering
'p': picking - highlight the bounding box of selected object
'+': increase resolution of the sphere
'-': decrease resolution of the sphere
'c': choose a random color for the sphere

Build VTK from source in Visual Studio

Here is the reference document on how to build VTK from source in Visual Studio and configure Visual Studio IDE



After you installed VTK and configure Visual Studio IDE. You can use this minimal project file to test your installation.