go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
elxConjugateGradientFRPR.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 __elxConjugateGradientFRPR_h
00016 #define __elxConjugateGradientFRPR_h
00017 
00018 #include "itkFRPROptimizer.h"
00019 #include "elxIncludes.h"
00020 
00021 namespace elastix
00022 {
00023 using namespace itk;
00024 
00025 
00072   template <class TElastix>
00073     class ConjugateGradientFRPR :
00074     public
00075       itk::FRPROptimizer,
00076     public
00077       OptimizerBase<TElastix>
00078   {
00079   public:
00080 
00082     typedef ConjugateGradientFRPR               Self;
00083     typedef FRPROptimizer                       Superclass1;
00084     typedef OptimizerBase<TElastix>             Superclass2;
00085     typedef SmartPointer<Self>                  Pointer;
00086     typedef SmartPointer<const Self>            ConstPointer;
00087 
00089     itkNewMacro( Self );
00090 
00092     itkTypeMacro( ConjugateGradientFRPR, FRPROptimizer );
00093 
00095     elxClassNameMacro( "ConjugateGradientFRPR" );
00096 
00098     typedef Superclass1::CostFunctionType                   CostFunctionType;
00099     typedef Superclass1::CostFunctionPointer                CostFunctionPointer;
00100     //typedef Superclass1::StopConditionType                  StopConditionType; not implemented in this itkOptimizer
00101     typedef typename Superclass1::ParametersType            ParametersType;
00102     //not declared in Superclass, although it should be.
00103     typedef SingleValuedNonLinearOptimizer::DerivativeType  DerivativeType;
00104 
00106     typedef typename Superclass2::ElastixType           ElastixType;
00107     typedef typename Superclass2::ElastixPointer        ElastixPointer;
00108     typedef typename Superclass2::ConfigurationType     ConfigurationType;
00109     typedef typename Superclass2::ConfigurationPointer  ConfigurationPointer;
00110     typedef typename Superclass2::RegistrationType      RegistrationType;
00111     typedef typename Superclass2::RegistrationPointer   RegistrationPointer;
00112     typedef typename Superclass2::ITKBaseType           ITKBaseType;
00113 
00116     virtual void BeforeRegistration(void);
00117     virtual void BeforeEachResolution(void);
00118     virtual void AfterEachResolution(void);
00119     virtual void AfterEachIteration(void);
00120     virtual void AfterRegistration(void);
00121 
00123     virtual void SetInitialPosition( const ParametersType & param );
00124 
00127     itkGetConstMacro(LineOptimizing, bool);
00128     itkGetConstMacro(LineBracketing, bool);
00129 
00131     itkGetConstReferenceMacro(CurrentDerivativeMagnitude, double);
00132 
00134     itkGetConstReferenceMacro(CurrentStepLength, double);
00135 
00137     itkGetConstReferenceMacro(CurrentSearchDirectionMagnitude, double);
00138 
00139   protected:
00140 
00141       ConjugateGradientFRPR();
00142       virtual ~ConjugateGradientFRPR() {};
00143 
00145       double          m_CurrentDerivativeMagnitude ;
00146 
00148       double          m_CurrentSearchDirectionMagnitude;
00149 
00151       double          m_CurrentStepLength;
00152 
00155       itkSetMacro(LineOptimizing, bool);
00156       itkSetMacro(LineBracketing, bool);
00157 
00165       virtual void GetValueAndDerivative(ParametersType p, double * val,
00166         ParametersType * xi);
00167 
00178       virtual void   LineBracket(double *ax, double *bx, double *cx,
00179                                   double *fa, double *fb, double *fc);
00180 
00190       virtual void   BracketedLineOptimize(double ax, double bx, double cx,
00191                                             double fa, double fb, double fc,
00192                                             double * extX, double * extVal);
00193 
00198       virtual void   LineOptimize(ParametersType * p, ParametersType xi,
00199                               double * val );
00200 
00201 
00202   private:
00203 
00204       ConjugateGradientFRPR( const Self& ); // purposely not implemented
00205       void operator=( const Self& );              // purposely not implemented
00206 
00207       bool m_LineOptimizing;
00208       bool m_LineBracketing;
00209 
00210       const char * DeterminePhase(void) const;
00211 
00212 
00213   }; // end class ConjugateGradientFRPR
00214 
00215 
00216 } // end namespace elastix
00217 
00218 #ifndef ITK_MANUAL_INSTANTIATION
00219 #include "elxConjugateGradientFRPR.hxx"
00220 #endif
00221 
00222 #endif // end #ifndef __elxConjugateGradientFRPR_h


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