Friday 5 April 2013

VTK Installation


VTK Installation for QVTK Configuration

Download VTK from
Now follow these steps:
1.            Make a VTK folder where VTK will be installed and build
2.            Make two subdirectories inside VTK folder .Name them src and bin .
3.            Extract all files of downloaded VTK zip file into src
4.            Open Cmake GUI
5.            Enter path of src into Where is the source code:
6.            Enter path of bin into Where to build binaries:
7.            Click Configure. If compiler selection window popup then select compiler for example if you are                                                                                                        building for 64 bit choose 64 bit compiler(Caution: 64 bit VTK Build require 64 bit Qt library for that you can refer our Qt installation 64 bit  post).
8.            Click on Checkbox adjacent to VTK_USE_GUISUPPORT [as shown in Figure1].
9.            Click Configure.


Figure 1

10.          Click on Checkbox adjacent to VTK_USE_QVTK [as shown in Figure2].
11.          Check for DESIRED_QT_VERSION. It should be set itself otherwise write 4 [as shown in Figure3].
12.          Click on Checkbox adjacent to BUILD_DOCUMENTATION [as shown in Figure4].
13.          Under Build uncheck BUILD_SHARED_LIB.


Figure 2


Figure 3

14.          Now click configure again and generate
15.          Now check for VTK.sln in bin folder and build it in Visual Studio.

Using QVTK Widget in Qt designer
·         You have to built VTK in release mode, it should have generated a library file called lib QVTKWidgetPlugin.dll. [only if you are using VTK5.0 for other version you have to keep BUILD_SHARED_LIBS=ON]

·       Copy this dll in the [QTinstallDir]/plugins/designer/ directory, the QVTKWidget should show up at the bottom of the Widget Box (that list of widgets panel on the left in Designer).
 

2 comments:

  1. Hi,

    thank you so much for your post.

    I have a problem with the part of the widget. I 'm using Qt 5.7 and VTK 7.01. What I have to do? Maybe there is a different way to configuration.

    Many Thanks in advance.

    Giulia

    ReplyDelete
  2. Nice guide, there are many more details ofcourse, but a good summery. Unfortunately I learned these the hard way.

    ReplyDelete