ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkAmoebaOptimizerv4.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 itkAmoebaOptimizerv4_h
19 #define itkAmoebaOptimizerv4_h
20 
22 #include "vnl/algo/vnl_amoeba.h"
23 #include "ITKOptimizersv4Export.h"
24 
25 namespace itk
26 {
60 class ITKOptimizersv4_EXPORT AmoebaOptimizerv4:
62 {
63 public:
69 
71  itkNewMacro(Self);
72 
75 
79 
81  typedef vnl_vector< double > InternalParametersType;
82 
84  virtual void StartOptimization(bool doOnlyInitialization = false) ITK_OVERRIDE;
85 
87  virtual void SetMetric(MetricType *metric) ITK_OVERRIDE;
88 
97  itkSetMacro(AutomaticInitialSimplex, bool);
98  itkBooleanMacro(AutomaticInitialSimplex);
99  itkGetConstMacro(AutomaticInitialSimplex, bool);
101 
108  itkSetMacro(OptimizeWithRestarts, bool);
109  itkBooleanMacro(OptimizeWithRestarts);
110  itkGetConstMacro(OptimizeWithRestarts, bool);
112 
115  void SetInitialSimplexDelta(ParametersType initialSimplexDelta,
116  bool automaticInitialSimplex = false);
117  itkGetConstMacro(InitialSimplexDelta, ParametersType);
119 
124  itkSetMacro(ParametersConvergenceTolerance, double);
125  itkGetConstMacro(ParametersConvergenceTolerance, double);
127 
132  itkSetMacro(FunctionConvergenceTolerance, double);
133  itkGetConstMacro(FunctionConvergenceTolerance, double);
135 
137  virtual const std::string GetStopConditionDescription() const ITK_OVERRIDE;
138 
140  vnl_amoeba * GetOptimizer() const;
141 
142 protected:
144  virtual ~AmoebaOptimizerv4();
145  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
146 
148 
149 private:
150  AmoebaOptimizerv4(const Self &) ITK_DELETE_FUNCTION;
151  void operator=(const Self &) ITK_DELETE_FUNCTION;
152 
154  void ValidateSettings();
155 
156  ParametersType::ValueType m_ParametersConvergenceTolerance;
157  MeasureType m_FunctionConvergenceTolerance;
158  bool m_AutomaticInitialSimplex;
159  ParametersType m_InitialSimplexDelta;
160  bool m_OptimizeWithRestarts;
161  vnl_amoeba * m_VnlOptimizer;
162 
163  std::ostringstream m_StopConditionDescription;
164 };
165 } // end namespace itk
166 
167 #endif
Superclass::CostFunctionAdaptorType CostFunctionAdaptorType
Light weight base class for most itk classes.
SmartPointer< const Self > ConstPointer
Superclass::ParametersType ParametersType
This is a base for the ITKv4 Optimization methods using the vnl library.
Wrap of the vnl_amoeba algorithm.
vnl_vector< double > InternalParametersType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
SmartPointer< Self > Pointer
SingleValuedNonLinearVnlOptimizerv4 Superclass