ITK  4.4.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>
31 class ImageToData;
32 template <class TDataHolder>
33 class Array1DToData;
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;
109 
110  typedef TOutputTransform OutputTransformType;
111  typedef typename OutputTransformType::Pointer OutputTransformPointer;
112  typedef typename OutputTransformType::ScalarType RealType;
113  typedef typename OutputTransformType::DerivativeType DerivativeType;
114  typedef typename DerivativeType::ValueType DerivativeValueType;
115  typedef typename OutputTransformType::DisplacementFieldType DisplacementFieldType;
116  typedef typename DisplacementFieldType::Pointer DisplacementFieldPointer;
117  typedef typename DisplacementFieldType::PixelType DisplacementVectorType;
118 
119  typedef typename Superclass::CompositeTransformType CompositeTransformType;
121 
122  typedef typename Superclass::DecoratedOutputTransformType DecoratedOutputTransformType;
124 
126 
128  itkSetMacro( LearningRate, RealType );
129  itkGetConstMacro( LearningRate, RealType );
131 
133  itkSetMacro( NumberOfIterationsPerLevel, NumberOfIterationsArrayType );
134  itkGetConstMacro( NumberOfIterationsPerLevel, NumberOfIterationsArrayType );
136 
138  itkSetMacro( ConvergenceThreshold, RealType );
139  itkGetConstMacro( ConvergenceThreshold, RealType );
141 
143  itkSetMacro( ConvergenceWindowSize, unsigned int );
144  itkGetConstMacro( ConvergenceWindowSize, unsigned int );
146 
151  itkSetMacro( DownsampleImagesForMetricDerivatives, bool );
152  itkGetConstMacro( DownsampleImagesForMetricDerivatives, bool );
154 
158  itkSetMacro( AverageMidPointGradients, bool );
159  itkGetConstMacro( AverageMidPointGradients, bool );
161 
166  itkSetMacro( GaussianSmoothingVarianceForTheUpdateField, RealType );
167  itkGetConstReferenceMacro( GaussianSmoothingVarianceForTheUpdateField, RealType );
169 
174  itkSetMacro( GaussianSmoothingVarianceForTheTotalField, RealType );
175  itkGetConstReferenceMacro( GaussianSmoothingVarianceForTheTotalField, RealType );
177 
179  itkGetConstObjectMacro( FixedToMiddleTransform, OutputTransformType);
180  itkGetConstObjectMacro( MovingToMiddleTransform, OutputTransformType);
182 
183 protected:
185  virtual ~SyNImageRegistrationMethod();
186  virtual void PrintSelf( std::ostream & os, Indent indent ) const;
187 
189  virtual void GenerateData();
190 
192  virtual void StartOptimization();
193 
198  virtual void InitializeRegistrationAtEachLevel( const SizeValueType );
199 
200  virtual DisplacementFieldPointer ComputeUpdateField( const FixedImagesContainerType, const TransformBaseType *,
202  virtual DisplacementFieldPointer GaussianSmoothDisplacementField( const DisplacementFieldType *, const RealType );
203  virtual DisplacementFieldPointer InvertDisplacementField( const DisplacementFieldType *, const DisplacementFieldType * = NULL );
204 
206 
209 
212 
216 
217 private:
218  SyNImageRegistrationMethod( const Self & ); //purposely not implemented
219  void operator=( const Self & ); //purposely not implemented
220 
223 };
224 } // end namespace itk
225 
226 #ifndef ITK_MANUAL_INSTANTIATION
227 #include "itkSyNImageRegistrationMethod.hxx"
228 #endif
229 
230 #endif
231