@@ -19,6 +19,67 @@ if [[ ! -s ${ANTSPATH}/antsApplyTransforms ]]; then
19
19
exit
20
20
fi
21
21
22
+ # ###############################################################################
23
+ #
24
+ # General parameters
25
+ #
26
+ # ###############################################################################
27
+
28
+ HOSTNAME=` hostname`
29
+ DATE=` date`
30
+
31
+ CURRENT_DIR=` pwd` /
32
+ OUTPUT_DIR=${CURRENT_DIR} /tmp$RANDOM /
33
+ OUTPUT_PREFIX=${OUTPUT_DIR} /tmp
34
+ OUTPUT_SUFFIX=" nii.gz"
35
+
36
+ KEEP_TMP_IMAGES=0
37
+
38
+ USE_RANDOM_SEEDING=1
39
+
40
+ DIMENSION=3
41
+
42
+ ANATOMICAL_IMAGES=()
43
+
44
+ USE_FLOAT_PRECISION=0
45
+
46
+ # Intial affine supplied on command line
47
+ USER_INITIAL_AFFINE=" "
48
+
49
+ # ###############################################################################
50
+ #
51
+ # Programs and their parameters
52
+ #
53
+ # ###############################################################################
54
+
55
+
56
+ ATROPOS=${ANTSPATH} /Atropos
57
+ ATROPOS_NUM_CLASSES=3
58
+ ATROPOS_CSF_CLASS_LABEL=1
59
+ ATROPOS_GM_CLASS_LABEL=2
60
+ ATROPOS_WM_CLASS_LABEL=3
61
+ ATROPOS_BRAIN_EXTRACTION_INITIALIZATION=" kmeans[ ${ATROPOS_NUM_CLASSES} ]"
62
+ ATROPOS_BRAIN_EXTRACTION_LIKELIHOOD=" Gaussian"
63
+ ATROPOS_BRAIN_EXTRACTION_CONVERGENCE=" [ 3,0.0 ]"
64
+
65
+ ANTS=${ANTSPATH} /antsRegistration
66
+ ANTS_MAX_ITERATIONS=" 100x100x70x20"
67
+ ANTS_TRANSFORMATION=" SyN[ 0.1,3,0 ]"
68
+ ANTS_LINEAR_METRIC_PARAMS=" 1,32,Regular,0.25"
69
+ ANTS_LINEAR_CONVERGENCE=" [ 1000x500x250x100,1e-8,10 ]"
70
+ ANTS_METRIC=" CC"
71
+ ANTS_METRIC_PARAMS=" 1,4"
72
+
73
+ WARP=${ANTSPATH} /antsApplyTransforms
74
+
75
+ N4=${ANTSPATH} /N4BiasFieldCorrection
76
+ N4_CONVERGENCE_1=" [ 50x50x50x50,0.0000001 ]"
77
+ N4_CONVERGENCE_2=" [ 50x50x50x50,0.0000001 ]"
78
+ N4_SHRINK_FACTOR_1=4
79
+ N4_SHRINK_FACTOR_2=2
80
+ N4_BSPLINE_PARAMS=" [ 200 ]"
81
+
82
+
22
83
function Usage {
23
84
cat << USAGE
24
85
@@ -39,18 +100,16 @@ Example:
39
100
40
101
Required arguments:
41
102
42
- -d: Image dimension 2 or 3 ( for 2- or 3-dimensional image)
103
+ -d: Image dimension 2 or 3 for 2- or 3-dimensional image (default = $DIMENSION )
43
104
-a: Anatomical image Structural image, typically T1. If more than one
44
105
anatomical image is specified, subsequently specified
45
106
images are used during the segmentation process. However,
46
107
only the first image is used in the registration of priors.
47
108
Our suggestion would be to specify the T1 as the first image.
48
- -e: Brain extraction template Anatomical template created using e.g. LPBA40 data set with
49
- buildtemplateparallel.sh in ANTs.
50
- -m: Brain extraction probability mask Brain probability mask created using e.g. LPBA40 data set which
51
- have brain masks defined, and warped to anatomical template and
52
- averaged resulting in a probability image.
53
- -o: Output prefix Output directory + file prefix
109
+ -e: Brain extraction template Anatomical template.
110
+ -m: Brain extraction probability mask Brain probability mask, with intensity range 1 (definitely brain)
111
+ to 0 (definitely background).
112
+ -o: Output prefix Output directory + file prefix.
54
113
55
114
Optional arguments:
56
115
@@ -59,7 +118,7 @@ Optional arguments:
59
118
This produces a segmentation image with K classes, ordered by mean
60
119
intensity in increasing order. With this option, you can control
61
120
K and tell the script which classes represent CSF, gray and white matter.
62
- Format (\"KxcsfLabelxgmLabelxwmLabel\")
121
+ Format (\"KxcsfLabelxgmLabelxwmLabel\").
63
122
Examples:
64
123
-c 3x1x2x3 for T1 with K=3, CSF=1, GM=2, WM=3 (default)
65
124
-c 3x3x2x1 for T2 with K=3, CSF=3, GM=2, WM=1
@@ -71,13 +130,13 @@ Optional arguments:
71
130
-r: Initial moving transform An ITK affine transform (eg, from antsAI or ITK-SNAP) for the moving image.
72
131
Without this option, this script calls antsAI to search for a good initial moving
73
132
transform.
74
- -s: Image file suffix Any of the standard ITK IO formats e.g. nrrd, nii.gz (default), mhd
75
- -u: Use random seeding Use random number generated from system clock (1 (default) ) or a fixed seed (0). Using
133
+ -s: Image file suffix Any of the standard ITK IO formats e.g. nrrd, nii.gz, mhd (default = $OUTPUT_SUFFIX )
134
+ -u: Use random seeding Use random number generated from system clock (1) or a fixed seed (0). Using
76
135
"-u 0" overrides a system setting of ANTS_RANDOM_SEED. To produce identical results,
77
136
multi-threading must also be disabled by setting the environment variable
78
- ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1.
79
- -k: Keep temporary files Keep brain extraction/segmentation warps, etc (default = false ).
80
- -q: Use floating point precision Use antsRegistration with floating point precision.
137
+ ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1. Default = $USE_RANDOM_SEEDING .
138
+ -k: Keep temporary files Keep brain extraction/segmentation warps, etc (default = $KEEP_TMP_IMAGES ).
139
+ -q: Use single floating point precision Use antsRegistration with single (1) or double (0) floating point precision (default = $USE_FLOAT_PRECISION ) .
81
140
82
141
-z: Test / debug mode If > 0, runs a faster version of the script. Only for debugging, results will not be good.
83
142
@@ -154,61 +213,6 @@ function logCmd() {
154
213
#
155
214
# ###############################################################################
156
215
157
- HOSTNAME=` hostname`
158
- DATE=` date`
159
-
160
- CURRENT_DIR=` pwd` /
161
- OUTPUT_DIR=${CURRENT_DIR} /tmp$RANDOM /
162
- OUTPUT_PREFIX=${OUTPUT_DIR} /tmp
163
- OUTPUT_SUFFIX=" nii.gz"
164
-
165
- KEEP_TMP_IMAGES=0
166
-
167
- USE_RANDOM_SEEDING=1
168
-
169
- DIMENSION=3
170
-
171
- ANATOMICAL_IMAGES=()
172
-
173
- # ###############################################################################
174
- #
175
- # Programs and their parameters
176
- #
177
- # ###############################################################################
178
-
179
- ATROPOS=${ANTSPATH} /Atropos
180
-
181
- ATROPOS_NUM_CLASSES=3
182
-
183
- ATROPOS_CSF_CLASS_LABEL=1
184
- ATROPOS_GM_CLASS_LABEL=2
185
- ATROPOS_WM_CLASS_LABEL=3
186
-
187
- ATROPOS_BRAIN_EXTRACTION_INITIALIZATION=" kmeans[ ${ATROPOS_NUM_CLASSES} ]"
188
- ATROPOS_BRAIN_EXTRACTION_LIKELIHOOD=" Gaussian"
189
- ATROPOS_BRAIN_EXTRACTION_CONVERGENCE=" [ 3,0.0 ]"
190
-
191
- ANTS=${ANTSPATH} /antsRegistration
192
- ANTS_MAX_ITERATIONS=" 100x100x70x20"
193
- ANTS_TRANSFORMATION=" SyN[ 0.1,3,0 ]"
194
- ANTS_LINEAR_METRIC_PARAMS=" 1,32,Regular,0.25"
195
- ANTS_LINEAR_CONVERGENCE=" [ 1000x500x250x100,1e-8,10 ]"
196
- ANTS_METRIC=" CC"
197
- ANTS_METRIC_PARAMS=" 1,4"
198
-
199
- WARP=${ANTSPATH} /antsApplyTransforms
200
-
201
- N4=${ANTSPATH} /N4BiasFieldCorrection
202
- N4_CONVERGENCE_1=" [ 50x50x50x50,0.0000001 ]"
203
- N4_CONVERGENCE_2=" [ 50x50x50x50,0.0000001 ]"
204
- N4_SHRINK_FACTOR_1=4
205
- N4_SHRINK_FACTOR_2=2
206
- N4_BSPLINE_PARAMS=" [ 200 ]"
207
-
208
- USE_FLOAT_PRECISION=0
209
-
210
- # Intial affine supplied on command line
211
- USER_INITIAL_AFFINE=" "
212
216
213
217
if [[ $# -lt 3 ]] ; then
214
218
Usage >&2
0 commit comments