ITK  4.3.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>
33 template <class TDataHolder>
35 
91 template<typename TFixedImage, typename TMovingImage, typename TOutputTransform =
92  GaussianSmoothingOnUpdateTimeVaryingVelocityFieldTransform<double, 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::ImageMetricType ImageMetricType;
125  typedef typename Superclass::MultiMetricType MultiMetricType;
126 
127  typedef TOutputTransform OutputTransformType;
128  typedef typename OutputTransformType::Pointer OutputTransformPointer;
129  typedef typename OutputTransformType::ScalarType RealType;
130  typedef typename OutputTransformType::DerivativeType DerivativeType;
131  typedef typename DerivativeType::ValueType DerivativeValueType;
132  typedef typename OutputTransformType::TimeVaryingVelocityFieldType TimeVaryingVelocityFieldType;
133  typedef typename TimeVaryingVelocityFieldType::Pointer TimeVaryingVelocityFieldPointer;
134  typedef typename OutputTransformType::DisplacementFieldType DisplacementFieldType;
135  typedef typename DisplacementFieldType::Pointer DisplacementFieldPointer;
136  typedef typename TimeVaryingVelocityFieldType::PixelType DisplacementVectorType;
137 
138  typedef typename Superclass::CompositeTransformType CompositeTransformType;
139 
140  typedef typename Superclass::DecoratedOutputTransformType DecoratedOutputTransformType;
142 
144 
146  itkSetMacro( LearningRate, RealType );
147  itkGetConstMacro( LearningRate, RealType );
149 
151  itkSetMacro( NumberOfIterationsPerLevel, NumberOfIterationsArrayType );
152  itkGetConstMacro( NumberOfIterationsPerLevel, NumberOfIterationsArrayType );
154 
156  itkSetMacro( ConvergenceThreshold, RealType );
157  itkGetConstMacro( ConvergenceThreshold, RealType );
159 
161  itkSetMacro( ConvergenceWindowSize, unsigned int );
162  itkGetConstMacro( ConvergenceWindowSize, unsigned int );
164 
165 protected:
168  virtual void PrintSelf( std::ostream & os, Indent indent ) const;
169 
171  virtual void GenerateData();
172 
174  void ThreadedGenerateData( const RegionType &, ThreadIdType );
175 
177  virtual void StartOptimization();
178 
179 private:
180  TimeVaryingVelocityFieldImageRegistrationMethodv4( const Self & ); //purposely not
181  // implemented
182  void operator=( const Self & ); //purposely not
183 
185 
188 
190 };
191 } // end namespace itk
192 
193 #ifndef ITK_MANUAL_INSTANTIATION
194 #include "itkTimeVaryingVelocityFieldImageRegistrationMethodv4.hxx"
195 #endif
196 
197 #endif
198