Loading...
Searching...
No Matches
itkRSGDEachParameterApartBaseOptimizer.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 itkRSGDEachParameterApartBaseOptimizer_h
#define itkRSGDEachParameterApartBaseOptimizer_h
#include "itkSingleValuedNonLinearOptimizer.h"
namespace itk
{
class RSGDEachParameterApartBaseOptimizer : public SingleValuedNonLinearOptimizer
{
public:
ITK_DISALLOW_COPY_AND_MOVE(RSGDEachParameterApartBaseOptimizer);
using Self = RSGDEachParameterApartBaseOptimizer;
using Superclass = SingleValuedNonLinearOptimizer;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;
itkNewMacro(Self);
itkTypeMacro(RSGDEachParameterApartBaseOptimizer, SingleValuedNonLinearOptimizer);
enum StopConditionType
{
GradientMagnitudeTolerance = 1,
StepTooSmall,
ImageNotAvailable,
SamplesNotAvailable,
MaximumNumberOfIterations,
MetricError
};
itkSetMacro(Maximize, bool);
itkGetConstMacro(Maximize, bool);
itkBooleanMacro(Maximize);
bool
GetMinimize() const
{
return !m_Maximize;
}
void
SetMinimize(bool v)
{
this->SetMaximize(!v);
}
void
MinimizeOn()
{
SetMaximize(false);
}
void
MinimizeOff()
{
SetMaximize(true);
}
void
StartOptimization() override;
void
ResumeOptimization();
void
StopOptimization();
itkSetMacro(MaximumStepLength, double);
itkSetMacro(MinimumStepLength, double);
itkSetMacro(NumberOfIterations, unsigned long);
itkSetMacro(GradientMagnitudeTolerance, double);
itkGetConstMacro(MaximumStepLength, double);
itkGetConstMacro(MinimumStepLength, double);
itkGetConstMacro(NumberOfIterations, unsigned long);
itkGetConstMacro(GradientMagnitudeTolerance, double);
itkGetConstMacro(CurrentIteration, unsigned long);
itkGetConstMacro(StopCondition, StopConditionType);
itkGetConstMacro(Value, MeasureType);
itkGetConstReferenceMacro(Gradient, DerivativeType);
itkGetConstReferenceMacro(CurrentStepLengths, DerivativeType);
itkGetConstMacro(CurrentStepLength, double);
itkGetConstMacro(GradientMagnitude, double);
protected:
RSGDEachParameterApartBaseOptimizer();
~RSGDEachParameterApartBaseOptimizer() override = default;
void
PrintSelf(std::ostream & os, Indent indent) const override;
virtual void
AdvanceOneStep();
virtual void
StepAlongGradient(const DerivativeType &, const DerivativeType &)
{
ExceptionObject ex;
ex.SetLocation(__FILE__);
ex.SetDescription("This method MUST be overloaded in derived classes");
throw ex;
}
private:
DerivativeType m_Gradient{};
DerivativeType m_PreviousGradient{};
bool m_Stop{ false };
bool m_Maximize{ false };
MeasureType m_Value{ 0.0 };
double m_GradientMagnitudeTolerance{ 1e-4 };
double m_MaximumStepLength{ 1.0 };
double m_MinimumStepLength{ 1e-3 };
DerivativeType m_CurrentStepLengths{};
double m_CurrentStepLength{ 0 };
StopConditionType m_StopCondition{ MaximumNumberOfIterations };
unsigned long m_NumberOfIterations{ 100 };
unsigned long m_CurrentIteration{ 0 };
double m_GradientMagnitude{ 0.0 };
};
} // end namespace itk
#endif // end #ifndef itkRSGDEachParameterApartBaseOptimizer_h
SingleValuedNonLinearOptimizer
itk::RSGDEachParameterApartBaseOptimizer::m_CurrentIteration
unsigned long m_CurrentIteration
Definition itkRSGDEachParameterApartBaseOptimizer.h:176
itk::RSGDEachParameterApartBaseOptimizer::Superclass
SingleValuedNonLinearOptimizer Superclass
Definition itkRSGDEachParameterApartBaseOptimizer.h:43
itk::RSGDEachParameterApartBaseOptimizer::m_MaximumStepLength
double m_MaximumStepLength
Definition itkRSGDEachParameterApartBaseOptimizer.h:166
itk::RSGDEachParameterApartBaseOptimizer::ConstPointer
SmartPointer< const Self > ConstPointer
Definition itkRSGDEachParameterApartBaseOptimizer.h:45
itk::RSGDEachParameterApartBaseOptimizer::m_GradientMagnitude
double m_GradientMagnitude
Definition itkRSGDEachParameterApartBaseOptimizer.h:178
itk::RSGDEachParameterApartBaseOptimizer::SetMaximize
virtual void SetMaximize(bool _arg)
itk::RSGDEachParameterApartBaseOptimizer::m_CurrentStepLengths
DerivativeType m_CurrentStepLengths
Definition itkRSGDEachParameterApartBaseOptimizer.h:170
itk::RSGDEachParameterApartBaseOptimizer::MinimizeOn
void MinimizeOn()
Definition itkRSGDEachParameterApartBaseOptimizer.h:79
itk::RSGDEachParameterApartBaseOptimizer::StartOptimization
void StartOptimization() override
itk::RSGDEachParameterApartBaseOptimizer::Pointer
SmartPointer< Self > Pointer
Definition itkRSGDEachParameterApartBaseOptimizer.h:44
itk::RSGDEachParameterApartBaseOptimizer::m_MinimumStepLength
double m_MinimumStepLength
Definition itkRSGDEachParameterApartBaseOptimizer.h:167
itk::RSGDEachParameterApartBaseOptimizer::ITK_DISALLOW_COPY_AND_MOVE
ITK_DISALLOW_COPY_AND_MOVE(RSGDEachParameterApartBaseOptimizer)
itk::RSGDEachParameterApartBaseOptimizer::m_GradientMagnitudeTolerance
double m_GradientMagnitudeTolerance
Definition itkRSGDEachParameterApartBaseOptimizer.h:165
itk::RSGDEachParameterApartBaseOptimizer::m_PreviousGradient
DerivativeType m_PreviousGradient
Definition itkRSGDEachParameterApartBaseOptimizer.h:160
itk::RSGDEachParameterApartBaseOptimizer::m_Stop
bool m_Stop
Definition itkRSGDEachParameterApartBaseOptimizer.h:162
itk::RSGDEachParameterApartBaseOptimizer::~RSGDEachParameterApartBaseOptimizer
~RSGDEachParameterApartBaseOptimizer() override=default
itk::RSGDEachParameterApartBaseOptimizer::m_StopCondition
StopConditionType m_StopCondition
Definition itkRSGDEachParameterApartBaseOptimizer.h:174
itk::RSGDEachParameterApartBaseOptimizer::AdvanceOneStep
virtual void AdvanceOneStep()
itk::RSGDEachParameterApartBaseOptimizer::StepAlongGradient
virtual void StepAlongGradient(const DerivativeType &, const DerivativeType &)
Definition itkRSGDEachParameterApartBaseOptimizer.h:149
itk::RSGDEachParameterApartBaseOptimizer::GetMinimize
bool GetMinimize() const
Definition itkRSGDEachParameterApartBaseOptimizer.h:69
itk::RSGDEachParameterApartBaseOptimizer::StopOptimization
void StopOptimization()
itk::RSGDEachParameterApartBaseOptimizer::StopConditionType
StopConditionType
Definition itkRSGDEachParameterApartBaseOptimizer.h:55
itk::RSGDEachParameterApartBaseOptimizer::ImageNotAvailable
@ ImageNotAvailable
Definition itkRSGDEachParameterApartBaseOptimizer.h:58
itk::RSGDEachParameterApartBaseOptimizer::SamplesNotAvailable
@ SamplesNotAvailable
Definition itkRSGDEachParameterApartBaseOptimizer.h:59
itk::RSGDEachParameterApartBaseOptimizer::MetricError
@ MetricError
Definition itkRSGDEachParameterApartBaseOptimizer.h:61
itk::RSGDEachParameterApartBaseOptimizer::GradientMagnitudeTolerance
@ GradientMagnitudeTolerance
Definition itkRSGDEachParameterApartBaseOptimizer.h:56
itk::RSGDEachParameterApartBaseOptimizer::MaximumNumberOfIterations
@ MaximumNumberOfIterations
Definition itkRSGDEachParameterApartBaseOptimizer.h:60
itk::RSGDEachParameterApartBaseOptimizer::StepTooSmall
@ StepTooSmall
Definition itkRSGDEachParameterApartBaseOptimizer.h:57
itk::RSGDEachParameterApartBaseOptimizer::ResumeOptimization
void ResumeOptimization()
itk::RSGDEachParameterApartBaseOptimizer::m_Maximize
bool m_Maximize
Definition itkRSGDEachParameterApartBaseOptimizer.h:163
itk::RSGDEachParameterApartBaseOptimizer::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
itk::RSGDEachParameterApartBaseOptimizer::m_Value
MeasureType m_Value
Definition itkRSGDEachParameterApartBaseOptimizer.h:164
itk::RSGDEachParameterApartBaseOptimizer::MinimizeOff
void MinimizeOff()
Definition itkRSGDEachParameterApartBaseOptimizer.h:84
itk::RSGDEachParameterApartBaseOptimizer::m_CurrentStepLength
double m_CurrentStepLength
Definition itkRSGDEachParameterApartBaseOptimizer.h:172
itk::RSGDEachParameterApartBaseOptimizer::RSGDEachParameterApartBaseOptimizer
RSGDEachParameterApartBaseOptimizer()
itk::RSGDEachParameterApartBaseOptimizer::Self
RSGDEachParameterApartBaseOptimizer Self
Definition itkRSGDEachParameterApartBaseOptimizer.h:42
itk::RSGDEachParameterApartBaseOptimizer::m_Gradient
DerivativeType m_Gradient
Definition itkRSGDEachParameterApartBaseOptimizer.h:159
itk::RSGDEachParameterApartBaseOptimizer::SetMinimize
void SetMinimize(bool v)
Definition itkRSGDEachParameterApartBaseOptimizer.h:74
itk::RSGDEachParameterApartBaseOptimizer::m_NumberOfIterations
unsigned long m_NumberOfIterations
Definition itkRSGDEachParameterApartBaseOptimizer.h:175
itk
Definition itkAdvancedImageToImageMetric.h:43

Generated on 1768596610 for elastix by 1.15.0 |