ITK  4.8.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< typename TFixedImage, typename TMovingImage, typename 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 
80  typedef typename MovingImageType::SpacingType MovingSpacingType;
81 
85  typedef typename FixedImageType::IndexType IndexType;
86  typedef typename FixedImageType::SizeType SizeType;
87  typedef typename FixedImageType::SpacingType SpacingType;
88 
93 
95  itkStaticConstMacro(ImageDimension, unsigned
97 
99  typedef typename Superclass::PixelType PixelType;
104 
106  typedef double CoordRepType;
112 
118 
124 
127  { m_MovingImageInterpolator = ptr; }
128 
131  { return m_MovingImageInterpolator; }
132 
135  virtual TimeStepType ComputeGlobalTimeStep(void *GlobalData) const ITK_OVERRIDE;
136 
139  virtual void * GetGlobalDataPointer() const ITK_OVERRIDE
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 ITK_OVERRIDE;
152 
154  virtual void InitializeIteration() ITK_OVERRIDE;
155 
158  virtual PixelType ComputeUpdate( const NeighborhoodType & neighborhood,
159  void *globalData,
160  const FloatOffsetType & offset =
161  FloatOffsetType(0.0) ) ITK_OVERRIDE;
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 ITK_OVERRIDE;
214 
218 
225  double m_MaxL1Norm;
226  };
227 
228 private:
229  LevelSetMotionRegistrationFunction(const Self &); //purposely not implemented
230  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
Critical section locking class that can be allocated on the stack.
Light weight base class for most itk classes.
LinearInterpolateImageFunction< MovingImageType, CoordRepType > DefaultInterpolatorType
SmoothingRecursiveGaussianImageFilter< MovingImageType > MovingImageSmoothingFilterType
CovariantVector< double, itkGetStaticConstMacro(ImageDimension) > CovariantVectorType
virtual double GetGradientMagnitudeThreshold() const
ConstNeighborhoodIterator< TDisplacementField >::RadiusType RadiusType
virtual void SetGradientMagnitudeThreshold(double)
PDEDeformableRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField > Superclass
virtual void SetIntensityDifferenceThreshold(double)
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
ConstNeighborhoodIterator< FixedImageType > FixedImageNeighborhoodIteratorType
virtual TimeStepType ComputeGlobalTimeStep(void *GlobalData) const override
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
virtual void ReleaseGlobalDataPointer(void *GlobalData) const override
MovingImageSmoothingFilterType::Pointer MovingImageSmoothingFilterPointer
Computes the smoothing of an image by convolution with the Gaussian kernels implemented as IIR filter...
virtual double GetIntensityDifferenceThreshold() const
virtual void InitializeIteration() override
Linearly interpolate an image at specified positions.
Base class for all image interpolaters.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
virtual PixelType ComputeUpdate(const NeighborhoodType &neighborhood, void *globalData, const FloatOffsetType &offset=FloatOffsetType(0.0)) override
Vector< double, itkGetStaticConstMacro(ImageDimension) > VectorType
void PrintSelf(std::ostream &os, Indent indent) const override
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:51
A templated class holding a n-Dimensional covariant vector.
Superclass::DisplacementFieldTypePointer DisplacementFieldTypePointer
virtual void SetGradientSmoothingStandardDeviations(double)
virtual double GetGradientSmoothingStandardDeviations() const