SimpleITK  2.0.0
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.in to make changes.
25  */
26 
27 #include <memory>
28 
29 #include "sitkBasicFilters.h"
30 #include "sitkImageFilter.h"
31 
32 namespace itk {
33  namespace simple {
34 
60  public:
62 
64  virtual ~DemonsRegistrationFilter();
65 
69 
72 \
73 
77  SITK_RETURN_SELF_TYPE_HEADER SetStandardDeviations ( std::vector<double> StandardDeviations ) { this->m_StandardDeviations = std::move(StandardDeviations); return *this; }
78 
80  SITK_RETURN_SELF_TYPE_HEADER SetStandardDeviations( double value ) { this->m_StandardDeviations = std::vector<double>(3, value); return *this; }
81 
85  std::vector<double> GetStandardDeviations() const { return this->m_StandardDeviations; }\
86 
89  SITK_RETURN_SELF_TYPE_HEADER SetNumberOfIterations ( uint32_t NumberOfIterations ) { this->m_NumberOfIterations = NumberOfIterations; return *this; }
90 
93  uint32_t GetNumberOfIterations() const { return this->m_NumberOfIterations; }\
94 
97  SITK_RETURN_SELF_TYPE_HEADER SetMaximumRMSError ( double MaximumRMSError ) { this->m_MaximumRMSError = MaximumRMSError; return *this; }
98 
101  double GetMaximumRMSError() const { return this->m_MaximumRMSError; }\
102 
106  SITK_RETURN_SELF_TYPE_HEADER SetUseMovingImageGradient ( bool UseMovingImageGradient ) { this->m_UseMovingImageGradient = UseMovingImageGradient; return *this; }
107 
109  SITK_RETURN_SELF_TYPE_HEADER UseMovingImageGradientOn() { return this->SetUseMovingImageGradient(true); }
110  SITK_RETURN_SELF_TYPE_HEADER UseMovingImageGradientOff() { return this->SetUseMovingImageGradient(false); }
111 
115  bool GetUseMovingImageGradient() const { return this->m_UseMovingImageGradient; }\
116 
120  SITK_RETURN_SELF_TYPE_HEADER SetSmoothDisplacementField ( bool SmoothDisplacementField ) { this->m_SmoothDisplacementField = SmoothDisplacementField; return *this; }
121 
123  SITK_RETURN_SELF_TYPE_HEADER SmoothDisplacementFieldOn() { return this->SetSmoothDisplacementField(true); }
124  SITK_RETURN_SELF_TYPE_HEADER SmoothDisplacementFieldOff() { return this->SetSmoothDisplacementField(false); }
125 
129  bool GetSmoothDisplacementField() const { return this->m_SmoothDisplacementField; }\
130 
134  SITK_RETURN_SELF_TYPE_HEADER SetSmoothUpdateField ( bool SmoothUpdateField ) { this->m_SmoothUpdateField = SmoothUpdateField; return *this; }
135 
137  SITK_RETURN_SELF_TYPE_HEADER SmoothUpdateFieldOn() { return this->SetSmoothUpdateField(true); }
138  SITK_RETURN_SELF_TYPE_HEADER SmoothUpdateFieldOff() { return this->SetSmoothUpdateField(false); }
139 
143  bool GetSmoothUpdateField() const { return this->m_SmoothUpdateField; }\
144 
148  SITK_RETURN_SELF_TYPE_HEADER SetUpdateFieldStandardDeviations ( std::vector<double> UpdateFieldStandardDeviations ) { this->m_UpdateFieldStandardDeviations = std::move(UpdateFieldStandardDeviations); return *this; }
149 
151  SITK_RETURN_SELF_TYPE_HEADER SetUpdateFieldStandardDeviations( double value ) { this->m_UpdateFieldStandardDeviations = std::vector<double>(3, value); return *this; }
152 
156  std::vector<double> GetUpdateFieldStandardDeviations() const { return this->m_UpdateFieldStandardDeviations; }\
157 
161  SITK_RETURN_SELF_TYPE_HEADER SetMaximumKernelWidth ( unsigned int MaximumKernelWidth ) { this->m_MaximumKernelWidth = MaximumKernelWidth; return *this; }
162 
166  unsigned int GetMaximumKernelWidth() const { return this->m_MaximumKernelWidth; }\
167 
171  SITK_RETURN_SELF_TYPE_HEADER SetMaximumError ( double MaximumError ) { this->m_MaximumError = MaximumError; return *this; }
172 
176  double GetMaximumError() const { return this->m_MaximumError; }\
177 
181  SITK_RETURN_SELF_TYPE_HEADER SetIntensityDifferenceThreshold ( double IntensityDifferenceThreshold ) { this->m_IntensityDifferenceThreshold = IntensityDifferenceThreshold; return *this; }
182 
185  double GetIntensityDifferenceThreshold() const { return this->m_IntensityDifferenceThreshold; }\
186 
189  SITK_RETURN_SELF_TYPE_HEADER SetUseImageSpacing ( bool UseImageSpacing ) { this->m_UseImageSpacing = UseImageSpacing; return *this; }
190 
192  SITK_RETURN_SELF_TYPE_HEADER UseImageSpacingOn() { return this->SetUseImageSpacing(true); }
193  SITK_RETURN_SELF_TYPE_HEADER UseImageSpacingOff() { return this->SetUseImageSpacing(false); }
194 
197  bool GetUseImageSpacing() const { return this->m_UseImageSpacing; }
205  uint32_t GetElapsedIterations() const { return this->m_pfGetElapsedIterations(); };
206 
213  double GetRMSChange() const { return this->m_RMSChange; };
214 
222  double GetMetric() const { return this->m_pfGetMetric(); };
223 
224 
226  std::string GetName() const { return std::string ("DemonsRegistrationFilter"); }
227 
229  std::string ToString() const;
230 
231 
234  Image Execute ( const Image & fixedImage, const Image & movingImage, const Image & initialDisplacementField );
235  Image Execute ( const Image & fixedImage, const Image & movingImage );
236 
237  private:
238 
241  using MemberFunctionType = Image (Self::*)( const Image * fixedImage, const Image * movingImage, const Image * initialDisplacementField );
242  template <class TImageType> Image ExecuteInternal ( const Image * fixedImage, const Image * movingImage, const Image * initialDisplacementField );
243 
244 
246 
247  std::unique_ptr<detail::MemberFunctionFactory<MemberFunctionType> > m_MemberFactory;
248 
249 
250  std::vector<double> m_StandardDeviations{std::vector<double>(3, 1.0)};
251 
252  /* Number of iterations to run */
253  uint32_t m_NumberOfIterations{10u};
254 
255  /* Value of RMS change below which the filter should stop. This is a convergence criterion. */
256  double m_MaximumRMSError{0.02};
257 
258  bool m_UseMovingImageGradient{false};
259 
260  bool m_SmoothDisplacementField{true};
261 
262  bool m_SmoothUpdateField{false};
263 
264  std::vector<double> m_UpdateFieldStandardDeviations{std::vector<double>(3, 1.0)};
265 
266  unsigned int m_MaximumKernelWidth{30u};
267 
268  double m_MaximumError{0.1};
269 
270  double m_IntensityDifferenceThreshold{0.001};
271 
272  bool m_UseImageSpacing{true};
273 
274 
276 
277  double m_RMSChange{0.0};
278 
279  std::function<double()> m_pfGetMetric;
280 
281  // Holder of process object for active measurements
282  itk::ProcessObject *m_Filter{nullptr};
283 
284  };
285 
286 
287  }
288 }
289 #endif
itk::simple::Image
The Image class for SimpleITK.
Definition: sitkImage.h:75
sitkBasicFilters.h
itk::simple::DemonsRegistrationFilter::MemberFunctionType
Image(Self::*)(const Image *fixedImage, const Image *movingImage, const Image *initialDisplacementField) MemberFunctionType
Definition: sitkDemonsRegistrationFilter.h:241
itk::simple::DemonsRegistrationFilter::UseMovingImageGradientOff
Self & UseMovingImageGradientOff()
Definition: sitkDemonsRegistrationFilter.h:110
itk::simple::DemonsRegistrationFilter::GetNumberOfIterations
uint32_t GetNumberOfIterations() const
Definition: sitkDemonsRegistrationFilter.h:93
itk::simple::DemonsRegistrationFilter::UseMovingImageGradientOn
Self & UseMovingImageGradientOn()
Definition: sitkDemonsRegistrationFilter.h:109
itk::simple::DemonsRegistrationFilter::UseImageSpacingOff
Self & UseImageSpacingOff()
Definition: sitkDemonsRegistrationFilter.h:193
itk::simple::detail::MemberFunctionAddressor
Definition: sitkDetail.h:32
itk::simple::DemonsRegistrationFilter::SetUseImageSpacing
Self & SetUseImageSpacing(bool UseImageSpacing)
Definition: sitkDemonsRegistrationFilter.h:189
itk::simple::DemonsRegistrationFilter::GetMaximumRMSError
double GetMaximumRMSError() const
Definition: sitkDemonsRegistrationFilter.h:101
itk::simple::DemonsRegistrationFilter::GetSmoothUpdateField
bool GetSmoothUpdateField() const
Definition: sitkDemonsRegistrationFilter.h:143
itk::simple::DemonsRegistrationFilter::UseImageSpacingOn
Self & UseImageSpacingOn()
Definition: sitkDemonsRegistrationFilter.h:192
itk::simple::DemonsRegistrationFilter::SetMaximumKernelWidth
Self & SetMaximumKernelWidth(unsigned int MaximumKernelWidth)
Definition: sitkDemonsRegistrationFilter.h:161
itk::simple::DemonsRegistrationFilter::SetSmoothUpdateField
Self & SetSmoothUpdateField(bool SmoothUpdateField)
Definition: sitkDemonsRegistrationFilter.h:134
itk::simple::DemonsRegistrationFilter::SetNumberOfIterations
Self & SetNumberOfIterations(uint32_t NumberOfIterations)
Definition: sitkDemonsRegistrationFilter.h:89
itk::simple::BasicPixelIDTypeList
typelist::MakeTypeList< BasicPixelID< int8_t >, BasicPixelID< uint8_t >, BasicPixelID< int16_t >, BasicPixelID< uint16_t >, BasicPixelID< int32_t >, BasicPixelID< uint32_t >, BasicPixelID< float >, BasicPixelID< double > >::Type BasicPixelIDTypeList
Definition: sitkPixelIDTypeLists.h:53
sitkImageFilter.h
itk::simple::DemonsRegistrationFilter::GetSmoothDisplacementField
bool GetSmoothDisplacementField() const
Definition: sitkDemonsRegistrationFilter.h:129
itk::simple::DemonsRegistrationFilter::GetMaximumKernelWidth
unsigned int GetMaximumKernelWidth() const
Definition: sitkDemonsRegistrationFilter.h:166
itk::simple::DemonsRegistrationFilter::SetSmoothDisplacementField
Self & SetSmoothDisplacementField(bool SmoothDisplacementField)
Definition: sitkDemonsRegistrationFilter.h:120
itk::simple::DemonsRegistrationFilter::SmoothDisplacementFieldOn
Self & SmoothDisplacementFieldOn()
Definition: sitkDemonsRegistrationFilter.h:123
itk::simple::DemonsRegistrationFilter::SetIntensityDifferenceThreshold
Self & SetIntensityDifferenceThreshold(double IntensityDifferenceThreshold)
Definition: sitkDemonsRegistrationFilter.h:181
itk::simple::DemonsRegistrationFilter::PixelIDTypeList
BasicPixelIDTypeList PixelIDTypeList
Definition: sitkDemonsRegistrationFilter.h:71
itk::simple::DemonsRegistrationFilter::SetUpdateFieldStandardDeviations
Self & SetUpdateFieldStandardDeviations(std::vector< double > UpdateFieldStandardDeviations)
Definition: sitkDemonsRegistrationFilter.h:148
itk::simple::DemonsRegistrationFilter::GetUpdateFieldStandardDeviations
std::vector< double > GetUpdateFieldStandardDeviations() const
Definition: sitkDemonsRegistrationFilter.h:156
itk::simple::DemonsRegistrationFilter::SetStandardDeviations
Self & SetStandardDeviations(double value)
Definition: sitkDemonsRegistrationFilter.h:80
itk::simple::DemonsRegistrationFilter
Deformably register two images using the demons algorithm.
Definition: sitkDemonsRegistrationFilter.h:59
itk::simple::DemonsRegistrationFilter::GetElapsedIterations
uint32_t GetElapsedIterations() const
Number of iterations run.
Definition: sitkDemonsRegistrationFilter.h:205
itk::simple::DemonsRegistrationFilter::m_pfGetElapsedIterations
std::function< uint32_t()> m_pfGetElapsedIterations
Definition: sitkDemonsRegistrationFilter.h:275
SITKBasicFilters_EXPORT
#define SITKBasicFilters_EXPORT
Definition: sitkBasicFilters.h:52
itk::simple::DemonsRegistrationFilter::GetStandardDeviations
std::vector< double > GetStandardDeviations() const
Definition: sitkDemonsRegistrationFilter.h:85
itk::simple::DemonsRegistrationFilter::SetUpdateFieldStandardDeviations
Self & SetUpdateFieldStandardDeviations(double value)
Definition: sitkDemonsRegistrationFilter.h:151
itk::simple::DemonsRegistrationFilter::SmoothUpdateFieldOn
Self & SmoothUpdateFieldOn()
Definition: sitkDemonsRegistrationFilter.h:137
itk::simple::DemonsRegistrationFilter::GetIntensityDifferenceThreshold
double GetIntensityDifferenceThreshold() const
Definition: sitkDemonsRegistrationFilter.h:185
itk::simple::DemonsRegistrationFilter::m_pfGetMetric
std::function< double()> m_pfGetMetric
Definition: sitkDemonsRegistrationFilter.h:279
itk::simple::DemonsRegistrationFilter::m_MemberFactory
std::unique_ptr< detail::MemberFunctionFactory< MemberFunctionType > > m_MemberFactory
Definition: sitkDemonsRegistrationFilter.h:247
itk::simple::DemonsRegistrationFilter::GetMetric
double GetMetric() const
Definition: sitkDemonsRegistrationFilter.h:222
itk::simple::DemonsRegistrationFilter::SmoothUpdateFieldOff
Self & SmoothUpdateFieldOff()
Definition: sitkDemonsRegistrationFilter.h:138
itk
itk::simple::DemonsRegistrationFilter::SetMaximumRMSError
Self & SetMaximumRMSError(double MaximumRMSError)
Definition: sitkDemonsRegistrationFilter.h:97
itk::ProcessObject
itk::simple::ImageFilter
The base interface for SimpleITK filters that take one input image.
Definition: sitkImageFilter.h:36
itk::simple::DemonsRegistrationFilter::SetMaximumError
Self & SetMaximumError(double MaximumError)
Definition: sitkDemonsRegistrationFilter.h:171
itk::simple::DemonsRegistrationFilter::SetStandardDeviations
Self & SetStandardDeviations(std::vector< double > StandardDeviations)
Definition: sitkDemonsRegistrationFilter.h:77
itk::uint32_t
::uint32_t uint32_t
itk::simple::DemonsRegistrationFilter::GetName
std::string GetName() const
Definition: sitkDemonsRegistrationFilter.h:226
itk::simple::DemonsRegistrationFilter::SetUseMovingImageGradient
Self & SetUseMovingImageGradient(bool UseMovingImageGradient)
Definition: sitkDemonsRegistrationFilter.h:106
itk::simple::DemonsRegistrationFilter::GetUseImageSpacing
bool GetUseImageSpacing() const
Definition: sitkDemonsRegistrationFilter.h:197
itk::simple::DemonsRegistrationFilter::SmoothDisplacementFieldOff
Self & SmoothDisplacementFieldOff()
Definition: sitkDemonsRegistrationFilter.h:124
itk::simple::DemonsRegistrationFilter::GetUseMovingImageGradient
bool GetUseMovingImageGradient() const
Definition: sitkDemonsRegistrationFilter.h:115
itk::simple::DemonsRegistrationFilter::GetRMSChange
double GetRMSChange() const
The Root Mean Square of the levelset upon termination.
Definition: sitkDemonsRegistrationFilter.h:213
itk::simple::DemonsRegistrationFilter::GetMaximumError
double GetMaximumError() const
Definition: sitkDemonsRegistrationFilter.h:176