SnAP is distributed as a part of the ITK Applications installation. In order to build SNAP on a UNIX or Linux platform, you must install ITK, VTK and FLTK on their system. This document will guide you through that process.
An alternative to building SNAP is to download a binary version from itksnap.org; versions for Microsoft Windows and Linux are available there.
The following software must be installed on your system:
Create the following directory structure, which is recommended and will be assumed in this document. Replace the directory basedir with your own directory name, i.e., /home/myuserid/tk. Experienced users can change the names and order of the subdirectories to their preference.
basedir/ basedir/itksnap // Base directory for ITK-SNAP basedir/itksnap/bingcc // ITK-SNAP binary directory basedir/itk // Base directory for ITK basedir/itk/bingcc // ITK binary directory basedir/vtk // Base directory for VTK basedir/vtk/bingcc // VTK binary directory basedir/fltk // FLTK directory basedir/fltk/bingcc // FLTK directory
We will use CVS to download ITK. For more instructions, please refer to the ITK Software Guide located at www.itk.org
These instructions recommend that you download the release 2.6 of ITK. To use the latest version of ITK (at your own risk), remove the -r option in the cvs commands below.
cd [basedir]/itk
cvs -d :pserver:anonymous@www.itk.org:/cvsroot/Insight login (respond with password insight) cvs -d :pserver:anonymous@www.itk.org:/cvsroot/Insight co -r ITK-2-6 Insight
cd [basedir]/itk/bingcc
ccmake ../Insight
BUILD_EXAMPLES = OFF BUILD_TESTING = OFF BUILD_SHARED_LIBS = OFF CMAKE_BUILD_TYPE = Release
make
At this point, you will have a working installation of ITK on your system. Please refer to ITK documentation for troubleshooting information.
VTK installation is similar to the installation of ITK.
These instructions recommend that you download the release 4.4 of VTK. To use the latest version of VTK (at your own risk), remove the -r option in the cvs commands below.
cd [basedir]/vtk
cvs -d :pserver:anonymous@public.kitware.com:/cvsroot/VTK login (respond with password vtk) cvs -d :pserver:anonymous@public.kitware.com:/cvsroot/VTK co -r release-4-4 VTK
cd [basedir]/vtk/bingcc
ccmake ../VTK
BUILD_EXAMPLES = OFF BUILD_TESTING = OFF CMAKE_BUILD_TYPE = Release VTK_USE_HYBRID = ON VTK_USE_PARALLEL= ON VTK_USE_RENDERING= ON
VTK_USE_ANSI_STDLIB = ON VTK_USE_SYSTEM_PNG = ON VTK_USE_SYSTEM_JPEG = ON
make
At this point, you will have a working installation of ITK and VTK on your system. Please refer to VTK documentation (at www.vtk.org) for troubleshooting information.
FLTK is a multiplatform GUI toolkit. We will use FLTK version 1.1.7, which is CMake-friendly
cd [basedir]/fltk tar -xzvf fltk-1.1.7-source.tar.gz
cd [basedir]/fltk/bingcc
ccmake ../fltk-1.1.7
BUILD_EXAMPLES = OFF CMAKE_BUILD_TYPE = Release
make
At this point, you will have a working installation of FLTK on your system. Please refer to FLTK documentation (at www.fltk.org) for troubleshooting information.
We will use CVS to download ITK-SNAP. SNAP is included as part of InsightApplications in ITK. However, starting with version 1.4.1, only major releases of SNAP will be placed in InsightApplications. Day-to-day development and interim releases use the SourceForge CVS, which is independent of ITK. We recommend that you use the SourceForge CVS links given below to download ITK-SNAP
cd [basedir]/itksnap
cvs -d:pserver:anonymous@itk-snap.cvs.sourceforge.net:/cvsroot/itk-snap login (respond with empty password) cvs -z3 -d:pserver:anonymous@itk-snap.cvs.sourceforge.net:/cvsroot/itk-snap co itksnap cvs -d :pserver:anonymous@www.itk.org:/cvsroot/Insight co InsightApplications
cd [basedir]/itksnap/bingcc
ccmake ../InsightApplications
BUILD_EXAMPLES = OFF BUILD_TESTING = OFF CMAKE_BUILD_TYPE = Release ITK_DIR = [basedir]/itk/bingcc USE_VTK = ON USE_FLTK = ON
VTK_DIR = [basedir]/vtk/bingcc FLTK_DIR = [basedir]/fltk/bingcc
USE_VTK_PATENTED # Whether to use patented code. You must have a license # for using patented code from VTK to do this!
make
At this point, you will have a working installation of ITK-SNAP on your system. Please refer to ITK documentation for troubleshooting information.
cd [basedir]/itksnap/bingcc/SNAP
./InsightSNAP
You may wish to extract the files needed to run SNAP into a separate directory. To do so, execute the following commands:
su mkdir /opt/snap # Replace /opt with desired directory cp [basedir]/itksnap/bingcc/InsightSNAP /opt/snap cp -a [basedir]/itksnap/bingcc/ProgramData /opt/snap
ln -s /opt/snap/InsightSNAP /usr/local/InsightSNAP
For troubleshooting the installation of ITK, VTK, FLTK and ITK-SNAP, please refer to the corresponding web sites noted above
We recommend that you join the ITK-SNAP Forum or the ITK Users' Mailing List, where you can find answers to questions posed by other users as well as post your own questions.