ITK  4.13.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 >
54 class ITK_TEMPLATE_EXPORT LevelSetMotionRegistrationFunction:
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;
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 
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  ITK_DISALLOW_COPY_AND_ASSIGN(LevelSetMotionRegistrationFunction);
230 
234 
237 
241 
244  double m_Alpha;
245 
248 
251 
254 
258  mutable double m_Metric;
259  mutable double m_SumOfSquaredDifference;
261  mutable double m_RMSChange;
262  mutable double m_SumOfSquaredChange;
263 
266 
268 };
269 } // end namespace itk
270 
271 #ifndef ITK_MANUAL_INSTANTIATION
272 #include "itkLevelSetMotionRegistrationFunction.hxx"
273 #endif
274 
275 #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
ConstNeighborhoodIterator< TDisplacementField >::RadiusType RadiusType
PDEDeformableRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField > Superclass
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
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
MovingImageSmoothingFilterType::Pointer MovingImageSmoothingFilterPointer
Computes the smoothing of an image by convolution with the Gaussian kernels implemented as IIR filter...
Linearly interpolate an image at specified positions.
Base class for all image interpolaters.
static ITK_CONSTEXPR_FUNC T NonpositiveMin()
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Vector< double, itkGetStaticConstMacro(ImageDimension) > VectorType
A templated class holding a n-Dimensional covariant vector.
Superclass::DisplacementFieldTypePointer DisplacementFieldTypePointer