ITK  6.0.0
Insight Toolkit
itkOnePlusOneEvolutionaryOptimizerv4.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 itkOnePlusOneEvolutionaryOptimizerv4_h
19#define itkOnePlusOneEvolutionaryOptimizerv4_h
20
23#include <string>
24
25namespace itk
26{
69template <typename TInternalComputationValueType>
70class ITK_TEMPLATE_EXPORT OnePlusOneEvolutionaryOptimizerv4
71 : public ObjectToObjectOptimizerBaseTemplate<TInternalComputationValueType>
72{
73public:
79
81 itkNewMacro(Self);
82
84 itkOverrideGetNameOfClassMacro(OnePlusOneEvolutionaryOptimizerv4);
85
89
92
94 using typename Superclass::MeasureType;
95
97 using typename Superclass::ParametersType;
98
100 using typename Superclass::ScalesType;
101
103 itkSetMacro(MaximumIteration, unsigned int);
104 itkGetConstReferenceMacro(MaximumIteration, unsigned int);
108 itkSetMacro(GrowthFactor, double);
109 itkGetConstReferenceMacro(GrowthFactor, double);
113 itkSetMacro(ShrinkFactor, double);
114 itkGetConstReferenceMacro(ShrinkFactor, double);
118 itkSetMacro(InitialRadius, double);
119 itkGetConstReferenceMacro(InitialRadius, double);
124 itkSetMacro(Epsilon, double);
125 itkGetConstReferenceMacro(Epsilon, double);
129 itkGetConstReferenceMacro(FrobeniusNorm, double);
130
131 void
133
140 void
141 Initialize(double initialRadius, double grow = -1, double shrink = -1);
142
144 itkGetConstReferenceMacro(CurrentCost, MeasureType);
145 const MeasureType &
146 GetValue() const override;
150 itkGetConstReferenceMacro(Initialized, bool);
151
155 void
156 StartOptimization(bool doOnlyInitialization = false) override;
157
161 void
163 {
164 m_Stop = true;
165 }
166
167 itkGetConstReferenceMacro(CatchGetValueException, bool);
168 itkSetMacro(CatchGetValueException, bool);
169 itkBooleanMacro(CatchGetValueException);
170
171 itkGetConstReferenceMacro(MetricWorstPossibleValue, double);
172 itkSetMacro(MetricWorstPossibleValue, double);
173
174 const std::string
176
177protected:
181 void
182 PrintSelf(std::ostream & os, Indent indent) const override;
183
184private:
187
189 unsigned int m_MaximumIteration{};
190
191 bool m_CatchGetValueException{};
192 double m_MetricWorstPossibleValue{};
193
196 double m_Epsilon{};
197
199 double m_InitialRadius{};
200
202 double m_GrowthFactor{};
203
205 double m_ShrinkFactor{};
206
208 bool m_Initialized{};
209
211 MeasureType m_CurrentCost{};
212
217 bool m_Stop{};
218
220 std::ostringstream m_StopConditionDescription{};
221
224 double m_FrobeniusNorm{};
225}; // end of class
226} // end of namespace itk
227
228#ifndef ITK_MANUAL_INSTANTIATION
229# include "itkOnePlusOneEvolutionaryOptimizerv4.hxx"
230#endif
231
232#endif
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Abstract base for object-to-object optimizers.
void StartOptimization(bool doOnlyInitialization=false) override
OnePlusOneEvolutionaryOptimizerv4(const OnePlusOneEvolutionaryOptimizerv4 &)
const MeasureType & GetValue() const override
void Initialize(double initialRadius, double grow=-1, double shrink=-1)
void SetNormalVariateGenerator(NormalVariateGeneratorType *generator)
const std::string GetStopConditionDescription() const override
~OnePlusOneEvolutionaryOptimizerv4() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
Defines common interfaces for random variate generators.
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
SingleValuedCostFunctionv4Template< double > SingleValuedCostFunctionv4