go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
elxStandardGradientDescent.h
Go to the documentation of this file.
00001 /*======================================================================
00002 
00003   This file is part of the elastix software.
00004 
00005   Copyright (c) University Medical Center Utrecht. All rights reserved.
00006   See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
00007   details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE. See the above copyright notices for more information.
00012 
00013 ======================================================================*/
00014 
00015 #ifndef __elxStandardGradientDescent_h
00016 #define __elxStandardGradientDescent_h
00017 
00018 #include "itkStandardGradientDescentOptimizer.h"
00019 #include "elxIncludes.h"
00020 
00021 namespace elastix
00022 {
00023   using namespace itk;
00024 
00025 
00066   template <class TElastix>
00067   class StandardGradientDescent :
00068     public
00069     itk::StandardGradientDescentOptimizer,
00070     public
00071     OptimizerBase<TElastix>
00072   {
00073   public:
00074 
00076     typedef StandardGradientDescent             Self;
00077     typedef StandardGradientDescentOptimizer    Superclass1;
00078     typedef OptimizerBase<TElastix>             Superclass2;
00079     typedef SmartPointer<Self>                  Pointer;
00080     typedef SmartPointer<const Self>            ConstPointer;
00081 
00083     itkNewMacro( Self );
00084 
00086     itkTypeMacro( StandardGradientDescent, StandardGradientDescentOptimizer );
00087 
00092     elxClassNameMacro( "StandardGradientDescent" );
00093 
00095     typedef Superclass1::CostFunctionType     CostFunctionType;
00096     typedef Superclass1::CostFunctionPointer  CostFunctionPointer;
00097     typedef Superclass1::StopConditionType    StopConditionType;
00098 
00100     typedef typename Superclass2::ElastixType           ElastixType;
00101     typedef typename Superclass2::ElastixPointer        ElastixPointer;
00102     typedef typename Superclass2::ConfigurationType     ConfigurationType;
00103     typedef typename Superclass2::ConfigurationPointer  ConfigurationPointer;
00104     typedef typename Superclass2::RegistrationType      RegistrationType;
00105     typedef typename Superclass2::RegistrationPointer   RegistrationPointer;
00106     typedef typename Superclass2::ITKBaseType           ITKBaseType;
00107 
00109     typedef typename Superclass1::ParametersType        ParametersType;
00110 
00113     virtual void BeforeRegistration( void );
00114     virtual void BeforeEachResolution( void );
00115     virtual void AfterEachResolution( void );
00116     virtual void AfterEachIteration( void );
00117     virtual void AfterRegistration( void );
00118 
00121     virtual void StartOptimization( void );
00122 
00124     virtual void MetricErrorResponse( ExceptionObject & err );
00125 
00129     virtual void SetCurrentPositionPublic( const ParametersType &param )
00130     {
00131       this->Superclass1::SetCurrentPosition( param );
00132     }
00133 
00135     itkSetMacro( MaximumNumberOfSamplingAttempts, unsigned long );
00136 
00138     itkGetConstReferenceMacro( MaximumNumberOfSamplingAttempts, unsigned long );
00139 
00140   protected:
00141 
00142     StandardGradientDescent();
00143     virtual ~StandardGradientDescent() {};
00144 
00145 
00146   private:
00147 
00148     StandardGradientDescent( const Self& ); // purposely not implemented
00149     void operator=( const Self& );          // purposely not implemented
00150 
00152     unsigned long m_MaximumNumberOfSamplingAttempts;
00153     unsigned long m_CurrentNumberOfSamplingAttempts;
00154     unsigned long m_PreviousErrorAtIteration;
00155 
00156   }; // end class StandardGradientDescent
00157 
00158 
00159 } // end namespace elastix
00160 
00161 #ifndef ITK_MANUAL_INSTANTIATION
00162 #include "elxStandardGradientDescent.hxx"
00163 #endif
00164 
00165 #endif // end #ifndef __elxStandardGradientDescent_h


Generated on 24-10-2011 for elastix by doxygen 1.7.4 elastix logo