ITK  4.13.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 
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;
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;
97 
99  typedef double CoordRepType;
104 
108 
111 
115 
118 
121  {
122  m_MovingImageInterpolator = ptr; m_MovingImageWarper->SetInterpolator(ptr);
123  }
124 
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 ITK_OVERRIDE;
187 
190 
197  };
198 
199 private:
200  ITK_DISALLOW_COPY_AND_ASSIGN(FastSymmetricForcesDemonsRegistrationFunction);
201 
203  double m_Normalizer;
204 
207 
210 
213 
216 
219 
222 
225 
229  mutable double m_Metric;
230  mutable double m_SumOfSquaredDifference;
232  mutable double m_RMSChange;
233  mutable double m_SumOfSquaredChange;
234 
237 };
238 } // end namespace itk
239 
240 #ifndef ITK_MANUAL_INSTANTIATION
241 #include "itkFastSymmetricForcesDemonsRegistrationFunction.hxx"
242 #endif
243 
244 #endif
Critical section locking class that can be allocated on the stack.
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
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 n-Dimensional covariant vector.