Loading...
Searching...
No Matches
elxConjugateGradientFRPR.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 elxConjugateGradientFRPR_h
#define elxConjugateGradientFRPR_h
#include "elxIncludes.h" // include first to avoid MSVS warning
#include "itkFRPROptimizer.h"
namespace elastix
{
template <class TElastix>
class ITK_TEMPLATE_EXPORT ConjugateGradientFRPR
: public itk::FRPROptimizer
, public OptimizerBase<TElastix>
{
public:
ITK_DISALLOW_COPY_AND_MOVE(ConjugateGradientFRPR);
using Self = ConjugateGradientFRPR;
using Superclass1 = itk::FRPROptimizer;
using Superclass2 = OptimizerBase<TElastix>;
using Pointer = itk::SmartPointer<Self>;
using ConstPointer = itk::SmartPointer<const Self>;
itkNewMacro(Self);
itkTypeMacro(ConjugateGradientFRPR, itk::FRPROptimizer);
elxClassNameMacro("ConjugateGradientFRPR");
using Superclass1::CostFunctionType;
using Superclass1::CostFunctionPointer;
// using Superclass1::StopConditionType; not implemented in this itkOptimizer
using typename Superclass1::ParametersType;
// not declared in Superclass, although it should be.
using DerivativeType = SingleValuedNonLinearOptimizer::DerivativeType;
using typename Superclass2::ElastixType;
using typename Superclass2::RegistrationType;
using ITKBaseType = typename Superclass2::ITKBaseType;
void
BeforeRegistration() override;
void
BeforeEachResolution() override;
void
AfterEachResolution() override;
void
AfterEachIteration() override;
void
AfterRegistration() override;
void
SetInitialPosition(const ParametersType & param) override;
itkGetConstMacro(LineOptimizing, bool);
itkGetConstMacro(LineBracketing, bool);
itkGetConstReferenceMacro(CurrentDerivativeMagnitude, double);
itkGetConstReferenceMacro(CurrentStepLength, double);
itkGetConstReferenceMacro(CurrentSearchDirectionMagnitude, double);
protected:
ConjugateGradientFRPR();
~ConjugateGradientFRPR() override = default;
double m_CurrentDerivativeMagnitude;
double m_CurrentSearchDirectionMagnitude;
double m_CurrentStepLength;
itkSetMacro(LineOptimizing, bool);
itkSetMacro(LineBracketing, bool);
void
GetValueAndDerivative(ParametersType & p, double * val, ParametersType * xi) override;
void
LineBracket(double * ax, double * bx, double * cx, double * fa, double * fb, double * fc, ParametersType & tempCoord)
override;
void
BracketedLineOptimize(double ax,
double bx,
double cx,
double fa,
double fb,
double fc,
double * extX,
double * extVal,
ParametersType & tempCoord) override;
void
LineOptimize(ParametersType * p, ParametersType & xi, double * val, ParametersType & tempCoord) override;
private:
elxOverrideGetSelfMacro;
bool m_LineOptimizing;
bool m_LineBracketing;
const char *
DeterminePhase() const;
// Private using-declarations, to avoid accidentally calling the wrong overload of those member functions, and to
// avoid `-Woverloaded-virtual` warnings from GCC (GCC 11.4) or clang (macos-12).
using itk::PowellOptimizer::LineBracket;
using itk::PowellOptimizer::BracketedLineOptimize;
using itk::FRPROptimizer::LineOptimize;
};
} // end namespace elastix
#ifndef ITK_MANUAL_INSTANTIATION
# include "elxConjugateGradientFRPR.hxx"
#endif
#endif // end #ifndef elxConjugateGradientFRPR_h
elastix::ConjugateGradientFRPR::GetValueAndDerivative
void GetValueAndDerivative(ParametersType &p, double *val, ParametersType *xi) override
elastix::ConjugateGradientFRPR::m_LineBracketing
bool m_LineBracketing
Definition elxConjugateGradientFRPR.h:218
elastix::ConjugateGradientFRPR::Superclass1
itk::FRPROptimizer Superclass1
Definition elxConjugateGradientFRPR.h:83
elastix::ConjugateGradientFRPR::BeforeRegistration
void BeforeRegistration() override
elastix::ConjugateGradientFRPR::ITK_DISALLOW_COPY_AND_MOVE
ITK_DISALLOW_COPY_AND_MOVE(ConjugateGradientFRPR)
elastix::ConjugateGradientFRPR::AfterEachResolution
void AfterEachResolution() override
elastix::ConjugateGradientFRPR::Superclass2
OptimizerBase< TElastix > Superclass2
Definition elxConjugateGradientFRPR.h:84
elastix::ConjugateGradientFRPR::LineBracket
void LineBracket(double *ax, double *bx, double *cx, double *fa, double *fb, double *fc, ParametersType &tempCoord) override
elastix::ConjugateGradientFRPR::Self
ConjugateGradientFRPR Self
Definition elxConjugateGradientFRPR.h:82
elastix::ConjugateGradientFRPR::AfterEachIteration
void AfterEachIteration() override
elastix::ConjugateGradientFRPR::LineOptimize
void LineOptimize(ParametersType *p, ParametersType &xi, double *val, ParametersType &tempCoord) override
elastix::ConjugateGradientFRPR::ITKBaseType
typename Superclass2::ITKBaseType ITKBaseType
Definition elxConjugateGradientFRPR.h:108
elastix::ConjugateGradientFRPR::m_CurrentStepLength
double m_CurrentStepLength
Definition elxConjugateGradientFRPR.h:156
elastix::ConjugateGradientFRPR::DeterminePhase
const char * DeterminePhase() const
elastix::ConjugateGradientFRPR::m_CurrentDerivativeMagnitude
double m_CurrentDerivativeMagnitude
Definition elxConjugateGradientFRPR.h:150
elastix::ConjugateGradientFRPR::elxClassNameMacro
elxClassNameMacro("ConjugateGradientFRPR")
elastix::ConjugateGradientFRPR::ConjugateGradientFRPR
ConjugateGradientFRPR()
elastix::ConjugateGradientFRPR::BracketedLineOptimize
void BracketedLineOptimize(double ax, double bx, double cx, double fa, double fb, double fc, double *extX, double *extVal, ParametersType &tempCoord) override
elastix::ConjugateGradientFRPR::m_CurrentSearchDirectionMagnitude
double m_CurrentSearchDirectionMagnitude
Definition elxConjugateGradientFRPR.h:153
elastix::ConjugateGradientFRPR::BeforeEachResolution
void BeforeEachResolution() override
elastix::ConjugateGradientFRPR::~ConjugateGradientFRPR
~ConjugateGradientFRPR() override=default
elastix::ConjugateGradientFRPR::AfterRegistration
void AfterRegistration() override
elastix::ConjugateGradientFRPR::elxOverrideGetSelfMacro
elxOverrideGetSelfMacro
Definition elxConjugateGradientFRPR.h:215
elastix::ConjugateGradientFRPR::Pointer
itk::SmartPointer< Self > Pointer
Definition elxConjugateGradientFRPR.h:85
elastix::ConjugateGradientFRPR::SetInitialPosition
void SetInitialPosition(const ParametersType &param) override
elastix::ConjugateGradientFRPR::m_LineOptimizing
bool m_LineOptimizing
Definition elxConjugateGradientFRPR.h:217
elastix::ConjugateGradientFRPR::DerivativeType
SingleValuedNonLinearOptimizer::DerivativeType DerivativeType
Definition elxConjugateGradientFRPR.h:103
elastix::ConjugateGradientFRPR::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition elxConjugateGradientFRPR.h:86
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
elxIncludes.h
elastix
Definition elxDefaultConstruct.h:25

Generated on 1768596610 for elastix by 1.15.0 |