ITK  4.4.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 
26 
27 namespace itk
28 {
29 //Forward-declare these because of module dependency conflict.
30 //They will soon be moved to a different module, at which
31 // time this can be removed.
32 template <unsigned int VDimension, class TDataHolder>
33 class ImageToData;
34 template <class TDataHolder>
35 class Array1DToData;
36 
93 template<typename TFixedImage, typename TMovingImage, typename TOutputTransform =
94  TimeVaryingBSplineVelocityFieldTransform<double, TFixedImage::ImageDimension> >
96 : public ImageRegistrationMethodv4<TFixedImage, TMovingImage, TOutputTransform>
97 {
98 public:
104 
106  itkNewMacro( Self );
107 
109  itkStaticConstMacro( ImageDimension, unsigned int, TFixedImage::ImageDimension );
110 
112  itkTypeMacro( TimeVaryingBSplineVelocityFieldImageRegistrationMethod, SimpleImageRegistrationMethod );
113 
115  typedef TFixedImage FixedImageType;
116  typedef typename FixedImageType::Pointer FixedImagePointer;
117  typedef TMovingImage MovingImageType;
118  typedef typename MovingImageType::Pointer MovingImagePointer;
119 
121  typedef typename Superclass::ImageMetricType ImageMetricType;
125  typedef typename Superclass::MultiMetricType MultiMetricType;
130 
131  typedef TOutputTransform OutputTransformType;
132  typedef typename OutputTransformType::Pointer OutputTransformPointer;
133  typedef typename OutputTransformType::ScalarType RealType;
134  typedef typename OutputTransformType::DerivativeType DerivativeType;
135  typedef typename DerivativeType::ValueType DerivativeValueType;
136  typedef typename OutputTransformType::DisplacementFieldType DisplacementFieldType;
137  typedef typename OutputTransformType::TimeVaryingVelocityFieldControlPointLatticeType TimeVaryingVelocityFieldControlPointLatticeType;
138  typedef typename OutputTransformType::TimeVaryingVelocityFieldControlPointLatticePointer TimeVaryingVelocityFieldControlPointLatticePointer;
139  typedef typename OutputTransformType::TimeVaryingVelocityFieldControlPointLatticeType TimeVaryingVelocityFieldType;
140  typedef typename OutputTransformType::TimeVaryingVelocityFieldControlPointLatticePointer TimeVaryingVelocityFieldPointer;
141  typedef typename TimeVaryingVelocityFieldControlPointLatticeType::PixelType DisplacementVectorType;
142 
143  typedef typename Superclass::CompositeTransformType CompositeTransformType;
144 
145  typedef typename Superclass::DecoratedOutputTransformType DecoratedOutputTransformType;
147 
149 
156 
158  itkSetMacro( LearningRate, RealType );
159  itkGetConstMacro( LearningRate, RealType );
161 
163  itkSetMacro( NumberOfIterationsPerLevel, NumberOfIterationsArrayType );
164  itkGetConstMacro( NumberOfIterationsPerLevel, NumberOfIterationsArrayType );
166 
168  itkSetMacro( ConvergenceThreshold, RealType );
169  itkGetConstMacro( ConvergenceThreshold, RealType );
171 
173  itkSetMacro( ConvergenceWindowSize, unsigned int );
174  itkGetConstMacro( ConvergenceWindowSize, unsigned int );
176 
178  itkSetMacro( NumberOfTimePointSamples, SizeValueType );
179  itkGetConstMacro( NumberOfTimePointSamples, SizeValueType );
181 
182 protected:
185  virtual void PrintSelf( std::ostream & os, Indent indent ) const;
186 
188  virtual void GenerateData();
189 
191  virtual void StartOptimization();
192 
193 private:
195  // implemented
196  void operator=( const Self & ); //purposely not
197 
199 
202 
204 
206 };
207 } // end namespace itk
208 
209 #ifndef ITK_MANUAL_INSTANTIATION
210 #include "itkTimeVaryingBSplineVelocityFieldImageRegistrationMethod.hxx"
211 #endif
212 
213 #endif
214