ITK  4.5.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, typename TDataHolder>
31 class ImageToData;
32 template <typename 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;
97  typedef TMovingImage MovingImageType;
98  typedef typename MovingImageType::Pointer MovingImagePointer;
100 
103  typedef typename ImageMetricType::Pointer ImageMetricPointer;
104  typedef typename ImageMetricType::VirtualImageType VirtualImageType;
105  typedef typename ImageMetricType::MeasureType MeasureType;
107  typedef typename ImageMetricType::FixedImageMaskType FixedImageMaskType;
108  typedef typename ImageMetricType::MovingImageMaskType MovingImageMaskType;
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 
120  typedef typename CompositeTransformType::TransformType TransformBaseType;
121 
123  typedef typename DecoratedOutputTransformType::Pointer DecoratedOutputTransformPointer;
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 
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
virtual DisplacementFieldPointer ComputeUpdateField(const FixedImagesContainerType, const TransformBaseType *, const MovingImagesContainerType, const TransformBaseType *, const FixedImageMaskType *, MeasureType &)
Light weight base class for most itk classes.
ImageMetricType::FixedImageMaskType FixedImageMaskType
Superclass::DecoratedOutputTransformType DecoratedOutputTransformType
OutputTransformType::ScalarType RealType
virtual void InitializeRegistrationAtEachLevel(const SizeValueType)
NumberOfIterationsArrayType m_NumberOfIterationsPerLevel
DisplacementFieldType::PixelType DisplacementVectorType
virtual void PrintSelf(std::ostream &os, Indent indent) const
Superclass::MovingImagesContainerType MovingImagesContainerType
ImageRegistrationMethodv4< TFixedImage, TMovingImage, TOutputTransform > Superclass
OutputTransformType::DerivativeType DerivativeType
unsigned long SizeValueType
Definition: itkIntTypes.h:143
DisplacementFieldType::Pointer DisplacementFieldPointer
ImageToImageMetricv4< FixedImageType, MovingImageType, VirtualImageType, RealType > ImageMetricType
virtual DisplacementFieldPointer GaussianSmoothDisplacementField(const DisplacementFieldType *, const RealType)
Superclass::FixedImagesContainerType FixedImagesContainerType
Interface method for the performing greedy SyN image registration.
ImageMetricType::VirtualImageType VirtualImageType
void operator=(const Self &)
CompositeTransformType::TransformType TransformBaseType
Superclass::CompositeTransformType CompositeTransformType
ImageMetricType::MovingImageMaskType MovingImageMaskType
virtual DisplacementFieldPointer InvertDisplacementField(const DisplacementFieldType *, const DisplacementFieldType *=NULL)
ObjectToObjectMultiMetricv4< ImageDimension, ImageDimension, VirtualImageType, RealType > MultiMetricType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
#define NULL
Interface method for the current registration framework.
OutputTransformType::Pointer OutputTransformPointer
DecoratedOutputTransformType::Pointer DecoratedOutputTransformPointer
OutputTransformType::DisplacementFieldType DisplacementFieldType