ITK  4.6.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 
24 namespace itk
25 {
63 {
64 public:
70  typedef unsigned int NumberOfIterationsType;
71 
73  itkNewMacro(Self);
74 
77 
81 
83  typedef vnl_vector< double > InternalParametersType;
84 
86  virtual void StartOptimization(void) ITK_OVERRIDE;
87 
89  virtual void SetCostFunction(SingleValuedCostFunction *costFunction) ITK_OVERRIDE;
90 
94  itkSetMacro( MaximumNumberOfIterations, NumberOfIterationsType );
95  itkGetConstMacro( MaximumNumberOfIterations, NumberOfIterationsType );
97 
106  itkSetMacro(AutomaticInitialSimplex, bool);
107  itkBooleanMacro(AutomaticInitialSimplex);
108  itkGetConstMacro(AutomaticInitialSimplex, bool);
110 
117  itkSetMacro(OptimizeWithRestarts, bool);
118  itkBooleanMacro(OptimizeWithRestarts);
119  itkGetConstMacro(OptimizeWithRestarts, bool);
121 
124  void SetInitialSimplexDelta(ParametersType initialSimplexDelta,
125  bool automaticInitialSimplex = false);
126  itkGetConstMacro(InitialSimplexDelta, ParametersType);
128 
133  itkSetMacro(ParametersConvergenceTolerance, double);
134  itkGetConstMacro(ParametersConvergenceTolerance, double);
136 
141  itkSetMacro(FunctionConvergenceTolerance, double);
142  itkGetConstMacro(FunctionConvergenceTolerance, double);
144 
146  virtual const std::string GetStopConditionDescription() const ITK_OVERRIDE;
147 
149  MeasureType GetValue() const;
150 
152  vnl_amoeba * GetOptimizer(void) const;
153 
154 protected:
155  AmoebaOptimizer();
156  virtual ~AmoebaOptimizer();
157  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
158 
160 
161 private:
163  void ValidateSettings();
164  //purposely not implemented
165  AmoebaOptimizer(const Self &);
166  //purposely not implemented
167  void operator=(const Self &);
169 
170  NumberOfIterationsType m_MaximumNumberOfIterations;
171  ParametersType::ValueType m_ParametersConvergenceTolerance;
174  ParametersType m_InitialSimplexDelta;
176  vnl_amoeba * m_VnlOptimizer;
177 
178  std::ostringstream m_StopConditionDescription;
179 };
180 } // end namespace itk
181 
182 #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
virtual void StartOptimization(void) ITK_OVERRIDE
CostFunctionType::MeasureType m_FunctionConvergenceTolerance
NumberOfIterationsType m_MaximumNumberOfIterations
Superclass::CostFunctionAdaptorType CostFunctionAdaptorType
SmartPointer< const Self > ConstPointer
vnl_vector< double > InternalParametersType
virtual const std::string GetStopConditionDescription() const ITK_OVERRIDE
This class is a base for the Optimization methods that optimize a single valued function.
vnl_amoeba * GetOptimizer(void) const
SingleValuedNonLinearVnlOptimizer Superclass
virtual void SetCostFunction(SingleValuedCostFunction *costFunction) ITK_OVERRIDE
Wrap of the vnl_amoeba algorithm.
void SetInitialSimplexDelta(ParametersType initialSimplexDelta, bool automaticInitialSimplex=false)
MeasureType GetValue() const
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
Control indentation during Print() invocation.
Definition: itkIndent.h:49
ParametersType::ValueType m_ParametersConvergenceTolerance
std::ostringstream m_StopConditionDescription
ParametersType m_InitialSimplexDelta