ITK  4.3.0
Insight Segmentation and Registration Toolkit
itkSyNImageRegistrationMethod.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 __itkSyNImageRegistrationMethod_h
19 #define __itkSyNImageRegistrationMethod_h
20 
22 
24 
25 namespace itk
26 {
27 //Forward-declare these because of module dependency conflict.
28 //They will soon be moved to a different module, at which
29 // time this can be removed.
30 template <unsigned int VDimension, class TDataHolder>
32 template <class TDataHolder>
34 
72 template<typename TFixedImage, typename TMovingImage, typename TOutputTransform =
73  DisplacementFieldTransform<double, TFixedImage::ImageDimension> >
75 : public ImageRegistrationMethodv4<TFixedImage, TMovingImage, TOutputTransform>
76 {
77 public:
83 
85  itkNewMacro( Self );
86 
88  itkStaticConstMacro( ImageDimension, unsigned int, TFixedImage::ImageDimension );
89 
91  itkTypeMacro( SyNImageRegistrationMethod, SimpleImageRegistrationMethod );
92 
94  typedef TFixedImage FixedImageType;
95  typedef typename FixedImageType::Pointer FixedImagePointer;
96  typedef typename Superclass::FixedImagesContainerType FixedImagesContainerType;
97  typedef TMovingImage MovingImageType;
98  typedef typename MovingImageType::Pointer MovingImagePointer;
99  typedef typename Superclass::MovingImagesContainerType MovingImagesContainerType;
100 
102  typedef typename Superclass::ImageMetricType ImageMetricType;
106  typedef typename Superclass::MultiMetricType MultiMetricType;
107 
108  typedef TOutputTransform OutputTransformType;
109  typedef typename OutputTransformType::Pointer OutputTransformPointer;
110  typedef typename OutputTransformType::ScalarType RealType;
111  typedef typename OutputTransformType::DerivativeType DerivativeType;
112  typedef typename DerivativeType::ValueType DerivativeValueType;
113  typedef typename OutputTransformType::DisplacementFieldType DisplacementFieldType;
114  typedef typename DisplacementFieldType::Pointer DisplacementFieldPointer;
115  typedef typename DisplacementFieldType::PixelType DisplacementVectorType;
116 
117  typedef typename Superclass::CompositeTransformType CompositeTransformType;
119 
120  typedef typename Superclass::DecoratedOutputTransformType DecoratedOutputTransformType;
122 
124 
126  itkSetMacro( LearningRate, RealType );
127  itkGetConstMacro( LearningRate, RealType );
129 
131  itkSetMacro( NumberOfIterationsPerLevel, NumberOfIterationsArrayType );
132  itkGetConstMacro( NumberOfIterationsPerLevel, NumberOfIterationsArrayType );
134 
136  itkSetMacro( ConvergenceThreshold, RealType );
137  itkGetConstMacro( ConvergenceThreshold, RealType );
139 
141  itkSetMacro( ConvergenceWindowSize, unsigned int );
142  itkGetConstMacro( ConvergenceWindowSize, unsigned int );
144 
149  itkSetMacro( DownsampleImagesForMetricDerivatives, bool );
150  itkGetConstMacro( DownsampleImagesForMetricDerivatives, bool );
152 
156  itkSetMacro( AverageMidPointGradients, bool );
157  itkGetConstMacro( AverageMidPointGradients, bool );
159 
164  itkSetMacro( GaussianSmoothingVarianceForTheUpdateField, RealType );
165  itkGetConstReferenceMacro( GaussianSmoothingVarianceForTheUpdateField, RealType );
167 
172  itkSetMacro( GaussianSmoothingVarianceForTheTotalField, RealType );
173  itkGetConstReferenceMacro( GaussianSmoothingVarianceForTheTotalField, RealType );
175 
176 protected:
178  virtual ~SyNImageRegistrationMethod();
179  virtual void PrintSelf( std::ostream & os, Indent indent ) const;
180 
182  virtual void GenerateData();
183 
185  virtual void StartOptimization();
186 
191  virtual void InitializeRegistrationAtEachLevel( const SizeValueType );
192 
194  virtual DisplacementFieldPointer GaussianSmoothDisplacementField( const DisplacementFieldType *, const RealType );
195  virtual DisplacementFieldPointer InvertDisplacementField( const DisplacementFieldType *, const DisplacementFieldType * = NULL );
196 
198 
201 
204 
208 
209 private:
210  SyNImageRegistrationMethod( const Self & ); //purposely not implemented
211  void operator=( const Self & ); //purposely not implemented
212 
215 };
216 } // end namespace itk
217 
218 #ifndef ITK_MANUAL_INSTANTIATION
219 #include "itkSyNImageRegistrationMethod.hxx"
220 #endif
221 
222 #endif
223