ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkSymmetricForcesDemonsRegistrationFunction.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 __itkSymmetricForcesDemonsRegistrationFunction_h
19 #define __itkSymmetricForcesDemonsRegistrationFunction_h
20 
22 #include "itkPoint.h"
25 
26 namespace itk
27 {
60 template< class TFixedImage, class TMovingImage, class TDisplacementField >
62  public PDEDeformableRegistrationFunction< TFixedImage,
63  TMovingImage, TDisplacementField >
64 {
65 public:
66 
69  typedef PDEDeformableRegistrationFunction< TFixedImage,
70  TMovingImage, TDisplacementField >
74 
76  itkNewMacro(Self);
77 
81 
83  typedef typename Superclass::MovingImageType MovingImageType;
84  typedef typename Superclass::MovingImagePointer MovingImagePointer;
85 
87  typedef typename Superclass::FixedImageType FixedImageType;
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 
94  typedef typename Superclass::DisplacementFieldType DisplacementFieldType;
95  typedef typename Superclass::DisplacementFieldTypePointer
97 
99  itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
100 
107 
109  typedef double CoordRepType;
114 
117 
121 
123  void SetMovingImageInterpolator(InterpolatorType *ptr)
124  { m_MovingImageInterpolator = ptr; }
125 
127  InterpolatorType * GetMovingImageInterpolator(void)
128  { return m_MovingImageInterpolator; }
129 
131  virtual TimeStepType ComputeGlobalTimeStep( void *itkNotUsed(GlobalData) ) const
132  { return m_TimeStep; }
133 
136  virtual void * GetGlobalDataPointer() const
137  {
138  GlobalDataStruct *global = new GlobalDataStruct();
139 
140  global->m_SumOfSquaredDifference = 0.0;
141  global->m_NumberOfPixelsProcessed = 0L;
142  global->m_SumOfSquaredChange = 0;
143  return global;
144  }
145 
147  virtual void ReleaseGlobalDataPointer(void *GlobalData) const;
148 
150  virtual void InitializeIteration();
151 
154  virtual PixelType ComputeUpdate( const NeighborhoodType & neighborhood,
155  void *globalData,
156  const FloatOffsetType & offset = FloatOffsetType(0.0) );
157 
161  virtual double GetMetric() const
162  { return m_Metric; }
163 
165  virtual const double & GetRMSChange() const
166  { return m_RMSChange; }
167 
172  virtual void SetIntensityDifferenceThreshold(double);
173 
174  virtual double GetIntensityDifferenceThreshold() const;
175 
176 protected:
179  void PrintSelf(std::ostream & os, Indent indent) const;
180 
183 
190  };
191 private:
192  SymmetricForcesDemonsRegistrationFunction(const Self &); //purposely not
193  // implemented
194  void operator=(const Self &); //purposely not
196 
197  // implemented
198 
202  double m_Normalizer;
203 
206 
209 
212 
215 
218 
222  mutable double m_Metric;
223  mutable double m_SumOfSquaredDifference;
225  mutable double m_RMSChange;
226  mutable double m_SumOfSquaredChange;
227 
230 };
231 } // end namespace itk
232 
233 #ifndef ITK_MANUAL_INSTANTIATION
234 #include "itkSymmetricForcesDemonsRegistrationFunction.hxx"
235 #endif
236 
237 #endif
238