ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkFastSymmetricForcesDemonsRegistrationFunction.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 __itkFastSymmetricForcesDemonsRegistrationFunction_h
19 #define __itkFastSymmetricForcesDemonsRegistrationFunction_h
20 
22 #include "itkPoint.h"
25 #include "itkWarpImageFilter.h"
26 
27 namespace itk
28 {
45 template< class TFixedImage, class TMovingImage, class TDisplacementField >
47  public PDEDeformableRegistrationFunction< TFixedImage,
48  TMovingImage, TDisplacementField >
49 {
50 public:
51 
54  typedef PDEDeformableRegistrationFunction< TFixedImage,
55  TMovingImage, TDisplacementField >
59 
61  itkNewMacro(Self);
62 
66 
68  typedef typename Superclass::MovingImageType MovingImageType;
69  typedef typename Superclass::MovingImagePointer MovingImagePointer;
70 
72  typedef typename Superclass::FixedImageType FixedImageType;
73  typedef typename Superclass::FixedImagePointer FixedImagePointer;
74  typedef typename FixedImageType::IndexType IndexType;
75  typedef typename FixedImageType::SizeType SizeType;
76  typedef typename FixedImageType::SpacingType SpacingType;
77 
79  typedef typename Superclass::DisplacementFieldType DisplacementFieldType;
80  typedef typename Superclass::DisplacementFieldTypePointer
82 
83 #ifdef ITKV3_COMPATIBILITY
84  typedef typename Superclass::DeformationFieldType DeformationFieldType;
85  typedef typename Superclass::DeformationFieldTypePointer DeformationFieldTypePointer;
86 #endif
87 
89  itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
90 
92  typedef typename Superclass::PixelType PixelType;
96  typedef typename Superclass::TimeStepType TimeStepType;
97 
99  typedef double CoordRepType;
104 
108 
111 
115 
118 
120  void SetMovingImageInterpolator(InterpolatorType *ptr)
121  {
122  m_MovingImageInterpolator = ptr; m_MovingImageWarper->SetInterpolator(ptr);
123  }
124 
126  InterpolatorType * GetMovingImageInterpolator(void)
127  {
128  return m_MovingImageInterpolator;
129  }
130 
132  virtual TimeStepType ComputeGlobalTimeStep( void *itkNotUsed(GlobalData) ) const
133  {
134  return m_TimeStep;
135  }
136 
139  virtual void * GetGlobalDataPointer() const
140  {
141  GlobalDataStruct *global = new GlobalDataStruct();
142 
143  global->m_SumOfSquaredDifference = 0.0;
144  global->m_NumberOfPixelsProcessed = 0L;
145  global->m_SumOfSquaredChange = 0;
146  return global;
147  }
148 
150  virtual void ReleaseGlobalDataPointer(void *GlobalData) const;
151 
153  virtual void InitializeIteration();
154 
157  virtual PixelType ComputeUpdate( const NeighborhoodType & neighborhood,
158  void *globalData,
159  const FloatOffsetType & offset = FloatOffsetType(0.0) );
160 
164  virtual double GetMetric() const
165  {
166  return m_Metric;
167  }
168 
170  virtual const double & GetRMSChange() const
171  {
172  return m_RMSChange;
173  }
174 
179  virtual void SetIntensityDifferenceThreshold(double);
180 
181  virtual double GetIntensityDifferenceThreshold() const;
182 
183 protected:
186  void PrintSelf(std::ostream & os, Indent indent) const;
187 
190 
197  };
198 private:
199  FastSymmetricForcesDemonsRegistrationFunction(const Self &); //purposely not
200  // implemented
201  void operator=(const Self &); //purposely not
203 
204  // implemented
205 
207  double m_Normalizer;
208 
211 
214 
217 
220 
223 
226 
229 
233  mutable double m_Metric;
234  mutable double m_SumOfSquaredDifference;
236  mutable double m_RMSChange;
237  mutable double m_SumOfSquaredChange;
238 
241 };
242 } // end namespace itk
243 
244 #ifndef ITK_MANUAL_INSTANTIATION
245 #include "itkFastSymmetricForcesDemonsRegistrationFunction.hxx"
246 #endif
247 
248 #endif
249