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  * 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 __elxConjugateGradient_h
19 #define __elxConjugateGradient_h
20 
21 #include "elxIncludes.h" // include first to avoid MSVS warning
24 
25 namespace elastix
26 {
27 
90 template< class TElastix >
92  public
94  public
95  OptimizerBase< TElastix >
96 {
97 public:
98 
103  typedef itk::SmartPointer< Self > Pointer;
104  typedef itk::SmartPointer< const Self > ConstPointer;
105 
107  itkNewMacro( Self );
108 
111 
116  elxClassNameMacro( "ConjugateGradient" );
117 
120  typedef Superclass1::CostFunctionPointer CostFunctionPointer;
125 
134 
138  typedef itk::ReceptorMemberCommand< Self > EventPassThroughType;
139  typedef typename EventPassThroughType::Pointer EventPassThroughPointer;
140 
143  virtual void StartOptimization( void );
144 
147  virtual void BeforeRegistration( void );
148 
149  virtual void BeforeEachResolution( void );
150 
151  virtual void AfterEachResolution( void );
152 
153  virtual void AfterEachIteration( void );
154 
155  virtual void AfterRegistration( void );
156 
157  itkGetConstMacro( StartLineSearch, bool );
158 
159 protected:
160 
162  virtual ~ConjugateGradient() {}
163 
164  LineOptimizerPointer m_LineOptimizer;
165 
167  virtual std::string GetLineSearchStopCondition( void ) const;
168 
171  virtual std::string DeterminePhase( void ) const;
172 
176  virtual bool TestConvergence( bool firstLineSearchDone );
177 
182  virtual void LineSearch(
183  const ParametersType searchDir,
184  double & step,
185  ParametersType & x,
186  MeasureType & f,
187  DerivativeType & g );
188 
189 private:
190 
191  ConjugateGradient( const Self & ); // purposely not implemented
192  void operator=( const Self & ); // purposely not implemented
193 
194  void InvokeIterationEvent( const itk::EventObject & event );
195 
196  EventPassThroughPointer m_EventPasser;
202 
203 };
204 
205 } // end namespace elastix
206 
207 #ifndef ITK_MANUAL_INSTANTIATION
208 #include "elxConjugateGradient.hxx"
209 #endif
210 
211 #endif // end #ifndef __elxConjugateGradient_h
Superclass1::CostFunctionType CostFunctionType
itk::SmartPointer< Self > Pointer
Superclass::RegistrationPointer RegistrationPointer
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
itk::ReceptorMemberCommand< Self > EventPassThroughType
Superclass2::RegistrationPointer RegistrationPointer
Superclass2::RegistrationType RegistrationType
OptimizerBase< TElastix > Superclass2
itk::SmartPointer< const Self > ConstPointer
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)
Superclass2::ConfigurationType ConfigurationType
GenericConjugateGradientOptimizer Superclass1
Superclass1::ParametersType ParametersType
void InvokeIterationEvent(const itk::EventObject &event)
virtual void AfterEachResolution(void)


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