ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.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 __itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod_h
19 #define __itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod_h
20 
22 
25 
26 namespace itk
27 {
28 //Forward-declare these because of module dependency conflict.
29 //They will soon be moved to a different module, at which
30 // time this can be removed.
31 template <unsigned int VDimension, class TDataHolder>
32 class ImageToData;
33 template <class TDataHolder>
34 class Array1DToData;
35 
91 template<typename TFixedImage, typename TMovingImage, typename TOutputTransform =
92  TimeVaryingBSplineVelocityFieldTransform<double, GetImageDimension<TFixedImage>::ImageDimension> >
94 : public ImageRegistrationMethodv4<TFixedImage, TMovingImage, TOutputTransform>
95 {
96 public:
102 
104  itkNewMacro( Self );
105 
107  itkStaticConstMacro( ImageDimension, unsigned int, TFixedImage::ImageDimension );
108 
110  itkTypeMacro( TimeVaryingBSplineVelocityFieldImageRegistrationMethod, SimpleImageRegistrationMethod );
111 
113  typedef TFixedImage FixedImageType;
114  typedef typename FixedImageType::Pointer FixedImagePointer;
115  typedef TMovingImage MovingImageType;
116  typedef typename MovingImageType::Pointer MovingImagePointer;
117 
119  typedef typename Superclass::MetricType MetricType;
123 
124  typedef TOutputTransform OutputTransformType;
125  typedef typename OutputTransformType::Pointer OutputTransformPointer;
126  typedef typename OutputTransformType::ScalarType RealType;
127  typedef typename OutputTransformType::DerivativeType DerivativeType;
128  typedef typename DerivativeType::ValueType DerivativeValueType;
129  typedef typename OutputTransformType::DisplacementFieldType DisplacementFieldType;
130  typedef typename OutputTransformType::TimeVaryingVelocityFieldControlPointLatticeType TimeVaryingVelocityFieldControlPointLatticeType;
131  typedef typename OutputTransformType::TimeVaryingVelocityFieldControlPointLatticePointer TimeVaryingVelocityFieldControlPointLatticePointer;
132  typedef typename OutputTransformType::TimeVaryingVelocityFieldControlPointLatticeType TimeVaryingVelocityFieldType;
133  typedef typename OutputTransformType::TimeVaryingVelocityFieldControlPointLatticePointer TimeVaryingVelocityFieldPointer;
134  typedef typename TimeVaryingVelocityFieldControlPointLatticeType::PixelType DisplacementVectorType;
135 
136  typedef typename Superclass::CompositeTransformType CompositeTransformType;
137 
138  typedef typename Superclass::DecoratedOutputTransformType DecoratedOutputTransformType;
140 
142 
144  itkSetMacro( LearningRate, RealType );
145  itkGetConstMacro( LearningRate, RealType );
147 
149  itkSetMacro( NumberOfIterationsPerLevel, NumberOfIterationsArrayType );
150  itkGetConstMacro( NumberOfIterationsPerLevel, NumberOfIterationsArrayType );
152 
154  itkSetMacro( ConvergenceThreshold, RealType );
155  itkGetConstMacro( ConvergenceThreshold, RealType );
157 
159  itkSetMacro( ConvergenceWindowSize, unsigned int );
160  itkGetConstMacro( ConvergenceWindowSize, unsigned int );
162 
164  itkSetMacro( NumberOfTimePointSamples, SizeValueType );
165  itkGetConstMacro( NumberOfTimePointSamples, SizeValueType );
167 
168 protected:
171  virtual void PrintSelf( std::ostream & os, Indent indent ) const;
172 
174  virtual void GenerateData();
175 
177  virtual void StartOptimization();
178 
179 private:
181  // implemented
182  void operator=( const Self & ); //purposely not
183 
185 
188 
190 
192 };
193 } // end namespace itk
194 
195 #ifndef ITK_MANUAL_INSTANTIATION
196 #include "itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx"
197 #endif
198 
199 #endif
200