ITK  6.0.0
Insight Toolkit
itkExhaustiveOptimizerv4.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 itkExhaustiveOptimizerv4_h
19#define itkExhaustiveOptimizerv4_h
20
21#include "itkIntTypes.h"
23
24namespace itk
25{
83template <typename TInternalComputationValueType>
84class ITK_TEMPLATE_EXPORT ExhaustiveOptimizerv4
85 : public ObjectToObjectOptimizerBaseTemplate<TInternalComputationValueType>
86{
87public:
88 ITK_DISALLOW_COPY_AND_MOVE(ExhaustiveOptimizerv4);
96
98 itkNewMacro(Self);
99
101 itkOverrideGetNameOfClassMacro(ExhaustiveOptimizerv4);
102
105
107 using typename Superclass::MeasureType;
108
110 using typename Superclass::ParametersType;
111
113 using typename Superclass::ScalesType;
114
115 void
116 StartOptimization(bool doOnlyInitialization = false) override;
117
119 void
121
123 void
125
127 void
129
130 itkSetMacro(StepLength, double);
131 itkSetMacro(NumberOfSteps, StepsType);
132 itkGetConstReferenceMacro(StepLength, double);
133 itkGetConstReferenceMacro(NumberOfSteps, StepsType);
134 itkGetConstReferenceMacro(CurrentValue, MeasureType);
135 itkGetConstReferenceMacro(MaximumMetricValue, MeasureType);
136 itkGetConstReferenceMacro(MinimumMetricValue, MeasureType);
137 itkGetConstReferenceMacro(MinimumMetricValuePosition, ParametersType);
138 itkGetConstReferenceMacro(MaximumMetricValuePosition, ParametersType);
139 itkGetConstReferenceMacro(CurrentIndex, ParametersType);
140
142 std::string
144
146 void
148
152 {
153 return m_InitialPosition;
154 }
155
156protected:
158 ~ExhaustiveOptimizerv4() override = default;
159 void
160 PrintSelf(std::ostream & os, Indent indent) const override;
161
163 void
165
166 void
168
169protected:
170 ParametersType m_InitialPosition{};
171 MeasureType m_CurrentValue{ 0 };
172 StepsType m_NumberOfSteps{ 0 };
173 bool m_Stop{ false };
174 double m_StepLength{ 1.0 };
175 ParametersType m_CurrentIndex{ 0 };
176 MeasureType m_MaximumMetricValue{ 0.0 };
177 MeasureType m_MinimumMetricValue{ 0.0 };
178 ParametersType m_MinimumMetricValuePosition{};
179 ParametersType m_MaximumMetricValuePosition{};
180
181private:
182 std::ostringstream m_StopConditionDescription{ "" };
183};
184} // end namespace itk
185
186#ifndef ITK_MANUAL_INSTANTIATION
187# include "itkExhaustiveOptimizerv4.hxx"
188#endif
189
190#endif
Optimizer that fully samples a grid on the parametric space.
void SetInitialPosition(const ParametersType &param)
std::string GetStopConditionDescription() const override
void StartOptimization(bool doOnlyInitialization=false) override
~ExhaustiveOptimizerv4() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
void IncrementIndex(ParametersType &newPosition)
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Abstract base for object-to-object optimizers.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....