ITK  6.0.0
Insight Toolkit
itkMultipleValuedNonLinearVnlOptimizer.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 itkMultipleValuedNonLinearVnlOptimizer_h
19#define itkMultipleValuedNonLinearVnlOptimizer_h
20
23#include "itkCommand.h"
24#include "ITKOptimizersExport.h"
25
26#include <memory> // For unique_ptr.
27
28namespace itk
29{
40{
41public:
42 ITK_DISALLOW_COPY_AND_MOVE(MultipleValuedNonLinearVnlOptimizer);
43
49
51 itkOverrideGetNameOfClassMacro(MultipleValuedNonLinearVnlOptimizer);
52
55 using ParametersType = Superclass::ParametersType;
56
63 void
64 SetCostFunction(MultipleValuedCostFunction * costFunction) override = 0;
65
69 void
71
72 void
74 {
75 this->SetUseCostFunctionGradient(true);
76 }
77
78 void
80 {
81 this->SetUseCostFunctionGradient(false);
82 }
83
84 bool
86
93 itkGetConstReferenceMacro(CachedValue, MeasureType);
94 itkGetConstReferenceMacro(CachedDerivative, DerivativeType);
95 itkGetConstReferenceMacro(CachedCurrentPosition, ParametersType);
98protected:
101
102 void
103 PrintSelf(std::ostream & os, Indent indent) const override;
104
106
107 void
109
112
115
120
126
127private:
129 void
131
132 std::unique_ptr<CostFunctionAdaptorType> m_CostFunctionAdaptor;
133 bool m_UseGradient{};
134
136
137 mutable ParametersType m_CachedCurrentPosition{};
138 mutable MeasureType m_CachedValue{};
139 mutable DerivativeType m_CachedDerivative{};
140};
141} // end namespace itk
142
143#endif
Array2D class representing a 2D array.
Definition: itkArray2D.h:43
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.
This class is a base for the CostFunctions returning a multiple values.
This class is a base for the Optimization methods that optimize a multiple valued function.
This class is a base for the Optimization methods that optimize a multi-valued function.
const CostFunctionAdaptorType * GetCostFunctionAdaptor() const
void PrintSelf(std::ostream &os, Indent indent) const override
void SetCostFunction(MultipleValuedCostFunction *costFunction) override=0
std::unique_ptr< CostFunctionAdaptorType > m_CostFunctionAdaptor
void IterationReport(const EventObject &event)
CostFunctionAdaptorType * GetCostFunctionAdaptor()
CostFunctionAdaptorType * GetNonConstCostFunctionAdaptor() const
void SetCostFunctionAdaptor(CostFunctionAdaptorType *adaptor)
This class is an Adaptor that allows to pass itk::MultipleValuedCostFunctions to vnl_optimizers expec...
A Command subclass that calls a pointer to a member function.
Definition: itkCommand.h:165
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....