SimpleITK  
sitkDiffeomorphicDemonsRegistrationFilter.h
Go to the documentation of this file.
1/*=========================================================================
2*
3* Copyright NumFOCUS
4*
5* Licensed under the Apache License, Version 2.0 (the "License");
6* you may not use this file except in compliance with the License.
7* You may obtain a copy of the License at
8*
9* http://www.apache.org/licenses/LICENSE-2.0.txt
10*
11* Unless required by applicable law or agreed to in writing, software
12* distributed under the License is distributed on an "AS IS" BASIS,
13* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14* See the License for the specific language governing permissions and
15* limitations under the License.
16*
17*=========================================================================*/
18#ifndef sitkDiffeomorphicDemonsRegistrationFilter_h
19#define sitkDiffeomorphicDemonsRegistrationFilter_h
20
21/*
22 * WARNING: DO NOT EDIT THIS FILE!
23 * THIS FILE IS AUTOMATICALLY GENERATED BY THE SIMPLEITK BUILD PROCESS.
24 * Please look at sitkImageFilterTemplate.h.jinja to make changes.
25 */
26
27#include <memory>
28
29#include "sitkBasicFilters.h"
30#include "sitkImageFilter.h"
32
33namespace itk::simple {
34
79public:
81
84
88
91
92
93
94
99 void
100 SetStandardDeviations(std::vector<double> StandardDeviations )
101 { this->m_StandardDeviations = std::move(StandardDeviations); }
102
104 void
105 SetStandardDeviations( double value ) { this->m_StandardDeviations = std::vector<double>(3, value); }
110 std::vector<double>
112
113
116 void
117 SetNumberOfIterations(uint32_t NumberOfIterations )
118 { this->m_NumberOfIterations = NumberOfIterations; }
119
121 uint32_t
123
124
127 void
128 SetMaximumRMSError(double MaximumRMSError )
129 { this->m_MaximumRMSError = MaximumRMSError; }
130
132 double
133 GetMaximumRMSError() const { return this->m_MaximumRMSError; }
134
135 typedef enum { Symmetric, Fixed, WarpedMoving, MappedMoving } UseGradientTypeType;
136
139 void
141 { this->m_UseGradientType = UseGradientType; }
142
144 UseGradientTypeType
145 GetUseGradientType() const { return this->m_UseGradientType; }
146
147
152 void
153 SetUseFirstOrderExp(bool UseFirstOrderExp )
154 { this->m_UseFirstOrderExp = UseFirstOrderExp; }
155
157 void
158 UseFirstOrderExpOn() { return this->SetUseFirstOrderExp(true); }
159 void
160 UseFirstOrderExpOff() { return this->SetUseFirstOrderExp(false); }
165 bool
166 GetUseFirstOrderExp() const { return this->m_UseFirstOrderExp; }
167
168
172 void
173 SetMaximumUpdateStepLength(double MaximumUpdateStepLength )
174 { this->m_MaximumUpdateStepLength = MaximumUpdateStepLength; }
175
177 double
179
180
186 void
187 SetSmoothDisplacementField(bool SmoothDisplacementField )
188 { this->m_SmoothDisplacementField = SmoothDisplacementField; }
189
191 void
193 void
200 bool
202
203
209 void
210 SetSmoothUpdateField(bool SmoothUpdateField )
211 { this->m_SmoothUpdateField = SmoothUpdateField; }
212
214 void
216 void
223 bool
225
226
231 void
232 SetUpdateFieldStandardDeviations(std::vector<double> UpdateFieldStandardDeviations )
233 { this->m_UpdateFieldStandardDeviations = std::move(UpdateFieldStandardDeviations); }
234
236 void
237 SetUpdateFieldStandardDeviations( double value ) { this->m_UpdateFieldStandardDeviations = std::vector<double>(3, value); }
242 std::vector<double>
244
245
249 void
250 SetMaximumKernelWidth(unsigned int MaximumKernelWidth )
251 { this->m_MaximumKernelWidth = MaximumKernelWidth; }
252
255 unsigned int
257
258
262 void
263 SetMaximumError(double MaximumError )
264 { this->m_MaximumError = MaximumError; }
265
268 double
269 GetMaximumError() const { return this->m_MaximumError; }
270
271
277 void
278 SetIntensityDifferenceThreshold(double IntensityDifferenceThreshold )
279 { this->m_IntensityDifferenceThreshold = IntensityDifferenceThreshold; }
280
282 double
284
285
288 void
289 SetUseImageSpacing(bool UseImageSpacing )
290 { this->m_UseImageSpacing = UseImageSpacing; }
291
293 void
294 UseImageSpacingOn() { return this->SetUseImageSpacing(true); }
295 void
296 UseImageSpacingOff() { return this->SetUseImageSpacing(false); }
299 bool
300 GetUseImageSpacing() const { return this->m_UseImageSpacing; }
301
302
309 uint32_t GetElapsedIterations()const { return this->m_pfGetElapsedIterations(); }
310
317 double GetRMSChange() const { return this->m_RMSChange; }
318
326 double GetMetric()const { return this->m_pfGetMetric(); }
327
334 void StopRegistration() { return this->m_pfGetStopRegistration(); }
335
337 std::string GetName() const { return std::string("DiffeomorphicDemonsRegistrationFilter"); }
338
340 std::string ToString() const;
341
342
344 Image Execute(const Image &fixedImage, const Image &movingImage, const Image &initialDisplacementField);
345 Image Execute(const Image &fixedImage, const Image &movingImage);
346
347
348private:
350 using MemberFunctionType = Image (Self::*)(const Image *
351 fixedImage, const Image *
352 movingImage, const Image *
353 initialDisplacementField);
354 template <class TImageType> Image ExecuteInternal(const Image *
355 fixedImage, const Image *
356 movingImage, const Image *
357 initialDisplacementField);
360
361
362 std::vector<double> m_StandardDeviations{ std::vector<double>(3, 1.0) };
363
364 /* Number of iterations to run */
365 uint32_t m_NumberOfIterations{ 10u };
366
367 /* Value of RMS change below which the filter should stop. This is a convergence criterion. */
368 double m_MaximumRMSError{ 0.02 };
369
371
372 bool m_UseFirstOrderExp{ false };
373
375
377
378 bool m_SmoothUpdateField{ false };
379
380 std::vector<double> m_UpdateFieldStandardDeviations{ std::vector<double>(3, 1.0) };
381
382 unsigned int m_MaximumKernelWidth{ 30u };
383
384 double m_MaximumError{ 0.1 };
385
387
388 bool m_UseImageSpacing{ true };
389
390
391
392 std::function<uint32_t()> m_pfGetElapsedIterations;
393 double m_RMSChange{ 0.0 };
394 std::function<double()> m_pfGetMetric;
395 std::function<void()> m_pfGetStopRegistration;
396
397
398 // Holder of process object for active measurements
399 std::unique_ptr<itk::ProcessObject, ProcessObjectDeleter> m_Filter{nullptr};
400
401
402
403};
404
405
406}
407#endif
Image(Self::*)(const Image * fixedImage, const Image * movingImage, const Image * initialDisplacementField) MemberFunctionType
Image Execute(const Image &fixedImage, const Image &movingImage)
void SetUpdateFieldStandardDeviations(std::vector< double > UpdateFieldStandardDeviations)
Image ExecuteInternal(const Image *fixedImage, const Image *movingImage, const Image *initialDisplacementField)
std::unique_ptr< itk::ProcessObject, ProcessObjectDeleter > m_Filter
static const detail::MemberFunctionFactory< MemberFunctionType > & GetMemberFunctionFactory()
Image Execute(const Image &fixedImage, const Image &movingImage, const Image &initialDisplacementField)
void StopRegistration()
Stop the registration after the current iteration.
The Image class for SimpleITK.
Definition sitkImage.h:77
A class used to instantiate and generate function object to templated member functions.
typelist2::typelist< BasicPixelID< int8_t >, BasicPixelID< uint8_t >, BasicPixelID< int16_t >, BasicPixelID< uint16_t >, BasicPixelID< int32_t >, BasicPixelID< uint32_t >, BasicPixelID< float >, BasicPixelID< double > > BasicPixelIDTypeList
#define SITKBasicFilters_EXPORT