go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
elxConjugateGradient.h
Go to the documentation of this file.
1 /*======================================================================
2 
3  This file is part of the elastix software.
4 
5  Copyright (c) University Medical Center Utrecht. All rights reserved.
6  See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
7  details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 ======================================================================*/
14 
15 #ifndef __elxConjugateGradient_h
16 #define __elxConjugateGradient_h
17 
20 #include "elxIncludes.h"
21 
22 namespace elastix
23 {
24 
25 
88  template <class TElastix>
90  public
92  public
93  OptimizerBase<TElastix>
94  {
95  public:
96 
101  typedef itk::SmartPointer<Self> Pointer;
102  typedef itk::SmartPointer<const Self> ConstPointer;
103 
105  itkNewMacro( Self );
106 
109 
114  elxClassNameMacro( "ConjugateGradient" );
115 
117  typedef Superclass1::CostFunctionType CostFunctionType;
118  typedef Superclass1::CostFunctionPointer CostFunctionPointer;
119  typedef Superclass1::StopConditionType StopConditionType;
120  typedef Superclass1::ParametersType ParametersType;
121  typedef Superclass1::DerivativeType DerivativeType;
122  typedef Superclass1::ScalesType ScalesType;
123 
132 
136  typedef itk::ReceptorMemberCommand<Self> EventPassThroughType;
137  typedef typename EventPassThroughType::Pointer EventPassThroughPointer;
138 
141  virtual void StartOptimization(void);
142 
145  virtual void BeforeRegistration(void);
146  virtual void BeforeEachResolution(void);
147  virtual void AfterEachResolution(void);
148  virtual void AfterEachIteration(void);
149  virtual void AfterRegistration(void);
150 
151  itkGetConstMacro(StartLineSearch, bool);
152 
153 
154  protected:
155 
157  virtual ~ConjugateGradient() {};
158 
160 
162  virtual std::string GetLineSearchStopCondition(void) const;
163 
166  virtual std::string DeterminePhase(void) const;
167 
171  virtual bool TestConvergence( bool firstLineSearchDone );
172 
177  virtual void LineSearch(
178  const ParametersType searchDir,
179  double & step,
180  ParametersType & x,
181  MeasureType & f,
182  DerivativeType & g );
183 
184  private:
185 
186  ConjugateGradient( const Self& ); // purposely not implemented
187  void operator=( const Self& ); // purposely not implemented
188 
189  void InvokeIterationEvent(const itk::EventObject & event);
190 
197 
198  }; // end class ConjugateGradient
199 
200 
201 } // end namespace elastix
202 
203 #ifndef ITK_MANUAL_INSTANTIATION
204 #include "elxConjugateGradient.hxx"
205 #endif
206 
207 #endif // end #ifndef __elxConjugateGradient_h
208 
Superclass1::CostFunctionType CostFunctionType
Superclass::RegistrationPointer RegistrationPointer
OptimizerBase< TElastix > Superclass2
itk::SmartPointer< const Self > ConstPointer
itk::MoreThuenteLineSearchOptimizer LineOptimizerType
LineOptimizerType::Pointer LineOptimizerPointer
EventPassThroughType::Pointer EventPassThroughPointer
elxClassNameMacro("ConjugateGradient")
This class is the elastix base class for all Optimizers.
Superclass::ElastixType ElastixType
virtual void LineSearch(const ParametersType searchDir, double &step, ParametersType &x, MeasureType &f, DerivativeType &g)
Superclass::ConfigurationPointer ConfigurationPointer
Superclass1::DerivativeType DerivativeType
virtual std::string GetLineSearchStopCondition(void) const
ITK version of the MoreThuente line search algorithm.
void operator=(const Self &)
Superclass::ElastixPointer ElastixPointer
virtual void AfterEachIteration(void)
virtual std::string DeterminePhase(void) const
Superclass2::ElastixType ElastixType
Superclass::ConfigurationType ConfigurationType
Superclass1::StopConditionType StopConditionType
Superclass2::RegistrationPointer RegistrationPointer
Superclass2::RegistrationType RegistrationType
virtual void BeforeRegistration(void)
LineOptimizerPointer m_LineOptimizer
Superclass1::ScalesType ScalesType
itk::Optimizer ITKBaseType
virtual void AfterRegistration(void)
EventPassThroughPointer m_EventPasser
Superclass2::ElastixPointer ElastixPointer
virtual bool TestConvergence(bool firstLineSearchDone)
Superclass2::ConfigurationPointer ConfigurationPointer
virtual void BeforeEachResolution(void)
An optimizer based on the itk::GenericConjugateGradientOptimizer.
Superclass2::ITKBaseType ITKBaseType
Superclass1::CostFunctionPointer CostFunctionPointer
Superclass::RegistrationType RegistrationType
virtual void StartOptimization(void)
itk::SmartPointer< Self > Pointer
itk::ReceptorMemberCommand< Self > EventPassThroughType
Superclass2::ConfigurationType ConfigurationType
GenericConjugateGradientOptimizer Superclass1
Superclass1::ParametersType ParametersType
void InvokeIterationEvent(const itk::EventObject &event)
virtual void AfterEachResolution(void)


Generated on 05-01-2014 for elastix by doxygen 1.8.5 elastix logo