ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkAmoebaOptimizer.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 itkAmoebaOptimizer_h
19 #define itkAmoebaOptimizer_h
20 
22 #include "vnl/algo/vnl_amoeba.h"
23 #include "ITKOptimizersExport.h"
24 
25 namespace itk
26 {
62 class ITKOptimizers_EXPORT AmoebaOptimizer:
64 {
65 public:
71  typedef unsigned int NumberOfIterationsType;
72 
74  itkNewMacro(Self);
75 
78 
81  typedef Superclass::ParametersType ParametersType;
82 
84  typedef vnl_vector< double > InternalParametersType;
85 
87  virtual void StartOptimization(void) ITK_OVERRIDE;
88 
90  virtual void SetCostFunction(SingleValuedCostFunction *costFunction) ITK_OVERRIDE;
91 
95  itkSetMacro( MaximumNumberOfIterations, NumberOfIterationsType );
96  itkGetConstMacro( MaximumNumberOfIterations, NumberOfIterationsType );
98 
107  itkSetMacro(AutomaticInitialSimplex, bool);
108  itkBooleanMacro(AutomaticInitialSimplex);
109  itkGetConstMacro(AutomaticInitialSimplex, bool);
111 
118  itkSetMacro(OptimizeWithRestarts, bool);
119  itkBooleanMacro(OptimizeWithRestarts);
120  itkGetConstMacro(OptimizeWithRestarts, bool);
122 
125  void SetInitialSimplexDelta(ParametersType initialSimplexDelta,
126  bool automaticInitialSimplex = false);
127  itkGetConstMacro(InitialSimplexDelta, ParametersType);
129 
134  itkSetMacro(ParametersConvergenceTolerance, double);
135  itkGetConstMacro(ParametersConvergenceTolerance, double);
137 
142  itkSetMacro(FunctionConvergenceTolerance, double);
143  itkGetConstMacro(FunctionConvergenceTolerance, double);
145 
147  virtual const std::string GetStopConditionDescription() const ITK_OVERRIDE;
148 
150  MeasureType GetValue() const;
151 
153  vnl_amoeba * GetOptimizer() const;
154 
155 protected:
156  AmoebaOptimizer();
157  virtual ~AmoebaOptimizer();
158  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
159 
161 
162 private:
163  AmoebaOptimizer(const Self &) ITK_DELETE_FUNCTION;
164  void operator=(const Self &) ITK_DELETE_FUNCTION;
165 
167  void ValidateSettings();
168 
169  NumberOfIterationsType m_MaximumNumberOfIterations;
170  ParametersType::ValueType m_ParametersConvergenceTolerance;
171  CostFunctionType::MeasureType m_FunctionConvergenceTolerance;
172  bool m_AutomaticInitialSimplex;
173  ParametersType m_InitialSimplexDelta;
174  bool m_OptimizeWithRestarts;
175  vnl_amoeba * m_VnlOptimizer;
176 
177  std::ostringstream m_StopConditionDescription;
178 };
179 } // end namespace itk
180 
181 #endif
unsigned int NumberOfIterationsType
This class is a base for the CostFunctions returning a single value.
Light weight base class for most itk classes.
Superclass::ParametersType ParametersType
SmartPointer< Self > Pointer
Superclass::CostFunctionAdaptorType CostFunctionAdaptorType
SmartPointer< const Self > ConstPointer
vnl_vector< double > InternalParametersType
This class is a base for the Optimization methods that optimize a single valued function.
SingleValuedNonLinearVnlOptimizer Superclass
Wrap of the vnl_amoeba algorithm.
Control indentation during Print() invocation.
Definition: itkIndent.h:49