ITK  4.13.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 
83  typedef typename Superclass::MovingImageType MovingImageType;
84  typedef typename Superclass::MovingImagePointer MovingImagePointer;
85 
88  typedef typename Superclass::FixedImagePointer FixedImagePointer;
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 
106  typedef typename Superclass::TimeStepType TimeStepType;
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 ITK_OVERRIDE
132  { return m_TimeStep; }
133 
136  virtual void * GetGlobalDataPointer() const ITK_OVERRIDE
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 ITK_OVERRIDE;
148 
150  virtual void InitializeIteration() ITK_OVERRIDE;
151 
154  virtual PixelType ComputeUpdate( const NeighborhoodType & neighborhood,
155  void *globalData,
156  const FloatOffsetType & offset = FloatOffsetType(0.0) ) ITK_OVERRIDE;
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 ITK_OVERRIDE;
180 
183 
190  };
191 
192 private:
193  ITK_DISALLOW_COPY_AND_ASSIGN(SymmetricForcesDemonsRegistrationFunction);
194 
198  double m_Normalizer;
199 
202 
205 
208 
211 
214 
218  mutable double m_Metric;
219  mutable double m_SumOfSquaredDifference;
221  mutable double m_RMSChange;
222  mutable double m_SumOfSquaredChange;
223 
226 };
227 } // end namespace itk
228 
229 #ifndef ITK_MANUAL_INSTANTIATION
230 #include "itkSymmetricForcesDemonsRegistrationFunction.hxx"
231 #endif
232 
233 #endif
Critical section locking class that can be allocated on the stack.
Light weight base class for most itk classes.
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
CentralDifferenceImageFunction< FixedImageType > GradientCalculatorType
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
LinearInterpolateImageFunction< MovingImageType, CoordRepType > DefaultInterpolatorType
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:52
A templated class holding a n-Dimensional covariant vector.