ITK  4.6.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< typename TFixedImage, typename TMovingImage, typename 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 
70 
74  typedef typename FixedImageType::IndexType IndexType;
75  typedef typename FixedImageType::SizeType SizeType;
76  typedef typename FixedImageType::SpacingType SpacingType;
77 
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;
97 
99  typedef double CoordRepType;
104 
108 
111 
115 
118 
121  {
122  m_MovingImageInterpolator = ptr; m_MovingImageWarper->SetInterpolator(ptr);
123  }
124 
127  {
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 
199 private:
200  FastSymmetricForcesDemonsRegistrationFunction(const Self &); //purposely not
201  // implemented
202  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
Critical section locking class that can be allocated on the stack.
virtual void ReleaseGlobalDataPointer(void *GlobalData) const
LinearInterpolateImageFunction< MovingImageType, CoordRepType > DefaultInterpolatorType
Light weight base class for most itk classes.
CovariantVector< double, itkGetStaticConstMacro(ImageDimension) > CovariantVectorType
InterpolateImageFunction< MovingImageType, CoordRepType > InterpolatorType
CentralDifferenceImageFunction< MovingImageType > MovingGradientCalculatorType
PDEDeformableRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField > Superclass
ConstNeighborhoodIterator< TDisplacementField >::RadiusType RadiusType
WarpImageFilter< MovingImageType, MovingImageType, DisplacementFieldType > WarperType
Calculate the derivative by central differencing.
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
unsigned long SizeValueType
Definition: itkIntTypes.h:143
void PrintSelf(std::ostream &os, Indent indent) const
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
Warps an image using an input displacement field.
Linearly interpolate an image at specified positions.
Base class for all image interpolaters.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:51
A templated class holding a n-Dimensional covariant vector.
virtual PixelType ComputeUpdate(const NeighborhoodType &neighborhood, void *globalData, const FloatOffsetType &offset=FloatOffsetType(0.0))