ITK  4.6.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 
65 template<typename TFixedImage, typename TMovingImage, typename TOutputTransform =
66  DisplacementFieldTransform<double, TFixedImage::ImageDimension> >
68 : public ImageRegistrationMethodv4<TFixedImage, TMovingImage, TOutputTransform>
69 {
70 public:
76 
78  itkNewMacro( Self );
79 
81  itkStaticConstMacro( ImageDimension, unsigned int, TFixedImage::ImageDimension );
82 
84  itkTypeMacro( SyNImageRegistrationMethod, SimpleImageRegistrationMethod );
85 
87  typedef TFixedImage FixedImageType;
88  typedef typename FixedImageType::Pointer FixedImagePointer;
90  typedef TMovingImage MovingImageType;
91  typedef typename MovingImageType::Pointer MovingImagePointer;
93 
96  typedef typename ImageMetricType::Pointer ImageMetricPointer;
97  typedef typename ImageMetricType::VirtualImageType VirtualImageType;
98  typedef typename ImageMetricType::MeasureType MeasureType;
100  typedef typename ImageMetricType::FixedImageMaskType FixedImageMaskType;
101  typedef typename ImageMetricType::MovingImageMaskType MovingImageMaskType;
102 
104  typedef TOutputTransform OutputTransformType;
105  typedef typename OutputTransformType::Pointer OutputTransformPointer;
106  typedef typename OutputTransformType::ScalarType RealType;
107  typedef typename OutputTransformType::DerivativeType DerivativeType;
108  typedef typename DerivativeType::ValueType DerivativeValueType;
109  typedef typename OutputTransformType::DisplacementFieldType DisplacementFieldType;
110  typedef typename DisplacementFieldType::Pointer DisplacementFieldPointer;
111  typedef typename DisplacementFieldType::PixelType DisplacementVectorType;
112 
114  typedef typename CompositeTransformType::TransformType TransformBaseType;
115 
117  typedef typename DecoratedOutputTransformType::Pointer DecoratedOutputTransformPointer;
118 
120 
122  itkSetMacro( LearningRate, RealType );
123  itkGetConstMacro( LearningRate, RealType );
125 
127  itkSetMacro( NumberOfIterationsPerLevel, NumberOfIterationsArrayType );
128  itkGetConstMacro( NumberOfIterationsPerLevel, NumberOfIterationsArrayType );
130 
132  itkSetMacro( ConvergenceThreshold, RealType );
133  itkGetConstMacro( ConvergenceThreshold, RealType );
135 
137  itkSetMacro( ConvergenceWindowSize, unsigned int );
138  itkGetConstMacro( ConvergenceWindowSize, unsigned int );
140 
145  itkSetMacro( DownsampleImagesForMetricDerivatives, bool );
146  itkGetConstMacro( DownsampleImagesForMetricDerivatives, bool );
148 
152  itkSetMacro( AverageMidPointGradients, bool );
153  itkGetConstMacro( AverageMidPointGradients, bool );
155 
160  itkSetMacro( GaussianSmoothingVarianceForTheUpdateField, RealType );
161  itkGetConstReferenceMacro( GaussianSmoothingVarianceForTheUpdateField, RealType );
163 
168  itkSetMacro( GaussianSmoothingVarianceForTheTotalField, RealType );
169  itkGetConstReferenceMacro( GaussianSmoothingVarianceForTheTotalField, RealType );
171 
173  itkGetConstObjectMacro( FixedToMiddleTransform, OutputTransformType);
174  itkGetConstObjectMacro( MovingToMiddleTransform, OutputTransformType);
176 
177 protected:
179  virtual ~SyNImageRegistrationMethod();
180  virtual void PrintSelf( std::ostream & os, Indent indent ) const;
181 
183  virtual void GenerateData();
184 
186  virtual void StartOptimization();
187 
192  virtual void InitializeRegistrationAtEachLevel( const SizeValueType );
193 
198 
200 
203 
206 
210 
211 private:
212  SyNImageRegistrationMethod( const Self & ); //purposely not implemented
213  void operator=( const Self & ); //purposely not implemented
214 
217 };
218 } // end namespace itk
219 
220 #ifndef ITK_MANUAL_INSTANTIATION
221 #include "itkSyNImageRegistrationMethod.hxx"
222 #endif
223 
224 #endif
virtual DisplacementFieldPointer ComputeUpdateField(const FixedImagesContainerType, const TransformBaseType *, const MovingImagesContainerType, const TransformBaseType *, const FixedImageMaskType *, MeasureType &)
Light weight base class for most itk classes.
Superclass::InitialTransformType InitialTransformType
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
Superclass::MultiMetricType MultiMetricType
void operator=(const Self &)
CompositeTransformType::TransformType TransformBaseType
Superclass::CompositeTransformType CompositeTransformType
Superclass::ImageMetricType ImageMetricType
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
ImageMetricType::MeasureType MeasureType
OutputTransformType::DisplacementFieldType DisplacementFieldType