SimpleITK  1.2.4
sitkDemonsRegistrationFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 *
3 * Copyright Insight Software Consortium
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 
59  public:
61 
63  virtual ~DemonsRegistrationFilter();
64 
68 
71 
72 
73 
77  SITK_RETURN_SELF_TYPE_HEADER SetStandardDeviations ( const std::vector<double> & StandardDeviations ) { this->m_StandardDeviations = StandardDeviations; return *this; }
78 
80  SITK_RETURN_SELF_TYPE_HEADER SetStandardDeviations( double value ) { this->m_StandardDeviations = std::vector<double>(3, value); return *this; }
81 
82 
86  std::vector<double> GetStandardDeviations() const { return this->m_StandardDeviations; }
87 
90  SITK_RETURN_SELF_TYPE_HEADER SetNumberOfIterations ( uint32_t NumberOfIterations ) { this->m_NumberOfIterations = NumberOfIterations; return *this; }
91 
94  uint32_t GetNumberOfIterations() const { return this->m_NumberOfIterations; }
95 
98  SITK_RETURN_SELF_TYPE_HEADER SetMaximumRMSError ( double MaximumRMSError ) { this->m_MaximumRMSError = MaximumRMSError; return *this; }
99 
102  double GetMaximumRMSError() const { return this->m_MaximumRMSError; }
103 
107  SITK_RETURN_SELF_TYPE_HEADER SetUseMovingImageGradient ( bool UseMovingImageGradient ) { this->m_UseMovingImageGradient = UseMovingImageGradient; return *this; }
108 
110  SITK_RETURN_SELF_TYPE_HEADER UseMovingImageGradientOn() { return this->SetUseMovingImageGradient(true); }
111  SITK_RETURN_SELF_TYPE_HEADER UseMovingImageGradientOff() { return this->SetUseMovingImageGradient(false); }
112 
116  bool GetUseMovingImageGradient() const { return this->m_UseMovingImageGradient; }
117 
121  SITK_RETURN_SELF_TYPE_HEADER SetSmoothDisplacementField ( bool SmoothDisplacementField ) { this->m_SmoothDisplacementField = SmoothDisplacementField; return *this; }
122 
124  SITK_RETURN_SELF_TYPE_HEADER SmoothDisplacementFieldOn() { return this->SetSmoothDisplacementField(true); }
125  SITK_RETURN_SELF_TYPE_HEADER SmoothDisplacementFieldOff() { return this->SetSmoothDisplacementField(false); }
126 
130  bool GetSmoothDisplacementField() const { return this->m_SmoothDisplacementField; }
131 
135  SITK_RETURN_SELF_TYPE_HEADER SetSmoothUpdateField ( bool SmoothUpdateField ) { this->m_SmoothUpdateField = SmoothUpdateField; return *this; }
136 
138  SITK_RETURN_SELF_TYPE_HEADER SmoothUpdateFieldOn() { return this->SetSmoothUpdateField(true); }
139  SITK_RETURN_SELF_TYPE_HEADER SmoothUpdateFieldOff() { return this->SetSmoothUpdateField(false); }
140 
144  bool GetSmoothUpdateField() const { return this->m_SmoothUpdateField; }
145 
149  SITK_RETURN_SELF_TYPE_HEADER SetUpdateFieldStandardDeviations ( const std::vector<double> & UpdateFieldStandardDeviations ) { this->m_UpdateFieldStandardDeviations = UpdateFieldStandardDeviations; return *this; }
150 
152  SITK_RETURN_SELF_TYPE_HEADER SetUpdateFieldStandardDeviations( double value ) { this->m_UpdateFieldStandardDeviations = std::vector<double>(3, value); return *this; }
153 
154 
158  std::vector<double> GetUpdateFieldStandardDeviations() const { return this->m_UpdateFieldStandardDeviations; }
159 
163  SITK_RETURN_SELF_TYPE_HEADER SetMaximumKernelWidth ( unsigned int MaximumKernelWidth ) { this->m_MaximumKernelWidth = MaximumKernelWidth; return *this; }
164 
168  unsigned int GetMaximumKernelWidth() const { return this->m_MaximumKernelWidth; }
169 
173  SITK_RETURN_SELF_TYPE_HEADER SetMaximumError ( double MaximumError ) { this->m_MaximumError = MaximumError; return *this; }
174 
178  double GetMaximumError() const { return this->m_MaximumError; }
179 
183  SITK_RETURN_SELF_TYPE_HEADER SetIntensityDifferenceThreshold ( double IntensityDifferenceThreshold ) { this->m_IntensityDifferenceThreshold = IntensityDifferenceThreshold; return *this; }
184 
187  double GetIntensityDifferenceThreshold() const { return this->m_IntensityDifferenceThreshold; }
188 
191  SITK_RETURN_SELF_TYPE_HEADER SetUseImageSpacing ( bool UseImageSpacing ) { this->m_UseImageSpacing = UseImageSpacing; return *this; }
192 
194  SITK_RETURN_SELF_TYPE_HEADER UseImageSpacingOn() { return this->SetUseImageSpacing(true); }
195  SITK_RETURN_SELF_TYPE_HEADER UseImageSpacingOff() { return this->SetUseImageSpacing(false); }
196 
199  bool GetUseImageSpacing() const { return this->m_UseImageSpacing; }
207  uint32_t GetElapsedIterations() const { return this->m_pfGetElapsedIterations(); };
208 
215  double GetRMSChange() const { return this->m_RMSChange; };
216 
224  double GetMetric() const { return this->m_pfGetMetric(); };
225 
227  std::string GetName() const { return std::string ("DemonsRegistrationFilter"); }
228 
230  std::string ToString() const;
231 
232 
234  Image Execute ( const Image & fixedImage, const Image & movingImage, const Image & initialDisplacementField );
235  Image Execute ( const Image & fixedImage, const Image & movingImage );
236 
237 
239  Image Execute ( const Image & fixedImage, const Image & movingImage, const Image & initialDisplacementField, const std::vector<double> & standardDeviations, uint32_t numberOfIterations, double maximumRMSError, bool useMovingImageGradient, bool smoothDisplacementField, bool smoothUpdateField, const std::vector<double> & updateFieldStandardDeviations, unsigned int maximumKernelWidth, double maximumError, double intensityDifferenceThreshold, bool useImageSpacing );
240  Image Execute ( const Image & fixedImage, const Image & movingImage, const std::vector<double> & standardDeviations, uint32_t numberOfIterations, double maximumRMSError, bool useMovingImageGradient, bool smoothDisplacementField, bool smoothUpdateField, const std::vector<double> & updateFieldStandardDeviations, unsigned int maximumKernelWidth, double maximumError, double intensityDifferenceThreshold, bool useImageSpacing );
241 
242  private:
243 
246  typedef Image (Self::*MemberFunctionType)( const Image * fixedImage, const Image * movingImage, const Image * initialDisplacementField );
247  template <class TImageType> Image ExecuteInternal ( const Image * fixedImage, const Image * movingImage, const Image * initialDisplacementField );
248 
249 
250  friend struct detail::MemberFunctionAddressor<MemberFunctionType>;
251 
252  nsstd::auto_ptr<detail::MemberFunctionFactory<MemberFunctionType> > m_MemberFactory;
253 
254 
255  std::vector<double> m_StandardDeviations;
256  /* Number of iterations to run */
258  /* Value of RMS change below which the filter should stop. This is a convergence criterion. */
263  std::vector<double> m_UpdateFieldStandardDeviations;
264  unsigned int m_MaximumKernelWidth;
268 
269  nsstd::function<uint32_t()> m_pfGetElapsedIterations;
270 
271  double m_RMSChange;
272 
273  nsstd::function<double()> m_pfGetMetric;
274 
275  // Holder of process object for active measurements
277  };
278 
279 
280  }
281 }
282 #endif
Self & SetUpdateFieldStandardDeviations(const std::vector< double > &UpdateFieldStandardDeviations)
Self & SetMaximumKernelWidth(unsigned int MaximumKernelWidth)
std::vector< double > GetStandardDeviations() const
Self & SetSmoothUpdateField(bool SmoothUpdateField)
#define SITKBasicFilters_EXPORT
std::vector< double > GetUpdateFieldStandardDeviations() const
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
Self & SetMaximumRMSError(double MaximumRMSError)
Self & SetIntensityDifferenceThreshold(double IntensityDifferenceThreshold)
Deformably register two images using the demons algorithm.
Self & SetUseMovingImageGradient(bool UseMovingImageGradient)
Self & SetStandardDeviations(const std::vector< double > &StandardDeviations)
::uint32_t uint32_t
The Image class for SimpleITK.
Definition: sitkImage.h:78
uint32_t GetElapsedIterations() const
Number of iterations run.
Self & SetSmoothDisplacementField(bool SmoothDisplacementField)
nsstd::function< uint32_t()> m_pfGetElapsedIterations
Self & SetNumberOfIterations(uint32_t NumberOfIterations)
The base interface for SimpleITK filters that take one input image.
double GetRMSChange() const
The Root Mean Square of the levelset upon termination.
nsstd::auto_ptr< detail::MemberFunctionFactory< MemberFunctionType > > m_MemberFactory