ITK  6.0.0
Insight Toolkit
itkSingleValuedNonLinearVnlOptimizerv4.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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 * https://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 itkSingleValuedNonLinearVnlOptimizerv4_h
19#define itkSingleValuedNonLinearVnlOptimizerv4_h
20
21#include "ITKOptimizersv4Export.h"
22
25#include "itkCommand.h"
26
27#include <memory> // For unique_ptr.
28
29namespace itk
30{
41{
42public:
43 ITK_DISALLOW_COPY_AND_MOVE(SingleValuedNonLinearVnlOptimizerv4);
44
50
52 itkOverrideGetNameOfClassMacro(SingleValuedNonLinearVnlOptimizerv4);
53
59
60 using MetricType = Superclass::MetricType;
61 using DerivativeType = Superclass::DerivativeType;
62 using ParametersType = Superclass::ParametersType;
63 using ScalesType = Superclass::ScalesType;
64
66 using StopConditionReturnStringType = Superclass::StopConditionReturnStringType;
67
69 using StopConditionDescriptionType = Superclass::StopConditionDescriptionType;
70
71 void
72 StartOptimization(bool doOnlyInitialization = false) override;
73
80 void
81 SetMetric(MetricType * metric) override = 0;
82
88 itkGetConstReferenceMacro(CachedDerivative, DerivativeType);
89 itkGetConstReferenceMacro(CachedCurrentPosition, ParametersType);
94 GetStopConditionDescription() const override = 0;
95
96protected:
99
101
102 void
104
107
110
115
117 void
118 PrintSelf(std::ostream & os, Indent indent) const override;
119
120private:
127 void
129
130 std::unique_ptr<CostFunctionAdaptorType> m_CostFunctionAdaptor;
131
133
134 mutable ParametersType m_CachedCurrentPosition{};
135 mutable DerivativeType m_CachedDerivative{};
136};
137} // end namespace itk
138
139#endif
Abstraction of the Events used to communicating among filters and with GUIs.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Abstract base for object-to-object optimizers.
A Command subclass that calls a pointer to a member function.
Definition: itkCommand.h:165
This is a base for the ITKv4 Optimization methods using the vnl library.
CostFunctionAdaptorType * GetNonConstCostFunctionAdaptor() const
void StartOptimization(bool doOnlyInitialization=false) override
std::unique_ptr< CostFunctionAdaptorType > m_CostFunctionAdaptor
void PrintSelf(std::ostream &os, Indent indent) const override
StopConditionReturnStringType GetStopConditionDescription() const override=0
const CostFunctionAdaptorType * GetCostFunctionAdaptor() const
void IterationReport(const EventObject &event)
CostFunctionAdaptorType * GetCostFunctionAdaptor()
void SetCostFunctionAdaptor(CostFunctionAdaptorType *adaptor)
Superclass::StopConditionReturnStringType StopConditionReturnStringType
void SetMetric(MetricType *metric) override=0
Superclass::StopConditionDescriptionType StopConditionDescriptionType
This class is an Adaptor that allows to pass itk::ObjectToObjectMetricBase objects to vnl_optimizers ...
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
ObjectToObjectOptimizerBaseTemplate< double > ObjectToObjectOptimizerBase