Loading...
Searching...
No Matches
elxConjugateGradient.h
Go to the documentation of this file.
/*=========================================================================
*
* Copyright UMC Utrecht and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef elxConjugateGradient_h
#define elxConjugateGradient_h
#include "elxIncludes.h" // include first to avoid MSVS warning
#include "itkGenericConjugateGradientOptimizer.h"
#include "itkMoreThuenteLineSearchOptimizer.h"
namespace elastix
{
template <class TElastix>
class ITK_TEMPLATE_EXPORT ConjugateGradient
: public itk::GenericConjugateGradientOptimizer
, public OptimizerBase<TElastix>
{
public:
ITK_DISALLOW_COPY_AND_MOVE(ConjugateGradient);
using Self = ConjugateGradient;
using Superclass1 = GenericConjugateGradientOptimizer;
using Superclass2 = OptimizerBase<TElastix>;
using Pointer = itk::SmartPointer<Self>;
using ConstPointer = itk::SmartPointer<const Self>;
itkNewMacro(Self);
itkTypeMacro(ConjugateGradient, GenericConjugateGradientOptimizer);
elxClassNameMacro("ConjugateGradient");
using Superclass1::CostFunctionType;
using Superclass1::CostFunctionPointer;
using Superclass1::StopConditionType;
using Superclass1::ParametersType;
using Superclass1::DerivativeType;
using Superclass1::ScalesType;
using typename Superclass2::ElastixType;
using typename Superclass2::RegistrationType;
using ITKBaseType = typename Superclass2::ITKBaseType;
using LineOptimizerType = itk::MoreThuenteLineSearchOptimizer;
using LineOptimizerPointer = LineOptimizerType::Pointer;
using EventPassThroughType = itk::ReceptorMemberCommand<Self>;
using EventPassThroughPointer = typename EventPassThroughType::Pointer;
void
StartOptimization() override;
void
BeforeRegistration() override;
void
BeforeEachResolution() override;
void
AfterEachResolution() override;
void
AfterEachIteration() override;
void
AfterRegistration() override;
itkGetConstMacro(StartLineSearch, bool);
protected:
ConjugateGradient();
~ConjugateGradient() override = default;
LineOptimizerPointer m_LineOptimizer;
virtual std::string
GetLineSearchStopCondition() const;
virtual std::string
DeterminePhase() const;
bool
TestConvergence(bool firstLineSearchDone) override;
void
LineSearch(const ParametersType searchDir, double & step, ParametersType & x, MeasureType & f, DerivativeType & g)
override;
private:
elxOverrideGetSelfMacro;
void
InvokeIterationEvent(const itk::EventObject & event);
EventPassThroughPointer m_EventPasser;
double m_SearchDirectionMagnitude;
bool m_StartLineSearch;
bool m_GenerateLineSearchIterations;
bool m_StopIfWolfeNotSatisfied;
bool m_WolfeIsStopCondition;
};
} // end namespace elastix
#ifndef ITK_MANUAL_INSTANTIATION
# include "elxConjugateGradient.hxx"
#endif
#endif // end #ifndef elxConjugateGradient_h
elastix::ConjugateGradient::ITKBaseType
typename Superclass2::ITKBaseType ITKBaseType
Definition elxConjugateGradient.h:128
elastix::ConjugateGradient::elxClassNameMacro
elxClassNameMacro("ConjugateGradient")
elastix::ConjugateGradient::Pointer
itk::SmartPointer< Self > Pointer
Definition elxConjugateGradient.h:102
elastix::ConjugateGradient::BeforeEachResolution
void BeforeEachResolution() override
elastix::ConjugateGradient::m_EventPasser
EventPassThroughPointer m_EventPasser
Definition elxConjugateGradient.h:195
elastix::ConjugateGradient::Superclass2
OptimizerBase< TElastix > Superclass2
Definition elxConjugateGradient.h:101
elastix::ConjugateGradient::~ConjugateGradient
~ConjugateGradient() override=default
elastix::ConjugateGradient::DeterminePhase
virtual std::string DeterminePhase() const
elastix::ConjugateGradient::AfterEachResolution
void AfterEachResolution() override
elastix::ConjugateGradient::m_StopIfWolfeNotSatisfied
bool m_StopIfWolfeNotSatisfied
Definition elxConjugateGradient.h:199
elastix::ConjugateGradient::StartOptimization
void StartOptimization() override
elastix::ConjugateGradient::EventPassThroughType
itk::ReceptorMemberCommand< Self > EventPassThroughType
Definition elxConjugateGradient.h:133
elastix::ConjugateGradient::TestConvergence
bool TestConvergence(bool firstLineSearchDone) override
elastix::ConjugateGradient::AfterEachIteration
void AfterEachIteration() override
elastix::ConjugateGradient::BeforeRegistration
void BeforeRegistration() override
elastix::ConjugateGradient::elxOverrideGetSelfMacro
elxOverrideGetSelfMacro
Definition elxConjugateGradient.h:190
elastix::ConjugateGradient::m_GenerateLineSearchIterations
bool m_GenerateLineSearchIterations
Definition elxConjugateGradient.h:198
elastix::ConjugateGradient::Self
ConjugateGradient Self
Definition elxConjugateGradient.h:99
elastix::ConjugateGradient::GetLineSearchStopCondition
virtual std::string GetLineSearchStopCondition() const
elastix::ConjugateGradient::AfterRegistration
void AfterRegistration() override
elastix::ConjugateGradient::ConjugateGradient
ConjugateGradient()
elastix::ConjugateGradient::m_WolfeIsStopCondition
bool m_WolfeIsStopCondition
Definition elxConjugateGradient.h:200
elastix::ConjugateGradient::m_StartLineSearch
bool m_StartLineSearch
Definition elxConjugateGradient.h:197
elastix::ConjugateGradient::LineSearch
void LineSearch(const ParametersType searchDir, double &step, ParametersType &x, MeasureType &f, DerivativeType &g) override
elastix::ConjugateGradient::m_LineOptimizer
LineOptimizerPointer m_LineOptimizer
Definition elxConjugateGradient.h:164
elastix::ConjugateGradient::m_SearchDirectionMagnitude
double m_SearchDirectionMagnitude
Definition elxConjugateGradient.h:196
elastix::ConjugateGradient::ITK_DISALLOW_COPY_AND_MOVE
ITK_DISALLOW_COPY_AND_MOVE(ConjugateGradient)
elastix::ConjugateGradient::LineOptimizerType
itk::MoreThuenteLineSearchOptimizer LineOptimizerType
Definition elxConjugateGradient.h:131
elastix::ConjugateGradient::EventPassThroughPointer
typename EventPassThroughType::Pointer EventPassThroughPointer
Definition elxConjugateGradient.h:134
elastix::ConjugateGradient::InvokeIterationEvent
void InvokeIterationEvent(const itk::EventObject &event)
elastix::ConjugateGradient::Superclass1
GenericConjugateGradientOptimizer Superclass1
Definition elxConjugateGradient.h:100
elastix::ConjugateGradient::LineOptimizerPointer
LineOptimizerType::Pointer LineOptimizerPointer
Definition elxConjugateGradient.h:132
elastix::ConjugateGradient::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition elxConjugateGradient.h:103
elastix::OptimizerBase::OptimizerBase
OptimizerBase()=default
elastix::OptimizerBase::RegistrationType
typename ElastixType::RegistrationBaseType RegistrationType
Definition elxBaseComponentSE.h:62
elastix::OptimizerBase::ElastixType
TElastix ElastixType
Definition elxBaseComponentSE.h:57
elastix::OptimizerBase::ITKBaseType
itk::Optimizer ITKBaseType
Definition elxOptimizerBase.h:70
elastix::OptimizerBase::ParametersType
typename ITKBaseType::ParametersType ParametersType
Definition elxOptimizerBase.h:73
itk::GenericConjugateGradientOptimizer
A set of conjugate gradient algorithms.
Definition itkGenericConjugateGradientOptimizer.h:41
itk::GenericConjugateGradientOptimizer::ScalesType
NonLinearOptimizer::ScalesType ScalesType
Definition itkScaledSingleValuedNonLinearOptimizer.h:85
itk::GenericConjugateGradientOptimizer::StopConditionType
StopConditionType
Definition itkGenericConjugateGradientOptimizer.h:72
itk::GenericConjugateGradientOptimizer::GenericConjugateGradientOptimizer
GenericConjugateGradientOptimizer()
itk::MoreThuenteLineSearchOptimizer
ITK version of the MoreThuente line search algorithm.
Definition itkMoreThuenteLineSearchOptimizer.h:72
itk::MoreThuenteLineSearchOptimizer::Pointer
SmartPointer< Self > Pointer
Definition itkMoreThuenteLineSearchOptimizer.h:78
elxIncludes.h
itkGenericConjugateGradientOptimizer.h
itkMoreThuenteLineSearchOptimizer.h
elastix
Definition elxDefaultConstruct.h:25

Generated on 1768596610 for elastix by 1.15.0 |