ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkTimeVaryingVelocityFieldImageRegistrationMethodv4.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkTimeVaryingVelocityFieldImageRegistrationMethodv4_h
00019 #define __itkTimeVaryingVelocityFieldImageRegistrationMethodv4_h
00020 
00021 #include "itkImageRegistrationMethodv4.h"
00022 
00023 #include "itkGaussianSmoothingOnUpdateTimeVaryingVelocityFieldTransform.h"
00024 
00025 namespace itk
00026 {
00027 //Forward-declare these because of module dependency conflict.
00028 //They will soon be moved to a different module, at which
00029 // time this can be removed.
00030 template <unsigned int VDimension, class TDataHolder>
00031 class ImageToData;
00032 template <class TDataHolder>
00033 class Array1DToData;
00034 
00090 template<typename TFixedImage, typename TMovingImage, typename TTransform =
00091   GaussianSmoothingOnUpdateTimeVaryingVelocityFieldTransform<double, GetImageDimension<TFixedImage>::ImageDimension> >
00092 class ITK_EXPORT TimeVaryingVelocityFieldImageRegistrationMethodv4
00093 : public ImageRegistrationMethodv4<TFixedImage, TMovingImage, TTransform>
00094 {
00095 public:
00097   typedef TimeVaryingVelocityFieldImageRegistrationMethodv4                       Self;
00098   typedef ImageRegistrationMethodv4<TFixedImage, TMovingImage, TTransform>  Superclass;
00099   typedef SmartPointer<Self>                                                    Pointer;
00100   typedef SmartPointer<const Self>                                              ConstPointer;
00101 
00103   itkNewMacro( Self );
00104 
00106   itkStaticConstMacro( ImageDimension, unsigned int, TFixedImage::ImageDimension );
00107 
00109   itkTypeMacro( TimeVaryingVelocityFieldImageRegistrationMethodv4, ImageRegistrationMethodv4 );
00110 
00112   typedef TFixedImage                                                 FixedImageType;
00113   typedef typename FixedImageType::Pointer                            FixedImagePointer;
00114   typedef TMovingImage                                                MovingImageType;
00115   typedef typename MovingImageType::Pointer                           MovingImagePointer;
00116 
00118   typedef typename Superclass::MetricType                             MetricType;
00119   typedef typename MetricType::Pointer                                MetricPointer;
00120   typedef typename MetricType::VirtualImageType                       VirtualImageType;
00121 
00122   typedef TTransform                                                  TransformType;
00123   typedef typename TransformType::Pointer                             TransformPointer;
00124   typedef typename TransformType::ScalarType                          RealType;
00125   typedef typename TransformType::DerivativeType                      DerivativeType;
00126   typedef typename TransformType::DerivativeValueType                 DerivativeValueType;
00127   typedef typename TransformType::TimeVaryingVelocityFieldType        TimeVaryingVelocityFieldType;
00128   typedef typename TimeVaryingVelocityFieldType::Pointer              TimeVaryingVelocityFieldPointer;
00129   typedef typename TransformType::DisplacementFieldType               DisplacementFieldType;
00130   typedef typename DisplacementFieldType::Pointer                     DisplacementFieldPointer;
00131   typedef typename TimeVaryingVelocityFieldType::PixelType            DisplacementVectorType;
00132 
00133   typedef CompositeTransform<RealType, ImageDimension>                CompositeTransformType;
00134 
00135   typedef typename Superclass::TransformOutputType                    TransformOutputType;
00136   typedef typename TransformOutputType::Pointer                       TransformOutputPointer;
00137 
00138   typedef Array<SizeValueType>                                        NumberOfIterationsArrayType;
00139 
00141   itkSetMacro( LearningRate, RealType );
00142   itkGetConstMacro( LearningRate, RealType );
00144 
00146   itkSetMacro( NumberOfIntegrationStepsPerTimeIndex, SizeValueType );
00147   itkGetConstMacro( NumberOfIntegrationStepsPerTimeIndex, SizeValueType );
00149 
00151   itkSetMacro( NumberOfIterationsPerLevel, NumberOfIterationsArrayType );
00152   itkGetConstMacro( NumberOfIterationsPerLevel, NumberOfIterationsArrayType );
00154 
00156   itkSetMacro( ConvergenceThreshold, RealType );
00157   itkGetConstMacro( ConvergenceThreshold, RealType );
00159 
00160 protected:
00161   TimeVaryingVelocityFieldImageRegistrationMethodv4();
00162   virtual ~TimeVaryingVelocityFieldImageRegistrationMethodv4();
00163   virtual void PrintSelf( std::ostream & os, Indent indent ) const;
00164 
00166   virtual void  GenerateData();
00167 
00169   virtual void StartOptimization();
00170 
00171 private:
00172   TimeVaryingVelocityFieldImageRegistrationMethodv4( const Self & );   //purposely not
00173                                                              // implemented
00174   void operator=( const Self & );                            //purposely not
00175 
00176   SizeValueType                                                   m_NumberOfIntegrationStepsPerTimeIndex;
00177 
00178   RealType                                                        m_LearningRate;
00179 
00180   RealType                                                        m_ConvergenceThreshold;
00181 
00182   NumberOfIterationsArrayType                                     m_NumberOfIterationsPerLevel;
00183 };
00184 } // end namespace itk
00185 
00186 #ifndef ITK_MANUAL_INSTANTIATION
00187 #include "itkTimeVaryingVelocityFieldImageRegistrationMethodv4.hxx"
00188 #endif
00189 
00190 #endif
00191