forked from tom-albrecht/statismo-elastix
-
Notifications
You must be signed in to change notification settings - Fork 1
/
sample-parameter-file-statismo-elastix.txt
184 lines (139 loc) · 6.82 KB
/
sample-parameter-file-statismo-elastix.txt
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
// Example parameter file for B-spline registration
// C-style comments: //
// The internal pixel type, used for internal computations
// Leave to float in general.
// NB: this is not the type of the input images! The pixel
// type of the input images is automatically read from the
// images themselves.
// This setting can be changed to "short" to save some memory
// in case of very large 3D images.
(FixedInternalImagePixelType "float")
(MovingInternalImagePixelType "float")
// The dimensions of the fixed and moving image
// NB: This has to be specified by the user. The dimension of
// the images is currently NOT read from the images.
// Also note that some other settings may have to specified
// for each dimension separately.
(FixedImageDimension 3)
(MovingImageDimension 3)
// Specify whether you want to take into account the so-called
// direction cosines of the images. Recommended: true.
// In some cases, the direction cosines of the image are corrupt,
// due to image format conversions for example. In that case, you
// may want to set this option to "false".
(UseDirectionCosines "false")
// **************** Main Components **************************
// The following components should usually be left as they are:
(Registration "MultiResolutionRegistration")
(Interpolator "BSplineInterpolator")
(ResampleInterpolator "FinalBSplineInterpolator")
(Resampler "DefaultResampler")
// These may be changed to Fixed/MovingSmoothingImagePyramid.
// See the manual.
(FixedImagePyramid "FixedRecursiveImagePyramid")
(MovingImagePyramid "MovingRecursiveImagePyramid")
// The following components are most important:
// The optimizer AdaptiveStochasticGradientDescent (ASGD) works
// quite ok in general. The Transform and Metric are important
// and need to be chosen careful for each application. See manual.
(Optimizer "AdaptiveStochasticGradientDescent")
//(Optimizer "QuasiNewtonLBFGS")
(NumberOfSamplesForExactGradient 50000)
// ***************** Metric ***********************************
//(Metric "AdvancedNormalizedCorrelation")
(Metric "AdvancedMattesMutualInformation")
//(Metric "AdvancedMeanSquares")
// ***************** Transformation **************************
(Transform "SimpleStatisticalDeformationModelTransform")
(StatisticalModelName "/path/to/your/model.h5")
// Number of statistical shape model coefficients to be used.
// 0 means all of them.
(UsedNumberOfStatisticalModelCoefficients 0)
// Whether transforms are combined by composition or by addition.
// In generally, Compose is the best option in most cases.
// It does not influence the results very much.
(HowToCombineTransforms "Compose")
// ******************* Similarity measure *********************
// Number of grey level bins in each resolution level,
// for the mutual information. 16 or 32 usually works fine.
// You could also employ a hierarchical strategy:
//(NumberOfHistogramBins 16 32 64)
(NumberOfHistogramBins 32)
// If you use a mask, this option is important.
// If the mask serves as region of interest, set it to false.
// If the mask indicates which pixels are valid, then set it to true.
// If you do not use a mask, the option doesn't matter.
(ErodeMask "false")
// ******************** Multiresolution **********************
// The number of resolutions. 1 Is only enough if the expected
// deformations are small. 3 or 4 mostly works fine. For large
// images and large deformations, 5 or 6 may even be useful.
(NumberOfResolutions 3)
// The downsampling/blurring factors for the image pyramids.
// By default, the images are downsampled by a factor of 2
// compared to the next resolution.
// So, in 2D, with 4 resolutions, the following schedule is used:
//(ImagePyramidSchedule 8 8 4 4 2 2 1 1 )
// And in 3D:
//(ImagePyramidSchedule 8 8 8 4 4 4 2 2 2 1 1 1 )
// You can specify any schedule, for example:
//(ImagePyramidSchedule 4 4 4 3 2 1 1 1 )
// Make sure that the number of elements equals the number
// of resolutions times the image dimension.
// ******************* Optimizer ****************************
// Maximum number of iterations in each resolution level:
// 200-2000 works usually fine for nonrigid registration.
// The more, the better, but the longer computation time.
// This is an important parameter!
//(MaximumNumberOfIterations 220 150 100)
(MaximumNumberOfIterations 100 70 40)
(StopIfWolfeNotSatisfied "false")
(AutomaticParameterEstimation "true")
// The step size of the optimizer, in mm. By default the voxel size is used.
// which usually works well. In case of unusual high-resolution images
// (eg histology) it is necessary to increase this value a bit, to the size
// of the "smallest visible structure" in the image:
//(MaximumStepLength 100.0)
//(MaximumStepLength 1)
// **************** Image sampling **********************
// Number of spatial samples used to compute the mutual
// information (and its derivative) in each iteration.
// With an AdaptiveStochasticGradientDescent optimizer,
// in combination with the two options below, around 2000
// samples may already suffice.
(NumberOfSpatialSamples 512 1024 2048)
// Added for the moving image masks. Allows for more samples
// to be mapped outside the mask and allows for 5 retries to
// find enough samples.
//(MaximumNumberOfSamplingAttempts 5)
//(RequiredRatioOfValidSamples 0.2)
// Refresh these spatial samples in every iteration, and select
// them randomly. See the manual for information on other sampling
// strategies.
(NewSamplesEveryIteration "true")
(ImageSampler "RandomSparseMask")
//(ImageSampler "Random")
// ************* Interpolation and Resampling ****************
// Order of B-Spline interpolation used during registration/optimisation.
// It may improve accuracy if you set this to 3. Never use 0.
// An order of 1 gives linear interpolation. This is in most
// applications a good choice.
(BSplineInterpolationOrder 1)
// Order of B-Spline interpolation used for applying the final
// deformation.
// 3 gives good accuracy; recommended in most cases.
// 1 gives worse accuracy (linear interpolation)
// 0 gives worst accuracy, but is appropriate for binary images
// (masks, segmentations); equivalent to nearest neighbor interpolation.
(FinalBSplineInterpolationOrder 3)
//Default pixel value for pixels that come from outside the picture:
(DefaultPixelValue -999)
// Choose whether to generate the deformed moving image.
// You can save some time by setting this to false, if you are
// not interested in the final deformed moving image, but only
// want to analyze the deformation field for example.
(WriteResultImage "false")
//(WriteResultImageAfterEachResolution "true")
// The pixel type and format of the resulting deformed moving image
(ResultImagePixelType "short")
(ResultImageFormat "nrrd")