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 using namespace itk;
25 
26 
89  template <class TElastix>
91  public
93  public
94  OptimizerBase<TElastix>
95  {
96  public:
97 
102  typedef SmartPointer<Self> Pointer;
103  typedef SmartPointer<const Self> ConstPointer;
104 
106  itkNewMacro( Self );
107 
110 
115  elxClassNameMacro( "ConjugateGradient" );
116 
119  typedef Superclass1::CostFunctionPointer CostFunctionPointer;
124 
133 
137  typedef ReceptorMemberCommand<Self> EventPassThroughType;
138  typedef typename EventPassThroughType::Pointer EventPassThroughPointer;
139 
142  virtual void StartOptimization(void);
143 
146  virtual void BeforeRegistration(void);
147  virtual void BeforeEachResolution(void);
148  virtual void AfterEachResolution(void);
149  virtual void AfterEachIteration(void);
150  virtual void AfterRegistration(void);
151 
152  itkGetConstMacro(StartLineSearch, bool);
153 
154 
155  protected:
156 
158  virtual ~ConjugateGradient() {};
159 
160  LineOptimizerPointer m_LineOptimizer;
161 
163  virtual std::string GetLineSearchStopCondition(void) const;
164 
167  virtual std::string DeterminePhase(void) const;
168 
172  virtual bool TestConvergence( bool firstLineSearchDone );
173 
178  virtual void LineSearch(
179  const ParametersType searchDir,
180  double & step,
181  ParametersType & x,
182  MeasureType & f,
183  DerivativeType & g );
184 
185  private:
186 
187  ConjugateGradient( const Self& ); // purposely not implemented
188  void operator=( const Self& ); // purposely not implemented
189 
190  void InvokeIterationEvent(const EventObject & event);
191 
198 
199  }; // end class ConjugateGradient
200 
201 
202 } // end namespace elastix
203 
204 #ifndef ITK_MANUAL_INSTANTIATION
205 #include "elxConjugateGradient.hxx"
206 #endif
207 
208 #endif // end #ifndef __elxConjugateGradient_h
209 


Generated on 27-06-2013 for elastix by doxygen 1.8.3.1 elastix logo