-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathInstall.html
315 lines (265 loc) · 11.2 KB
/
Install.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
<h1> Installing and building ITK-SNAP on a UNIX System </h1>
<p>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.</p>
<p>An alternative to building SNAP is to download a binary version from <a
href="http://www.itksnap.org/download/snap">itksnap.org</a>; versions for
Microsoft Windows and Linux are available there.
<p>
The following software must be installed on your system:
<ul>
<li> CVS </li>
<li> GCC C++ compiler (or another compiler supported by ITK) </li>
<li> CMake (available from <a href="http://www.cmake.org">www.cmake.org</a>).
While it is possible to use latest CMake versions to build ITK-SNAP, we
recommend using version 2.0.6 </li>
</ul>
<h3> 1. Directory Structure </h3>
<p>
Create the following directory structure, which is recommended and will be assumed in this document. Replace the directory <i>basedir</i> with your own directory name, i.e., <i>/home/myuserid/tk</i>. Experienced users can change the names and order of the subdirectories to their preference.
</p>
<pre>
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
</pre>
<h3> 2. Install and Build ITK </h3>
<p> We will use CVS to download ITK. For more instructions, please refer to the <i>ITK Software Guide</i> located at <a href="http://www.itk.org/HTML/Documentation.htm">www.itk.org</a></p>
<p> 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.</p>
<ol>
<li> Go to the ITK root directory:
<pre>
cd [basedir]/itk
</pre></li>
<li> Execute the following commands to download ITK. This will take several minutes.
<pre>
cvs -d :pserver:[email protected]:/cvsroot/Insight login
(respond with password <i>insight</i>)
cvs -d :pserver:[email protected]:/cvsroot/Insight co -r ITK-2-6 Insight
</pre></li>
<li> Go to the ITK build directory:
<pre>
cd [basedir]/itk/bingcc
</pre></li>
<li> Execute the CMake command:
<pre>
ccmake ../Insight
</pre>
</li>
<li> The CMake user interface will appear. Set the following options in this interface:
<pre>
BUILD_EXAMPLES = OFF
BUILD_TESTING = OFF
BUILD_SHARED_LIBS = OFF
CMAKE_BUILD_TYPE = Release
</pre></li>
<li> Use the <b>c</b> command (configure) one or more times until the <b>g</b>
command (generate) becomes available. Then use the <b>g</b> command to
generate makefiles. </li><br>
<li> The following command will build ITK. This will take a while.
<pre>
make
</pre></li>
</ol>
<p> At this point, you will have a working installation of ITK on your system. Please refer to ITK documentation for troubleshooting information. </p>
<h3> 3. Install and Build VTK </h3>
<p> VTK installation is similar to the installation of ITK.</p>
<p> 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.</p>
<ol>
<li> Go to the vtk root directory:
<pre>
cd [basedir]/vtk
</pre></li>
<li> Execute the following commands to download VTK. This will take several minutes.
<pre>
cvs -d :pserver:[email protected]:/cvsroot/VTK login
(respond with password vtk)
cvs -d :pserver:[email protected]:/cvsroot/VTK co -r release-4-4 VTK
</pre></li>
<li> Go to the vtk build directory:
<pre>
cd [basedir]/vtk/bingcc
</pre></li>
<li> Execute the CMake command:
<pre>
ccmake ../VTK
</pre>
</li>
<li> The CMake user interface will appear. Set the following options in this interface:
<pre>
BUILD_EXAMPLES = OFF
BUILD_TESTING = OFF
CMAKE_BUILD_TYPE = Release
VTK_USE_HYBRID = ON
VTK_USE_PARALLEL= ON
VTK_USE_RENDERING= ON
</pre></li>
<li> Use the <b>t</b> command to show advanced VTK options, and set the following options:
<pre>
VTK_USE_ANSI_STDLIB = ON
VTK_USE_SYSTEM_PNG = ON
VTK_USE_SYSTEM_JPEG = ON
</pre>
<li> Use the <b>c</b> command to configure VTK and
use the <b>g</b> command to generate makefiles </li><br>
<li> The following command will build VTK. This will take a longer while.
<pre>
make
</pre></li>
</ol>
<p> At this point, you will have a working installation of ITK and VTK on your system. Please refer to VTK documentation (at <a href="http://www.vtk.org">www.vtk.org</a>) for troubleshooting information. </p>
<h3> 4. Install and Build FLTK </h3>
<p> FLTK is a multiplatform GUI toolkit. We will use FLTK version 1.1.7, which is CMake-friendly </p>
<ol>
<li> Download the 1.1.7 FLTK tarball <b>fltk-1.1.7-source.tar.gz</b> from
<a href="http://www.fltk.org/software.php">www.fltk.org/software.php</a>. You will have to follow some links to start the download. </li><br>
<li> Place the downloaded file <b>fltk-1.1.7-source.tar.gz</b> into the <i>basedir/fltk</i> directory. Execute the following command to uncompress FLTK
<pre>
cd [basedir]/fltk
tar -xzvf fltk-1.1.7-source.tar.gz
</pre>
</li>
<li> Go to the FLTK build directory:
<pre>
cd [basedir]/fltk/bingcc
</pre>
</li>
<li> Execute the CMake command:
<pre>
ccmake ../fltk-1.1.7
</pre>
</li>
<li> The CMake user interface will appear. Set the following options in this interface:
<pre>
BUILD_EXAMPLES = OFF
CMAKE_BUILD_TYPE = Release
</pre></li>
<li> Use the <b>c</b> command to configure FLTK and
use the <b>g</b> command to generate makefiles </li><br>
<li> The following command will build FLTK. This will be fairly fast
<pre>
make
</pre></li>
</ol>
<!--
<li> [Optional]. To enable anti-aliased fonts on Linux, in the
following step pass the option <b>--enable-xft</b> to the <b>./configure</b>
command. You will also need to specify the advanced option
<b>SNAP_USE_XFT_LIBRARY</b> in Step 5.5 </li><br>
<li> [Optional]. If you don't have root access, in the following step pass the option <b>
--prefix=DIR</b> where DIR is the directory where you want FLTK installed.
Make sure that this directory exists! If you do this, you don't need to execute
the <b>su</b> command below.</li><br>
<li> Execute the following commands to build and install FLTK:
<pre>
cd [basedir]/fltk/fltk-1.1.*
./configure # See notes above for options
make
su # Not required, see note above
make install
exit # Only if you executed 'su'
</pre></li>
</ol>
-->
<p> At this point, you will have a working installation of FLTK on your system. Please refer to FLTK documentation (at <a href="http://www.fltk.org">www.fltk.org</a>) for troubleshooting information.</p>
<h3> 5. Install and Build ITK-SNAP </h3>
<p> 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 </p>
<ol>
<li> Enter the root directory for appilcations:
<pre>
cd [basedir]/itksnap
</pre></li>
<li> Execute the following command to download ITK-SNAP. This will
take several minutes. If you want a specific release, e.g., release 1.4.1., then
add <b>-r ITKSNAP-1-4-1</b> after the <b>co</b> command.
<pre>
cvs -d:pserver:[email protected]:/cvsroot/itk-snap login
(respond with empty password)
cvs -z3 -d:pserver:[email protected]:/cvsroot/itk-snap co itksnap
cvs -d :pserver:[email protected]:/cvsroot/Insight co InsightApplications
</pre></li>
<li> Enter the build directory for appilcations:
<pre>
cd [basedir]/itksnap/bingcc
</pre></li>
<li> Execute the CMake command:
<pre>
ccmake ../InsightApplications
</pre>
</li>
<li> The CMake user interface will appear. Set the following options in this interface:
<pre>
BUILD_EXAMPLES = OFF
BUILD_TESTING = OFF
CMAKE_BUILD_TYPE = Release
ITK_DIR = [basedir]/itk/bingcc
USE_VTK = ON
USE_FLTK = ON
</pre></li>
<li> Use the <b>c</b> command to configure InsightApplications. More options will appear: </li>
<pre>
VTK_DIR = [basedir]/vtk/bingcc
FLTK_DIR = [basedir]/fltk/bingcc
</pre>
<li> [Optional]: You can specify the following additional advanced options (press t to toggle advanced mode)</li>
<pre>
USE_VTK_PATENTED # Whether to use patented code. You must have a license
# for using patented code from VTK to do this!
</pre>
<li> Use the <b>c</b> command to configure InsightApplications and
use the <b>g</b> command to generate makefiles </li><br>
<li> To build SNAP issue the following command:
<pre>
make
</pre></li>
</ol>
<p> At this point, you will have a working installation of ITK-SNAP on your system. Please refer to ITK documentation for troubleshooting information. </p>
<h3> 6. Running SNAP </h3>
<ol>
<li> Enter the SNAP binary directory:
<pre>
cd [basedir]/itksnap/bingcc/SNAP
</pre></li>
<li> Run the SNAP executable
<pre>
./InsightSNAP
</pre>
</li>
</ol>
If all goes well, SNAP user interface will launch.
<h3> 7. Installing SNAP to a Different Directory</h3>
<p> You may wish to extract the files needed to run SNAP into a separate
directory. To do so, execute the following commands:
<ol>
<li> Copy the ITK-SNAP executable and program data to the destination
directory (it can be any directory on your system, in this example we use
/opt/snap)
<pre>
su
mkdir /opt/snap # Replace /opt with desired directory
cp [basedir]/itksnap/bingcc/InsightSNAP /opt/snap
cp -a [basedir]/itksnap/bingcc/ProgramData /opt/snap
</pre></li>
<li>[Optional]. Create a symbolic link to the SNAP executable to make it
easily accessible to all users on your system.
<pre>
ln -s /opt/snap/InsightSNAP /usr/local/InsightSNAP
</pre></li>
<li>[Optional]. You may now delete directory [basedir] and its contents.
However, we recommend that you keep the build tree intact in order to make
future updates easier.</li>
</ol>
<h3> 8. Troubleshooting </h3>
<p> For troubleshooting the installation of ITK, VTK, FLTK and ITK-SNAP, please refer to the corresponding web sites noted above</p>
<p> We recommend that you join the <a
href="http://www.itksnap.org/forum.php">ITK-SNAP Forum</a> or the <a
href="http://www.itk.org/HTML/MailingLists.htm">ITK Users' Mailing List</a>, where you
can find answers to questions posed by other users as well as post your own
questions. </p>