ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkDemonsRegistrationFilter.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 __itkDemonsRegistrationFilter_h
00019 #define __itkDemonsRegistrationFilter_h
00020 
00021 #include "itkPDEDeformableRegistrationFilter.h"
00022 #include "itkDemonsRegistrationFunction.h"
00023 
00024 namespace itk
00025 {
00062 template< class TFixedImage, class TMovingImage, class TDisplacementField >
00063 class ITK_EXPORT DemonsRegistrationFilter:
00064   public PDEDeformableRegistrationFilter< TFixedImage, TMovingImage,
00065                                           TDisplacementField >
00066 {
00067 public:
00069   typedef DemonsRegistrationFilter                                                        Self;
00070   typedef PDEDeformableRegistrationFilter< TFixedImage, TMovingImage, TDisplacementField > Superclass;
00071   typedef SmartPointer< Self >                                                            Pointer;
00072   typedef SmartPointer< const Self >                                                      ConstPointer;
00073 
00075   itkNewMacro(Self);
00076 
00078   itkTypeMacro(DemonsRegistrationFilter,
00079                PDEDeformableRegistrationFilter);
00080 
00082   typedef typename Superclass::TimeStepType TimeStepType;
00083 
00085   typedef typename Superclass::FixedImageType    FixedImageType;
00086   typedef typename Superclass::FixedImagePointer FixedImagePointer;
00087 
00089   typedef typename Superclass::MovingImageType    MovingImageType;
00090   typedef typename Superclass::MovingImagePointer MovingImagePointer;
00091 
00093   typedef typename Superclass::DisplacementFieldType    DisplacementFieldType;
00094   typedef typename Superclass::DisplacementFieldPointer DisplacementFieldPointer;
00095 
00096 #ifdef ITKV3_COMPATIBILITY
00097   typedef typename Superclass::DeformationFieldType    DeformationFieldType;
00098   typedef typename Superclass::DeformationFieldPointer DeformationFieldPointer;
00099 #endif
00100 
00102   typedef typename Superclass::FiniteDifferenceFunctionType
00103   FiniteDifferenceFunctionType;
00104 
00106   typedef DemonsRegistrationFunction< FixedImageType, MovingImageType,
00107                                       DisplacementFieldType >  DemonsRegistrationFunctionType;
00108 
00114   virtual double GetMetric() const;
00115 
00118   itkSetMacro(UseMovingImageGradient, bool);
00119   itkGetConstMacro(UseMovingImageGradient, bool);
00120   itkBooleanMacro(UseMovingImageGradient);
00122 
00127   virtual void SetIntensityDifferenceThreshold(double);
00128 
00129   virtual double GetIntensityDifferenceThreshold() const;
00130 
00131 protected:
00132   DemonsRegistrationFilter();
00133   // ~DemonsRegistrationFilter() {} default implementation ok
00134   void PrintSelf(std::ostream & os, Indent indent) const;
00135 
00137   virtual void InitializeIteration();
00138 
00140   virtual void ApplyUpdate(const TimeStepType& dt);
00141 
00147   virtual void VerifyInputInformation() {}
00148 
00149 private:
00150   DemonsRegistrationFilter(const Self &); //purposely not implemented
00151   void operator=(const Self &);           //purposely not implemented
00152 
00153   bool m_UseMovingImageGradient;
00154 };
00155 } // end namespace itk
00156 
00157 #ifndef ITK_MANUAL_INSTANTIATION
00158 #include "itkDemonsRegistrationFilter.hxx"
00159 #endif
00160 
00161 #endif
00162