Orfeo Toolbox  3.16
itkESMDemonsRegistrationFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: itkESMDemonsRegistrationFunction.h,v $
5 Language: C++
6 Date: $Date: 2008-11-12 13:59:47 $
7 Version: $Revision: 1.6 $
8 
9 Copyright (c) Insight Software Consortium. All rights reserved.
10 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 
18 #ifndef __itkESMDemonsRegistrationFunction_h
19 #define __itkESMDemonsRegistrationFunction_h
20 
22 #include "itkPoint.h"
23 #include "itkCovariantVector.h"
27 #include "itkWarpImageFilter.h"
28 
29 namespace itk {
61 template<class TFixedImage, class TMovingImage, class TDeformationField>
63  public PDEDeformableRegistrationFunction< TFixedImage,
64  TMovingImage, TDeformationField>
65 {
66 public:
70  TFixedImage, TMovingImage, TDeformationField > Superclass;
73 
75  itkNewMacro(Self);
76 
78  itkTypeMacro( ESMDemonsRegistrationFunction,
80 
82  typedef typename Superclass::MovingImageType MovingImageType;
83  typedef typename Superclass::MovingImagePointer MovingImagePointer;
84  typedef typename MovingImageType::PixelType MovingPixelType;
85 
88  typedef typename Superclass::FixedImagePointer FixedImagePointer;
89  typedef typename FixedImageType::IndexType IndexType;
90  typedef typename FixedImageType::SizeType SizeType;
91  typedef typename FixedImageType::SpacingType SpacingType;
92  typedef typename FixedImageType::DirectionType DirectionType;
93 
95  typedef typename Superclass::DeformationFieldType DeformationFieldType;
96  typedef typename Superclass::DeformationFieldTypePointer
98 
100  itkStaticConstMacro(ImageDimension, unsigned int,Superclass::ImageDimension);
101 
107  typedef typename Superclass::TimeStepType TimeStepType;
108 
110  typedef double CoordRepType;
111  typedef InterpolateImageFunction<
117 
119  typedef WarpImageFilter<
123 
126 
130 
136 
138  void SetMovingImageInterpolator( InterpolatorType * ptr )
139  { m_MovingImageInterpolator = ptr; m_MovingImageWarper->SetInterpolator( ptr ); }
140 
142  InterpolatorType * GetMovingImageInterpolator(void)
143  { return m_MovingImageInterpolator; }
144 
146  virtual TimeStepType ComputeGlobalTimeStep(void * itkNotUsed(GlobalData)) const
147  { return m_TimeStep; }
148 
151  virtual void *GetGlobalDataPointer() const
152  {
153  GlobalDataStruct *global = new GlobalDataStruct();
154  global->m_SumOfSquaredDifference = 0.0;
155  global->m_NumberOfPixelsProcessed = 0L;
156  global->m_SumOfSquaredChange = 0;
157  return global;
158  }
159 
161  virtual void ReleaseGlobalDataPointer( void *GlobalData ) const;
162 
164  virtual void InitializeIteration();
165 
168  virtual PixelType ComputeUpdate(const NeighborhoodType &neighborhood,
169  void *globalData,
170  const FloatOffsetType &offset = FloatOffsetType(0.0));
171 
175  virtual double GetMetric() const
176  { return m_Metric; }
177 
179  virtual const double &GetRMSChange() const
180  { return m_RMSChange; }
181 
186  virtual void SetIntensityDifferenceThreshold(double);
187  virtual double GetIntensityDifferenceThreshold() const;
188 
192  virtual void SetMaximumUpdateStepLength(double sm)
193  {
194  this->m_MaximumUpdateStepLength =sm;
195  }
196  virtual double GetMaximumUpdateStepLength() const
197  {
198  return this->m_MaximumUpdateStepLength;
199  }
200 
203  Symmetric=0,
204  Fixed=1,
205  WarpedMoving=2,
206  MappedMoving=3
207  };
208 
210  virtual void SetUseGradientType( GradientType gtype )
211  { m_UseGradientType = gtype; }
212  virtual GradientType GetUseGradientType() const
213  { return m_UseGradientType; }
214 
215 protected:
218  void PrintSelf(std::ostream& os, Indent indent) const;
219 
222 
226  {
230  };
231 
232 private:
233  ESMDemonsRegistrationFunction(const Self&); //purposely not implemented
234  void operator=(const Self&); //purposely not implemented
235 
240  double m_Normalizer;
241 
244 
247 
249 
252 
255 
258 
261 
264 
267 
271  mutable double m_Metric;
272  mutable double m_SumOfSquaredDifference;
273  mutable unsigned long m_NumberOfPixelsProcessed;
274  mutable double m_RMSChange;
275  mutable double m_SumOfSquaredChange;
276 
279 };
280 
281 } // end namespace itk
282 
283 #ifndef ITK_MANUAL_INSTANTIATION
285 #endif
286 
287 #endif

Generated at Sat May 18 2013 23:37:11 for Orfeo Toolbox with doxygen 1.8.3.1