The Insight Toolkit itself is an "engine", and has no dependencies or requirements on any particular GUI or visualisation libraries. (In fact ITK can easily be used to write both console and batch-mode applications.)
InsightApplications (CVS) is a separate CVS repository that contains a wide variety of sample code, that demonstrate how to build complete applications with ITK.
Here is a small selection of the applications included:
- SNAP : A complete segmentation tool
- ... many more ...
Building Insight Applications
This section describes how to build the Insight Applications.
The following information is aimed at version 1.6 of the toolkit:
- ITK version 1.6+
- FLTK version 1.1.3
- Qt version 2.0+
- VTK version 4.2
- OpenGL/GLUT version 1.2+
The most commonly used GUI is FLTK, and many applications use VTK also. If you have these two libraries, you can build most of the applications.
Note that it is very important to match the version of InsightApplications with the version of ITK you are using. Thus, if you have version 1.6.0 of the toolkit installed, you should download the corresponding version 1.6.0 of InsightApplications here. If you have installed ITK from a CVS build, you should obtain a checkout of the applications from the same day. Further instructions can be found in BuildingFromCVS.
Create a separate directory for the build, eg:
% cd ~/projects/InsightApplications-1.6.0 % mkdir Build
Run CMake, pointing it at the top-level of the source directory:
% ccmake ..
The first time CMake comes up, you just need to press 'c' to perform the first-time configure step. This should find your compiler and other libraries. You may get a warning telling you that it is setting the CXX compiler to `g++` to match that imported from ITK; you can safely ignore this with 'e' and continue.
You are then presented with the first round of settings. Make the changes as summarised in the next section.
CMake Build Settings
The following settings are recommended to change from the default:
BUILD_SHARED_LIBS ON BUILD_TESTING OFF CMAKE_BUILD_TYPE Release USE_FLTK ON USE_VTK ON
Press 'c' again to configure this selection. If any of the libraries are not found in their default locations, you may get a warning, in which case you need to manually specify their locations. For example, on my system `VTK_DIR` comes up as `VTK_DIR-NOTFOUND` so I set it manually to `/usr/local/vtk/lib/vtk`.
Keep pressing 'c' to configure, and check any options that are highlighted with an asterisk '*'. Fill out any missing library locations, and eventually you will get the 'g' option enabled to generate the makefile.
Assuming all the libraries were found, and the makefiles were generated, you can now you can start the compile:
This can take quite some time, depending on the speed of your machine.
TBC: currently the applications do not install themselves, so running `make install` will have no effect.
You can simply run the applications from where they have been compiled.
Note that it may be convenient to have certain commonly used applications (such as the `ImageViewer` available on your path.
A note about paths
Many applications use the common libraries found in `InsightApplications/Auxiliary`. These need to be found at runtime by the system, so you can either:
- add the directory to your `PATH` (under Windows) or `LD_LIBRARY_PATH` (under *nix systems), or
- under *nix, rely on the rpath option being set to hard-code in the executables the location of the extra libraries