ITK  6.0.0
Insight Toolkit
itkOptimizer.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 itkOptimizer_h
19#define itkOptimizer_h
20
21#include "itkObject.h"
22#include "itkObjectFactory.h"
23#include "itkArray.h"
25#include "ITKOptimizersExport.h"
26
27namespace itk
28{
38class ITKOptimizers_EXPORT Optimizer : public Object
39{
40public:
41 ITK_DISALLOW_COPY_AND_MOVE(Optimizer);
42
44 using Self = Optimizer;
48
50 itkNewMacro(Self);
51
53 itkOverrideGetNameOfClassMacro(Optimizer);
54
58
66
68 virtual void
70
72 itkGetConstReferenceMacro(InitialPosition, ParametersType);
73
75 void
76 SetScales(const ScalesType & scales);
77
79 itkGetConstReferenceMacro(Scales, ScalesType);
80 itkGetConstReferenceMacro(InverseScales, ScalesType);
84 itkGetConstReferenceMacro(CurrentPosition, ParametersType);
85
87 virtual void
89 {}
90
92 virtual std::string
94
95protected:
97 ~Optimizer() override = default;
98 void
99 PrintSelf(std::ostream & os, Indent indent) const override;
100
102 virtual void
104
105 bool m_ScalesInitialized{ false };
106
107 // Keep m_CurrentPosition as a protected var so that subclasses can
108 // have fast access. This is important when optimizing high-dimensional
109 // spaces, e.g. bspline transforms.
110 ParametersType m_CurrentPosition{};
111
112private:
113 ParametersType m_InitialPosition{};
114 ScalesType m_Scales{};
115 ScalesType m_InverseScales{};
116};
117} // end namespace itk
118
119#endif
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Base class for most ITK classes.
Definition: itkObject.h:62
Generic representation for an optimization method.
Definition: itkOptimizer.h:39
virtual void SetInitialPosition(const ParametersType &param)
virtual void StartOptimization()
Definition: itkOptimizer.h:88
virtual std::string GetStopConditionDescription() const
~Optimizer() override=default
virtual void SetCurrentPosition(const ParametersType &param)
void SetScales(const ScalesType &scales)
void PrintSelf(std::ostream &os, Indent indent) const override
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....