ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkBSplineSyNImageRegistrationMethod.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 __itkBSplineSyNImageRegistrationMethod_h
19 #define __itkBSplineSyNImageRegistrationMethod_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 
52 template<typename TFixedImage, typename TMovingImage, typename TOutputTransform =
53  BSplineSmoothingOnUpdateDisplacementFieldTransform<double, GetImageDimension<TFixedImage>::ImageDimension> >
55 : public SyNImageRegistrationMethod<TFixedImage, TMovingImage, TOutputTransform>
56 {
57 public:
63 
65  itkNewMacro( Self );
66 
68  itkStaticConstMacro( ImageDimension, unsigned int, TFixedImage::ImageDimension );
69 
72 
74  typedef TFixedImage FixedImageType;
75  typedef typename FixedImageType::Pointer FixedImagePointer;
76  typedef TMovingImage MovingImageType;
77  typedef typename MovingImageType::Pointer MovingImagePointer;
78 
80  typedef typename Superclass::MetricType MetricType;
81  typedef typename MetricType::Pointer MetricPointer;
82  typedef typename MetricType::VirtualImageType VirtualImageType;
83  typedef typename MetricType::MeasureType MeasureType;
84 
85  typedef typename Superclass::NumberOfIterationsArrayType NumberOfIterationsArrayType;
86 
87  typedef TOutputTransform OutputTransformType;
88  typedef typename OutputTransformType::Pointer OutputTransformPointer;
89  typedef typename OutputTransformType::ScalarType RealType;
90  typedef typename OutputTransformType::DerivativeType DerivativeType;
91  typedef typename DerivativeType::ValueType DerivativeValueType;
92  typedef typename OutputTransformType::DisplacementFieldType DisplacementFieldType;
93  typedef typename DisplacementFieldType::Pointer DisplacementFieldPointer;
94  typedef typename DisplacementFieldType::PixelType DisplacementVectorType;
95 
99 
100  typedef typename Superclass::CompositeTransformType CompositeTransformType;
102 
103  typedef typename Superclass::DecoratedOutputTransformType DecoratedOutputTransformType;
104  typedef typename DecoratedOutputTransformType::Pointer DecoratedOutputTransformPointer;
105 
106 protected:
109 
111  virtual void StartOptimization();
112 
113  virtual void InitializeRegistrationAtEachLevel( const SizeValueType );
114 
115  virtual DisplacementFieldPointer ComputeUpdateField( const TFixedImage *, const TransformBaseType *, const TMovingImage *, const TransformBaseType *, MeasureType & );
116  virtual DisplacementFieldPointer BSplineSmoothDisplacementField( const DisplacementFieldType *, const ArrayType & );
117 
118 private:
119  BSplineSyNImageRegistrationMethod( const Self & ); //purposely not implemented
120  void operator=( const Self & ); //purposely not implemented
121 };
122 } // end namespace itk
123 
124 #ifndef ITK_MANUAL_INSTANTIATION
125 #include "itkBSplineSyNImageRegistrationMethod.hxx"
126 #endif
127 
128 #endif
129