ITK  4.6.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 
24 namespace itk
25 {
61 {
62 public:
68 
70  itkNewMacro(Self);
71 
74 
78 
80  typedef vnl_vector< double > InternalParametersType;
81 
83  virtual void StartOptimization(bool doOnlyInitialization = false) ITK_OVERRIDE;
84 
86  virtual void SetMetric(MetricType *metric) ITK_OVERRIDE;
87 
96  itkSetMacro(AutomaticInitialSimplex, bool);
97  itkBooleanMacro(AutomaticInitialSimplex);
98  itkGetConstMacro(AutomaticInitialSimplex, bool);
100 
107  itkSetMacro(OptimizeWithRestarts, bool);
108  itkBooleanMacro(OptimizeWithRestarts);
109  itkGetConstMacro(OptimizeWithRestarts, bool);
111 
114  void SetInitialSimplexDelta(ParametersType initialSimplexDelta,
115  bool automaticInitialSimplex = false);
116  itkGetConstMacro(InitialSimplexDelta, ParametersType);
118 
123  itkSetMacro(ParametersConvergenceTolerance, double);
124  itkGetConstMacro(ParametersConvergenceTolerance, double);
126 
131  itkSetMacro(FunctionConvergenceTolerance, double);
132  itkGetConstMacro(FunctionConvergenceTolerance, double);
134 
136  virtual const std::string GetStopConditionDescription() const ITK_OVERRIDE;
137 
139  vnl_amoeba * GetOptimizer(void) const;
140 
141 protected:
143  virtual ~AmoebaOptimizerv4();
144  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
145 
147 
148 private:
150  void ValidateSettings();
151  //purposely not implemented
152  AmoebaOptimizerv4(const Self &);
153  //purposely not implemented
154  void operator=(const Self &);
156 
157  ParametersType::ValueType m_ParametersConvergenceTolerance;
160  ParametersType m_InitialSimplexDelta;
162  vnl_amoeba * m_VnlOptimizer;
163 
164  std::ostringstream m_StopConditionDescription;
165 };
166 } // end namespace itk
167 
168 #endif
Superclass::CostFunctionAdaptorType CostFunctionAdaptorType
Light weight base class for most itk classes.
SmartPointer< const Self > ConstPointer
virtual const std::string GetStopConditionDescription() const ITK_OVERRIDE
ParametersType::ValueType m_ParametersConvergenceTolerance
std::ostringstream m_StopConditionDescription
vnl_amoeba * GetOptimizer(void) const
MeasureType m_FunctionConvergenceTolerance
Superclass::ParametersType ParametersType
This is a base for the ITKv4 Optimization methods using the vnl library.
Wrap of the vnl_amoeba algorithm.
virtual void SetMetric(MetricType *metric) ITK_OVERRIDE
vnl_vector< double > InternalParametersType
ParametersType m_InitialSimplexDelta
void SetInitialSimplexDelta(ParametersType initialSimplexDelta, bool automaticInitialSimplex=false)
virtual void StartOptimization(bool doOnlyInitialization=false) ITK_OVERRIDE
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
Control indentation during Print() invocation.
Definition: itkIndent.h:49
SmartPointer< Self > Pointer
SingleValuedNonLinearVnlOptimizerv4 Superclass