ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
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);
82
84 itkGetConstReferenceMacro(CurrentPosition, ParametersType);
85
87 virtual void
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.
111
112private:
116};
117} // end namespace itk
118
119#endif
Array class with size defined at construction time.
Definition itkArray.h:48
Control indentation during Print() invocation.
Definition itkIndent.h:50
Class to hold and manage different parameter types used during optimization.
ParametersType m_CurrentPosition
ScalesType m_Scales
ScalesType m_InverseScales
virtual void SetInitialPosition(const ParametersType &param)
virtual void StartOptimization()
Array< double > ScalesType
virtual std::string GetStopConditionDescription() const
~Optimizer() override=default
SmartPointer< Self > Pointer
ParametersType m_InitialPosition
virtual void SetCurrentPosition(const ParametersType &param)
SmartPointer< const Self > ConstPointer
void SetScales(const ScalesType &scales)
OptimizerParameters< double > ParametersType
void PrintSelf(std::ostream &os, Indent indent) const override
Optimizer Self
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....