ITK  5.2.0
Insight Toolkit
itkAmoebaOptimizerv4.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  * http://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 itkAmoebaOptimizerv4_h
19 #define itkAmoebaOptimizerv4_h
20 
22 #include "vnl/algo/vnl_amoeba.h"
23 #include "ITKOptimizersv4Export.h"
24 
25 namespace itk
26 {
61 class ITKOptimizersv4_EXPORT AmoebaOptimizerv4 : public SingleValuedNonLinearVnlOptimizerv4
62 {
63 public:
64  ITK_DISALLOW_COPY_AND_MOVE(AmoebaOptimizerv4);
65 
71 
73  itkNewMacro(Self);
74 
77 
81 
83  using InternalParametersType = vnl_vector<double>;
84 
86  void
87  StartOptimization(bool doOnlyInitialization = false) override;
88 
90  void
91  SetMetric(MetricType * metric) override;
92 
101  itkSetMacro(AutomaticInitialSimplex, bool);
102  itkBooleanMacro(AutomaticInitialSimplex);
103  itkGetConstMacro(AutomaticInitialSimplex, bool);
105 
112  itkSetMacro(OptimizeWithRestarts, bool);
113  itkBooleanMacro(OptimizeWithRestarts);
114  itkGetConstMacro(OptimizeWithRestarts, bool);
116 
119  void
120  SetInitialSimplexDelta(ParametersType initialSimplexDelta, bool automaticInitialSimplex = false);
121  itkGetConstMacro(InitialSimplexDelta, ParametersType);
123 
128  itkSetMacro(ParametersConvergenceTolerance, double);
129  itkGetConstMacro(ParametersConvergenceTolerance, double);
131 
136  itkSetMacro(FunctionConvergenceTolerance, double);
137  itkGetConstMacro(FunctionConvergenceTolerance, double);
139 
141  const std::string
142  GetStopConditionDescription() const override;
143 
145  vnl_amoeba *
146  GetOptimizer() const;
147 
148 protected:
150  ~AmoebaOptimizerv4() override;
151  void
152  PrintSelf(std::ostream & os, Indent indent) const override;
153 
154  using CostFunctionAdaptorType = Superclass::CostFunctionAdaptorType;
155 
156 private:
158  void
159  ValidateSettings();
160 
161  ParametersType::ValueType m_ParametersConvergenceTolerance;
166  vnl_amoeba * m_VnlOptimizer;
167 
168  std::ostringstream m_StopConditionDescription;
169 };
170 } // end namespace itk
171 
172 #endif
itk::AmoebaOptimizerv4::InternalParametersType
vnl_vector< double > InternalParametersType
Definition: itkAmoebaOptimizerv4.h:83
itk::SingleValuedNonLinearVnlOptimizerv4::MetricType
Superclass::MetricType MetricType
Definition: itkSingleValuedNonLinearVnlOptimizerv4.h:58
itk::AmoebaOptimizerv4::m_OptimizeWithRestarts
bool m_OptimizeWithRestarts
Definition: itkAmoebaOptimizerv4.h:165
itk::AmoebaOptimizerv4::m_AutomaticInitialSimplex
bool m_AutomaticInitialSimplex
Definition: itkAmoebaOptimizerv4.h:163
itk::AmoebaOptimizerv4::ParametersType
Superclass::ParametersType ParametersType
Definition: itkAmoebaOptimizerv4.h:80
itkSingleValuedNonLinearVnlOptimizerv4.h
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::SingleValuedNonLinearVnlOptimizerv4
This is a base for the ITKv4 Optimization methods using the vnl library.
Definition: itkSingleValuedNonLinearVnlOptimizerv4.h:38
itk::AmoebaOptimizerv4::m_StopConditionDescription
std::ostringstream m_StopConditionDescription
Definition: itkAmoebaOptimizerv4.h:168
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::AmoebaOptimizerv4
Wrap of the vnl_amoeba algorithm.
Definition: itkAmoebaOptimizerv4.h:61
itk::AmoebaOptimizerv4::m_FunctionConvergenceTolerance
MeasureType m_FunctionConvergenceTolerance
Definition: itkAmoebaOptimizerv4.h:162
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::AmoebaOptimizerv4::m_InitialSimplexDelta
ParametersType m_InitialSimplexDelta
Definition: itkAmoebaOptimizerv4.h:164
itk::SingleValuedNonLinearVnlOptimizerv4::ParametersType
Superclass::ParametersType ParametersType
Definition: itkSingleValuedNonLinearVnlOptimizerv4.h:60
itk::AmoebaOptimizerv4::m_VnlOptimizer
vnl_amoeba * m_VnlOptimizer
Definition: itkAmoebaOptimizerv4.h:166
itk::AmoebaOptimizerv4::CostFunctionAdaptorType
Superclass::CostFunctionAdaptorType CostFunctionAdaptorType
Definition: itkAmoebaOptimizerv4.h:154
itk::AmoebaOptimizerv4::m_ParametersConvergenceTolerance
ParametersType::ValueType m_ParametersConvergenceTolerance
Definition: itkAmoebaOptimizerv4.h:161