SimpleITK  
sitkDemonsRegistrationFilter.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 sitkDemonsRegistrationFilter_h
19#define sitkDemonsRegistrationFilter_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
67public:
69
72
76
79
80
81
82
87 void
88 SetStandardDeviations(std::vector<double> StandardDeviations )
89 { this->m_StandardDeviations = std::move(StandardDeviations); }
90
92 void
93 SetStandardDeviations( double value ) { this->m_StandardDeviations = std::vector<double>(3, value); }
98 std::vector<double>
100
101
104 void
105 SetNumberOfIterations(uint32_t NumberOfIterations )
106 { this->m_NumberOfIterations = NumberOfIterations; }
107
109 uint32_t
111
112
115 void
116 SetMaximumRMSError(double MaximumRMSError )
117 { this->m_MaximumRMSError = MaximumRMSError; }
118
120 double
121 GetMaximumRMSError() const { return this->m_MaximumRMSError; }
122
123
127 void
128 SetUseMovingImageGradient(bool UseMovingImageGradient )
129 { this->m_UseMovingImageGradient = UseMovingImageGradient; }
130
132 void
134 void
139 bool
141
142
148 void
149 SetSmoothDisplacementField(bool SmoothDisplacementField )
150 { this->m_SmoothDisplacementField = SmoothDisplacementField; }
151
153 void
155 void
162 bool
164
165
171 void
172 SetSmoothUpdateField(bool SmoothUpdateField )
173 { this->m_SmoothUpdateField = SmoothUpdateField; }
174
176 void
178 void
185 bool
187
188
193 void
194 SetUpdateFieldStandardDeviations(std::vector<double> UpdateFieldStandardDeviations )
195 { this->m_UpdateFieldStandardDeviations = std::move(UpdateFieldStandardDeviations); }
196
198 void
199 SetUpdateFieldStandardDeviations( double value ) { this->m_UpdateFieldStandardDeviations = std::vector<double>(3, value); }
204 std::vector<double>
206
207
211 void
212 SetMaximumKernelWidth(unsigned int MaximumKernelWidth )
213 { this->m_MaximumKernelWidth = MaximumKernelWidth; }
214
217 unsigned int
219
220
224 void
225 SetMaximumError(double MaximumError )
226 { this->m_MaximumError = MaximumError; }
227
230 double
231 GetMaximumError() const { return this->m_MaximumError; }
232
233
239 void
240 SetIntensityDifferenceThreshold(double IntensityDifferenceThreshold )
241 { this->m_IntensityDifferenceThreshold = IntensityDifferenceThreshold; }
242
244 double
246
247
250 void
251 SetUseImageSpacing(bool UseImageSpacing )
252 { this->m_UseImageSpacing = UseImageSpacing; }
253
255 void
256 UseImageSpacingOn() { return this->SetUseImageSpacing(true); }
257 void
258 UseImageSpacingOff() { return this->SetUseImageSpacing(false); }
261 bool
262 GetUseImageSpacing() const { return this->m_UseImageSpacing; }
263
264
271 uint32_t GetElapsedIterations()const { return this->m_pfGetElapsedIterations(); }
272
278 double GetRMSChange() const { return this->m_RMSChange; }
279
287 double GetMetric()const { return this->m_pfGetMetric(); }
288
295 void StopRegistration() { return this->m_pfGetStopRegistration(); }
296
298 std::string GetName() const { return std::string("DemonsRegistrationFilter"); }
299
301 std::string ToString() const;
302
303
305 Image Execute(const Image &fixedImage, const Image &movingImage, const Image &initialDisplacementField);
306 Image Execute(const Image &fixedImage, const Image &movingImage);
307
308
309private:
311 using MemberFunctionType = Image (Self::*)(const Image *
312 fixedImage, const Image *
313 movingImage, const Image *
314 initialDisplacementField);
315 template <class TImageType> Image ExecuteInternal(const Image *
316 fixedImage, const Image *
317 movingImage, const Image *
318 initialDisplacementField);
321
322
323 std::vector<double> m_StandardDeviations{ std::vector<double>(3, 1.0) };
324
325 /* Number of iterations to run */
326 uint32_t m_NumberOfIterations{ 10u };
327
328 /* Value of RMS change below which the filter should stop. This is a convergence criterion. */
329 double m_MaximumRMSError{ 0.02 };
330
332
334
335 bool m_SmoothUpdateField{ false };
336
337 std::vector<double> m_UpdateFieldStandardDeviations{ std::vector<double>(3, 1.0) };
338
339 unsigned int m_MaximumKernelWidth{ 30u };
340
341 double m_MaximumError{ 0.1 };
342
344
345 bool m_UseImageSpacing{ true };
346
347
348
349 std::function<uint32_t()> m_pfGetElapsedIterations;
350 double m_RMSChange{ 0.0 };
351 std::function<double()> m_pfGetMetric;
352 std::function<void()> m_pfGetStopRegistration;
353
354
355 // Holder of process object for active measurements
356 std::unique_ptr<itk::ProcessObject, ProcessObjectDeleter> m_Filter{nullptr};
357
358
359
360};
361
362
363}
364#endif
Image Execute(const Image &fixedImage, const Image &movingImage)
void SetSmoothDisplacementField(bool SmoothDisplacementField)
std::vector< double > GetUpdateFieldStandardDeviations() const
Image(Self::*)(const Image * fixedImage, const Image * movingImage, const Image * initialDisplacementField) MemberFunctionType
void SetUpdateFieldStandardDeviations(std::vector< double > UpdateFieldStandardDeviations)
void SetStandardDeviations(std::vector< double > StandardDeviations)
void StopRegistration()
Stop the registration after the current iteration.
void SetUseMovingImageGradient(bool UseMovingImageGradient)
void SetMaximumKernelWidth(unsigned int MaximumKernelWidth)
double GetRMSChange() const
The Root Mean Square of the levelset upon termination.
uint32_t GetElapsedIterations() const
Number of iterations run.
void SetIntensityDifferenceThreshold(double IntensityDifferenceThreshold)
std::vector< double > GetStandardDeviations() const
static const detail::MemberFunctionFactory< MemberFunctionType > & GetMemberFunctionFactory()
void SetNumberOfIterations(uint32_t NumberOfIterations)
std::unique_ptr< itk::ProcessObject, ProcessObjectDeleter > m_Filter
Image ExecuteInternal(const Image *fixedImage, const Image *movingImage, const Image *initialDisplacementField)
Image Execute(const Image &fixedImage, const Image &movingImage, const Image &initialDisplacementField)
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