Next: C. Bioimagesuite FAQ Up: 9 Appendices Previous: A. Installing Other Software Contents
Subsections
- B.1 Overview
- B.2 Compiling BioImage Suite
- B.3 Compiling the Prerequisites
- B.3.1 The vtk44_yale distribution
- B.3.2 The itk241_yale distribution
- B.3.3 The bioimagesuite_extra distribution
- B.4 Miscellaneous
B. Compiling BioImage Suite
B.1 Overview
Installing BioImage Suite consists of four parts.
- Installation of a pre-compiled binary itk241_distribution
containing the Insight Toolkit (ITK) v 2.4.1. For more
information on ITK see http://www.itk.org">www.itk.org.
- Installation of a combo binary vtk44_yale distribution containing
the Tcl/Tk scripting language, various extensions and the Visualization
Toolkit. This includes binary versions of:
- The Tcl/Tk scripting language v 8.4.11 [34].
- The following Tcl/Tk Extensions:
- The CLapack numerical library v3.
- A slightly patched version of the Visualization Toolkit v4.4.2
[92] with TCL Wrapping enabled. Two classes have been changed:
- vtkDataArray.cxx - to eliminate a GetRange() bug - we simply used a later version of the file from the VTK CVS release.
- vtkImageReslice.cxx - to set Optimization to Off by default as this gave us trouble with some of our nonlinear transformations in certain cases
- Optionally the installation of a combo binary bioimagesuite_extra
which primarily provides the MINC2 libraries and XERCESC - these are
optional. (XERCESC is only really used at this point.)
- Installation of the BioImage Suite software package itself.
All of the Open Source software listed in 1,2 and 3 essentially compiled without changes on all platforms.
BioImage Suite itself consists of a mixture of C++ libraries and .tcl code. The development process is described in the online book ``Introduction to Programming for Medical Image Analysis with VTK'' [74].
The BioImage Source code is released under the GNU General Public License (v2) [59].
B.2 Compiling BioImage Suite
Notes
Note that the binary bioimagesuite_extra, itk241 and vtk44 distributions distributed with BioImage Suite are needed for compiling this. While these are open source, it is easier to use the precompiled versions to avoid unnecessary problems. (See Section B.3 for some notes on building these distributions). A certain familiarity with the UNIX operating system and CMAKE is assumed.The installation assumes you are using CMake 2.4.x. CMake 2.6 might work.
Steps
- Place the BioImage Suite source code into a directory we
will refer to as $MYSRC.
- Edit the setpaths.csh or setpaths.sh file to reflect their
new location. i.e. in setpaths.csh change the line
setenv BASE /usr/local/bioimagesuite
to something like $MYSRC/bioimagesuite ... use absolute paths.
- Source the appropriate setpaths file (much like when
running the software) to set all environment variables i.e.
source \${MYSRC}/bioimagesuite/setpaths.csh(or setpaths.sh if using one of the sh/ksh/bash shells. or modify setpaths.bat on MS-Windows).
- Configure the build
cd \${MYSRC}/build; ccmake ..Set the following variables as:
LIBRARY_OUTPUT_PATH = \${MYSRC}/bioimagesuite/lib EXECUTABLE_OUTPUT_PATH = \${MYSRC}/bioimagesuite/bin - Compile - Simply type make
- To run from the source tree build version type bis.tcl.
To verify that this is the source build click on the "Which" button on the bottom the main pxmenu application. If it says something like mysrc/bioimagesuite then all is good.
B.3 Compiling the Prerequisites
These are some notes on building the binary distributions vtk44_yale, itk241_yale and bioimagesuite_extra. They are by no means complete. We strongly suggest using the binary versions provided if at all possible.
The exact sources used for these packages are available from the download page.
B.3.1 The vtk44_yale distribution
Tcl/Tk and Extensions
* Tcl and Tk - use tcl 8.4.11/tk 8.4.11
cd unix; ./configure --enable-shared --prefix=/usr/local/vtk44_yale
* Mac OX X X11
Tcl: ./configure --prefix=/usr/local/vtk44_x11_yale \ --disable-framework --enable-shared --enable-thread Tk: ./configure --prefix=/usr/local/vtk44_x11_yale \ --disable-framework --enable-shared --enable-threads --with-x \ --disable-aqua Itcl: ./configure --prefix=/usr/local/vtk44_x11_yale \ --disable-framework --enable-shared --enable-threads --with-x \ --disable-aqua
Incr Tcl (3.2.1)
./configure --enable-shared --prefix=/usr/local/vtk44_yale --with-gcc
Iwidgets 4.0.1
./configure --enable-shared --prefix=/usr/local/vtk44_yale --with-itcl=../itcl3.2.1
Tcllib - 1.8
./configure --enable-shared --prefix=/usr/local/vtk44_yale
VTK 4.4
Use the patched source provided - to change
- vtkDataArray.cxx - to eliminate a GetRange() bug - we simply used a later version of the file from the VTK CVS release.
- vtkImageReslice.cxx - to set Optimization to Off by default as this gave us trouble with some of our nonlinear transformations in certain cases
- Enable all libraries - set Java/Python OFF, Tcl ON. Build Shared.
Before running CMAKE set
TCL_LIBRARY_PATH=/usr/local/vtk44_yale/lib:/usr/local/vtk44_yale/lib/vtk/tcl TK_LIBRARY_PATH=/usr/local/vtk44_yale/lib:/usr/local/vtk44_yale/lib/vtk/tcl
When configuring cmake
CMAKE_INSTALL_PREFIX=/usr/local/vtk44_yale BUILD_SHARED_LIBS=ON VTK_WRAP_TCL=ON
Mac OS X X11
BUILD_EXAMPLES OFF
BUILD_SHARED_LIBS ON
CMAKE_BACKWARDS_COMPATIBILITY 2.2
CMAKE_BUILD_TYPE
CMAKE_INSTALL_PREFIX /usr/local/vtk44_x11_yale
TCL_INCLUDE_PATH /usr/local/vtk44_x11_yale/include
TCL_LIBRARY /usr/local/vtk44_x11_yale/lib/libtcl8.4.dylib
TK_INCLUDE_PATH /usr/local/vtk44_x11_yale/include/;
/Users/xenios/x11vtk/tk8.4.11/xlib/;
/Users/xenios/x11vtk/tk8.4.11/generic
TK_INTERNAL_PATH /Users/xenios/x11vtk/VTK/Rendering/tkInternals/tk84OSX
TK_LIBRARY /usr/local/vtk44_x11_yale/lib/libtk8.4.dylib
VTK_DATA_ROOT VTK_DATA_ROOT-NOTFOUND
VTK_USE_CARBON OFF
VTK_USE_COCOA OFF
VTK_USE_HYBRID ON
VTK_USE_PARALLEL ON
VTK_USE_PATENTED ON
VTK_USE_RENDERING ON
VTK_USE_X ON
VTK_WRAP_JAVA OFF
VTK_WRAP_PYTHON OFF
VTK_WRAP_TCL ON
CMAKE_X_CFLAGS -I/usr/X11R6/include
CMAKE_X_LIBS -lSM;-lICE;/usr/X11R6/lib/libX11.a;/usr/X11R6/lib/libXext.a
OPENGL_INCLUDE_DIR /usr/X11R6/include
OPENGL_gl_LIBRARY /usr/X11R6/lib/libGL.dylib
OPENGL_glu_LIBRARY /usr/X11R6/lib/libGLU.dylib
CLAPACK
Compiling CLAPACK This can be a pain, as Makefiles need to be edited by hand. Using the " -fPIC" flag us helpful. This needs to be added to both "make.inc" but also to all other Makefiles!Since CLAPACK is in C, there is no good reason to not use the binary version provided. It will link just fine with libraries compiled with other compilers.
On linux, you can also use the lapack library that comes with the operating system.
Manually create /usr/local/vtk44_yale/lib/lapack and
cp F2CLIB/libf77.a /usr/local/vtk44_yale/lib/lapack cp F2CLIB/libI77.a /usr/local/vtk44_yale/lib/lapack cp blas.a /usr/local/vtk44_yale/lib/lapack/libblas.a cp lapack.a /usr/local/vtk44_yale/lib/lapack/liblapack.a
Config Files
The following two files need to be created in /usr/local/vtk44_yale/lib/lapack.
* CLAPACKConfig.cmake
#----------------------------------------------------------------------------- # # CLAPACKConfig.cmake - CLAPACK CMake configuration file for external projects. # # This file is used by the UseCLAPACK.cmake module to load CLAPACK's settings f or an external project. # The CLAPACK include file directories. SET(CLAPACK_INCLUDE_DIRS "/usr/local/vtk44_yale/lib/lapack/") # The CLAPACK library directories. SET(CLAPACK_LIBRARY_DIRS "/usr/local/vtk44_yale/lib/lapack/") # The location of the UseCLAPACK.cmake file. SET(CLAPACK_USE_FILE "/usr/local/vtk44_yale/lib/lapack/UseCLAPACK.cmake") # The name of the CLAPACK project SET(CMAKE_BUILD_SETTING_PROJECT_NAME "CLAPACK")
* UseCLAPACK.cmake
#
# This module is provided as CLAPACK_USE_FILE by CLAPACKConfig.cmake. It can
# be included in a project to load the needed compiler and linker
# settings to use CLAPACK.
#
# Add include directories needed to use CLAPACK.
INCLUDE_DIRECTORIES(\${CLAPACK_INCLUDE_DIRS})
# Add link directories needed to use CLAPACK.
LINK_DIRECTORIES(\${CLAPACK_LIBRARY_DIRS})
SET(CLAPACK_LIBRARIES lapack blas I77 F77 )
B.3.2 The itk241_yale distribution
ITK 2.4.1
BUILD_SHARED_LIBS: ON CMAKE_INSTALL_PREFIX: /usr/local/itk241_yale
B.3.3 The bioimagesuite_extra distribution
Xercesc
After you untar the source tree
cd xerces-c-src_2_7_0/ setenv XERCESCROOT `pwd` cd src cd xercesc ./runConfigure -P /usr/local/bioimagesuite_extra -x g++ -c gcc
For 64-bit linux install add -b 64 to the line above (and perhaps -p linux)
Minc2, Netcdf 3.6.1, HDF5 1.6.5
setenv FC "" setenv CXX ""On Solaris setenv CFLAGS "-fPIC" !
Netcdf
cd src ./configure --prefix=/usr/local/bioimagesuite_extra/minc20_yale
hdf5
./configure --prefix=/usr/local/bioimagesuite_extra/minc20_yale \ --disable-shared
minc2
./configure --prefix=/usr/local/bioimagesuite_extra/minc20_yale \ CFLAGS=-I/usr/local/bioimagesuite_extra/minc20_yale/include/ \ LDFLAGS=-L/usr/local/bioimagesuite_extra/minc20_yale/lib/ \ --enable-minc2
On Solaris add -fPIC to CFLAFS.
B.4 Miscellaneous
BioImage Suite is developed primarily on Linux workstations running CentOS 4.4/5.0 and the gcc 3.2 compiler. In addition the development team has access to a Sparc Ultra 10, an SGI Octane (2xR12K), a pair of Mac Minis (powerpc and intel) and a number of Windows XP/2000/VISTA computers.
Some of the versions are compiled and/or tested inside virtual machines hosted using VMware Server. Such virtual machines include Linux versions: Red Hat 7.3, Red Hat 8.0, Fedora Core 3-5, Debian Sarge 3.1, Ubuntu 5.10,6.06 and OpenSUSE 10.0. In addition we have virtual machines for Solaris x86 v10, Darwin x86 v8.01 and Free BSD 6.0, as well as Windows 98.
BioImage Suite has been successfully compiled using gcc versions 2.95, 2.96, 3.2, 3.3, 3.4 and 4.01 on Linux and other operating systems, as well as Microsoft Visual Studio .NET 2003/2005 (and also using gcc3.3 under cygwin).
Next: C. Bioimagesuite FAQ Up: 9 Appendices Previous: A. Installing Other Software Contents
