ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkTimeVaryingVelocityFieldImageRegistrationMethodv4.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 __itkTimeVaryingVelocityFieldImageRegistrationMethodv4_h
19 #define __itkTimeVaryingVelocityFieldImageRegistrationMethodv4_h
20 
22 
24 
25 namespace itk
26 {
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  GaussianSmoothingOnUpdateTimeVaryingVelocityFieldTransform<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 
111 
113  typedef TFixedImage FixedImageType;
114  typedef typename FixedImageType::Pointer FixedImagePointer;
115  typedef TMovingImage MovingImageType;
116  typedef typename MovingImageType::Pointer MovingImagePointer;
117 
118  typedef typename MovingImageType::RegionType RegionType;
119 
121  typedef typename Superclass::MetricType MetricType;
125 
126  typedef TOutputTransform OutputTransformType;
127  typedef typename OutputTransformType::Pointer OutputTransformPointer;
128  typedef typename OutputTransformType::ScalarType RealType;
129  typedef typename OutputTransformType::DerivativeType DerivativeType;
130  typedef typename DerivativeType::ValueType DerivativeValueType;
131  typedef typename OutputTransformType::TimeVaryingVelocityFieldType TimeVaryingVelocityFieldType;
132  typedef typename TimeVaryingVelocityFieldType::Pointer TimeVaryingVelocityFieldPointer;
133  typedef typename OutputTransformType::DisplacementFieldType DisplacementFieldType;
134  typedef typename DisplacementFieldType::Pointer DisplacementFieldPointer;
135  typedef typename TimeVaryingVelocityFieldType::PixelType DisplacementVectorType;
136 
137  typedef typename Superclass::CompositeTransformType CompositeTransformType;
138 
139  typedef typename Superclass::DecoratedOutputTransformType DecoratedOutputTransformType;
141 
143 
145  itkSetMacro( LearningRate, RealType );
146  itkGetConstMacro( LearningRate, RealType );
148 
150  itkSetMacro( NumberOfIterationsPerLevel, NumberOfIterationsArrayType );
151  itkGetConstMacro( NumberOfIterationsPerLevel, NumberOfIterationsArrayType );
153 
155  itkSetMacro( ConvergenceThreshold, RealType );
156  itkGetConstMacro( ConvergenceThreshold, RealType );
158 
160  itkSetMacro( ConvergenceWindowSize, unsigned int );
161  itkGetConstMacro( ConvergenceWindowSize, unsigned int );
163 
164 protected:
167  virtual void PrintSelf( std::ostream & os, Indent indent ) const;
168 
170  virtual void GenerateData();
171 
173  void ThreadedGenerateData( const RegionType &, ThreadIdType );
174 
176  virtual void StartOptimization();
177 
178 private:
179  TimeVaryingVelocityFieldImageRegistrationMethodv4( const Self & ); //purposely not
180  // implemented
181  void operator=( const Self & ); //purposely not
182 
184 
187 
189 };
190 } // end namespace itk
191 
192 #ifndef ITK_MANUAL_INSTANTIATION
193 #include "itkTimeVaryingVelocityFieldImageRegistrationMethodv4.hxx"
194 #endif
195 
196 #endif
197