ITK  4.8.0
Insight Segmentation and Registration Toolkit
itkVariationalRegistrationDemonsFunction.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 __itkVariationalRegistrationDemonsFunction_h
19 #define __itkVariationalRegistrationDemonsFunction_h
20 
23 
24 namespace itk {
25 
54 template< class TFixedImage, class TMovingImage, class TDisplacementField >
56  public VariationalRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField >
57 {
58 public:
62  TFixedImage,
63  TMovingImage,
64  TDisplacementField > Superclass;
67 
69  itkNewMacro(Self);
70 
73 
75  itkStaticConstMacro(ImageDimension, unsigned int,Superclass::ImageDimension);
76 
80 
84 
88 
90  typedef typename FixedImageType::IndexType IndexType;
91  typedef typename FixedImageType::SizeType SizeType;
92  typedef typename FixedImageType::SpacingType SpacingType;
93 
98 
103 
108 
110  virtual void InitializeIteration();
111 
114  virtual PixelType ComputeUpdate(
115  const NeighborhoodType &neighborhood,
116  void *globalData,
117  const FloatOffsetType &offset = FloatOffsetType( 0.0 ) );
118 
121  { m_GradientType = GRADIENT_TYPE_FIXED; }
122 
125  { m_GradientType = GRADIENT_TYPE_WARPED; }
126 
130  { m_GradientType = GRADIENT_TYPE_SYMMETRIC; }
131 
136  virtual void SetIntensityDifferenceThreshold( const double threshold )
137  { m_IntensityDifferenceThreshold = threshold; }
138 
143  virtual double GetIntensityDifferenceThreshold() const
144  { return m_IntensityDifferenceThreshold; }
145 
146 protected:
149 
151 
153  virtual void PrintSelf(std::ostream& os, Indent indent) const;
154 
157  GRADIENT_TYPE_WARPED = 0,
158  GRADIENT_TYPE_FIXED = 1,
159  GRADIENT_TYPE_SYMMETRIC = 2
160  };
161 
162 private:
163  VariationalRegistrationDemonsFunction(const Self&); //purposely not implemented
164  void operator=(const Self&); //purposely not implemented
165 
168 
171 
174 
177 
180 
182  double m_Normalizer;
183 
186 };
187 
188 } // end namespace itk
189 
190 #ifndef ITK_MANUAL_INSTANTIATION
191 #include "itkVariationalRegistrationDemonsFunction.hxx"
192 #endif
193 
194 #endif
DisplacementFieldType::ConstPointer DisplacementFieldTypePointer
Base class for force calculation in the variational registration framework.
Light weight base class for most itk classes.
Calculate the derivative by central differencing.
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
CentralDifferenceImageFunction< FixedImageType > GradientCalculatorType
Superclass::DisplacementFieldTypePointer DisplacementFieldTypePointer
Control indentation during Print() invocation.
Definition: itkIndent.h:49
VariationalRegistrationFunction< TFixedImage, TMovingImage, TDisplacementField > Superclass
This class computes different Demon forces in the variational registration framework.
Templated n-dimensional image class.
Definition: itkImage.h:75