go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
elxQuasiNewtonLBFGS.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright UMC Utrecht and contributors
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __elxQuasiNewtonLBFGS_h
19 #define __elxQuasiNewtonLBFGS_h
20 
21 #include "elxIncludes.h" // include first to avoid MSVS warning
24 
25 namespace elastix
26 {
27 
87 template< class TElastix >
89  public
91  public
92  OptimizerBase< TElastix >
93 {
94 public:
95 
100  typedef itk::SmartPointer< Self > Pointer;
101  typedef itk::SmartPointer< const Self > ConstPointer;
102 
104  itkNewMacro( Self );
105 
108 
113  elxClassNameMacro( "QuasiNewtonLBFGS" );
114 
117  typedef Superclass1::CostFunctionPointer CostFunctionPointer;
122 
131 
135  typedef itk::ReceptorMemberCommand< Self > EventPassThroughType;
136  typedef typename EventPassThroughType::Pointer EventPassThroughPointer;
137 
140  virtual void StartOptimization( void );
141 
144  virtual void BeforeRegistration( void );
145 
146  virtual void BeforeEachResolution( void );
147 
148  virtual void AfterEachResolution( void );
149 
150  virtual void AfterEachIteration( void );
151 
152  virtual void AfterRegistration( void );
153 
154  itkGetConstMacro( StartLineSearch, bool );
155 
156 protected:
157 
159  virtual ~QuasiNewtonLBFGS() {}
160 
161  LineOptimizerPointer m_LineOptimizer;
162 
164  virtual std::string GetLineSearchStopCondition( void ) const;
165 
168  virtual std::string DeterminePhase( void ) const;
169 
173  virtual bool TestConvergence( bool firstLineSearchDone );
174 
179  virtual void LineSearch(
180  const ParametersType searchDir,
181  double & step,
182  ParametersType & x,
183  MeasureType & f,
184  DerivativeType & g );
185 
186 private:
187 
188  QuasiNewtonLBFGS( const Self & ); // purposely not implemented
189  void operator=( const Self & ); // purposely not implemented
190 
191  void InvokeIterationEvent( const itk::EventObject & event );
192 
193  EventPassThroughPointer m_EventPasser;
199 
200 };
201 
202 } // end namespace elastix
203 
204 #ifndef ITK_MANUAL_INSTANTIATION
205 #include "elxQuasiNewtonLBFGS.hxx"
206 #endif
207 
208 #endif // end #ifndef __elxQuasiNewtonLBFGS_h
OptimizerBase< TElastix > Superclass2
Superclass::RegistrationPointer RegistrationPointer
Superclass::ParametersType ParametersType
virtual void StartOptimization(void)
virtual void AfterEachIteration(void)
Superclass::DerivativeType DerivativeType
virtual void AfterEachResolution(void)
ITK version of the lbfgs algorithm ...
This class is the elastix base class for all Optimizers.
Superclass::CostFunctionType CostFunctionType
Superclass2::RegistrationType RegistrationType
Superclass::ElastixType ElastixType
Superclass::ConfigurationPointer ConfigurationPointer
void InvokeIterationEvent(const itk::EventObject &event)
ITK version of the MoreThuente line search algorithm.
virtual bool TestConvergence(bool firstLineSearchDone)
Superclass2::ElastixPointer ElastixPointer
virtual std::string GetLineSearchStopCondition(void) const
Superclass::ElastixPointer ElastixPointer
itk::SmartPointer< const Self > ConstPointer
virtual std::string DeterminePhase(void) const
Superclass::ConfigurationType ConfigurationType
itk::MoreThuenteLineSearchOptimizer LineOptimizerType
Superclass2::ConfigurationPointer ConfigurationPointer
LineOptimizerPointer m_LineOptimizer
Superclass1::ScalesType ScalesType
EventPassThroughPointer m_EventPasser
Superclass2::ConfigurationType ConfigurationType
Superclass1::CostFunctionPointer CostFunctionPointer
Superclass1::CostFunctionType CostFunctionType
Superclass1::ParametersType ParametersType
Superclass2::ITKBaseType ITKBaseType
itk::Optimizer ITKBaseType
void operator=(const Self &)
Superclass2::RegistrationPointer RegistrationPointer
virtual void BeforeEachResolution(void)
Superclass1::StopConditionType StopConditionType
itk::ReceptorMemberCommand< Self > EventPassThroughType
An optimizer based on the itk::QuasiNewtonLBFGSOptimizer.
elxClassNameMacro("QuasiNewtonLBFGS")
QuasiNewtonLBFGSOptimizer Superclass1
virtual void LineSearch(const ParametersType searchDir, double &step, ParametersType &x, MeasureType &f, DerivativeType &g)
virtual void AfterRegistration(void)
Superclass1::DerivativeType DerivativeType
Superclass::RegistrationType RegistrationType
EventPassThroughType::Pointer EventPassThroughPointer
LineOptimizerType::Pointer LineOptimizerPointer
virtual void BeforeRegistration(void)
itk::SmartPointer< Self > Pointer
Superclass2::ElastixType ElastixType


Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo