ITK  5.4.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
26namespace itk
27{
38{
39public:
40 ITK_DISALLOW_COPY_AND_MOVE(MultipleValuedNonLinearVnlOptimizer);
41
47
49 itkOverrideGetNameOfClassMacro(MultipleValuedNonLinearVnlOptimizer);
50
53 using ParametersType = Superclass::ParametersType;
54
61 void
62 SetCostFunction(MultipleValuedCostFunction * costFunction) override = 0;
63
67 void
69
70 void
72 {
73 this->SetUseCostFunctionGradient(true);
74 }
75
76 void
78 {
79 this->SetUseCostFunctionGradient(false);
80 }
81
82 bool
84
91 itkGetConstReferenceMacro(CachedValue, MeasureType);
92 itkGetConstReferenceMacro(CachedDerivative, DerivativeType);
93 itkGetConstReferenceMacro(CachedCurrentPosition, ParametersType);
96protected:
99
100 void
101 PrintSelf(std::ostream & os, Indent indent) const override;
102
104
105 void
107
110
113
118
124
125private:
127 void
129
130 CostFunctionAdaptorType * m_CostFunctionAdaptor{};
131 bool m_UseGradient{};
132
134
135 mutable ParametersType m_CachedCurrentPosition{};
136 mutable MeasureType m_CachedValue{};
137 mutable DerivativeType m_CachedDerivative{};
138};
139} // end namespace itk
140
141#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
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....