ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkLevelSetMotionRegistrationFunction.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 __itkLevelSetMotionRegistrationFunction_h
19 #define __itkLevelSetMotionRegistrationFunction_h
20 
22 #include "itkPoint.h"
23 #include "itkCovariantVector.h"
26 
27 namespace itk
28 {
53 template< class TFixedImage, class TMovingImage, class TDisplacementField >
55  public PDEDeformableRegistrationFunction< TFixedImage,
56  TMovingImage,
57  TDisplacementField >
58 {
59 public:
60 
63  typedef PDEDeformableRegistrationFunction< TFixedImage,
64  TMovingImage, TDisplacementField
66 
69 
71  itkNewMacro(Self);
72 
76 
78  typedef typename Superclass::MovingImageType MovingImageType;
79  typedef typename Superclass::MovingImagePointer MovingImagePointer;
80  typedef typename MovingImageType::SpacingType MovingSpacingType;
81 
84  typedef typename Superclass::FixedImagePointer FixedImagePointer;
85  typedef typename FixedImageType::IndexType IndexType;
86  typedef typename FixedImageType::SizeType SizeType;
87  typedef typename FixedImageType::SpacingType SpacingType;
88 
90  typedef typename Superclass::DisplacementFieldType DisplacementFieldType;
91  typedef typename Superclass::DisplacementFieldTypePointer
93 
95  itkStaticConstMacro(ImageDimension, unsigned
96  int, Superclass::ImageDimension);
97 
99  typedef typename Superclass::PixelType PixelType;
104 
106  typedef double CoordRepType;
112 
118 
124 
126  void SetMovingImageInterpolator(InterpolatorType *ptr)
127  { m_MovingImageInterpolator = ptr; }
128 
130  InterpolatorType * GetMovingImageInterpolator(void)
131  { return m_MovingImageInterpolator; }
132 
135  virtual TimeStepType ComputeGlobalTimeStep(void *GlobalData) const;
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;
147  return global;
148  }
149 
151  virtual void ReleaseGlobalDataPointer(void *GlobalData) const;
152 
154  virtual void InitializeIteration();
155 
158  virtual PixelType ComputeUpdate( const NeighborhoodType & neighborhood,
159  void *globalData,
160  const FloatOffsetType & offset =
161  FloatOffsetType(0.0) );
162 
166  virtual double GetMetric() const
167  { return m_Metric; }
168 
170  virtual double GetRMSChange() const
171  { return m_RMSChange; }
172 
179  virtual void SetAlpha(double);
180 
181  virtual double GetAlpha() const;
182 
187  virtual void SetIntensityDifferenceThreshold(double);
188 
189  virtual double GetIntensityDifferenceThreshold() const;
190 
193  virtual void SetGradientMagnitudeThreshold(double);
194 
195  virtual double GetGradientMagnitudeThreshold() const;
196 
199  virtual void SetGradientSmoothingStandardDeviations(double);
200 
201  virtual double GetGradientSmoothingStandardDeviations() const;
202 
206  void SetUseImageSpacing(bool);
207 
208  bool GetUseImageSpacing() const;
209 
210 protected:
213  void PrintSelf(std::ostream & os, Indent indent) const;
214 
218 
225  double m_MaxL1Norm;
226  };
227 private:
228  LevelSetMotionRegistrationFunction(const Self &); //purposely not implemented
229  void operator=(const Self &); //purposely not implemented
231 
235 
238 
242 
245  double m_Alpha;
246 
249 
252 
255 
259  mutable double m_Metric;
260  mutable double m_SumOfSquaredDifference;
262  mutable double m_RMSChange;
263  mutable double m_SumOfSquaredChange;
264 
267 
269 };
270 } // end namespace itk
271 
272 #ifndef ITK_MANUAL_INSTANTIATION
273 #include "itkLevelSetMotionRegistrationFunction.hxx"
274 #endif
275 
276 #endif
277