ITK  4.6.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< typename TFixedImage, typename TMovingImage, typename 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 
85 
89  typedef typename FixedImageType::IndexType IndexType;
90  typedef typename FixedImageType::SizeType SizeType;
91  typedef typename FixedImageType::SpacingType SpacingType;
92 
97 
99  itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
100 
107 
109  typedef double CoordRepType;
114 
117 
121 
124  { m_MovingImageInterpolator = ptr; }
125 
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 
192 private:
193  SymmetricForcesDemonsRegistrationFunction(const Self &); //purposely not
194  // implemented
195  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
Critical section locking class that can be allocated on the stack.
Light weight base class for most itk classes.
void PrintSelf(std::ostream &os, Indent indent) const
virtual void ReleaseGlobalDataPointer(void *GlobalData) const
CovariantVector< double, itkGetStaticConstMacro(ImageDimension) > CovariantVectorType
ConstNeighborhoodIterator< TDisplacementField >::RadiusType RadiusType
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
InterpolateImageFunction< MovingImageType, CoordRepType > InterpolatorType
virtual PixelType ComputeUpdate(const NeighborhoodType &neighborhood, void *globalData, const FloatOffsetType &offset=FloatOffsetType(0.0))
CentralDifferenceImageFunction< FixedImageType > GradientCalculatorType
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
LinearInterpolateImageFunction< MovingImageType, CoordRepType > DefaultInterpolatorType
virtual double GetIntensityDifferenceThreshold() const
Linearly interpolate an image at specified positions.
PDEDeformableRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField > Superclass
Base class for all image interpolaters.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
ConstNeighborhoodIterator< FixedImageType > FixedImageNeighborhoodIteratorType
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:51
A templated class holding a n-Dimensional covariant vector.