00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkAmoebaOptimizer_h
00018 #define __itkAmoebaOptimizer_h
00019
00020 #include "itkSingleValuedNonLinearVnlOptimizer.h"
00021 #include "vnl/algo/vnl_amoeba.h"
00022
00023 namespace itk
00024 {
00025
00049 class ITK_EXPORT AmoebaOptimizer :
00050 public SingleValuedNonLinearVnlOptimizer
00051 {
00052 public:
00054 typedef AmoebaOptimizer Self;
00055 typedef SingleValuedNonLinearVnlOptimizer Superclass;
00056 typedef SmartPointer<Self> Pointer;
00057 typedef SmartPointer<const Self> ConstPointer;
00058
00060 itkNewMacro(Self);
00061
00063 itkTypeMacro( AmoebaOptimizer, SingleValuedNonLinearVnlOptimizer );
00064
00067 typedef Superclass::ParametersType ParametersType;
00068
00070 typedef vnl_vector<double> InternalParametersType;
00071
00073 typedef vnl_amoeba InternalOptimizerType;
00074
00076 vnl_amoeba * GetOptimizer(void);
00077
00079 void StartOptimization( void );
00080
00082 virtual void SetCostFunction( SingleValuedCostFunction * costFunction );
00083
00087 virtual void SetMaximumNumberOfIterations( unsigned int n );
00088 itkGetMacro( MaximumNumberOfIterations, unsigned int );
00090
00099 itkSetMacro(AutomaticInitialSimplex, bool);
00100 itkBooleanMacro(AutomaticInitialSimplex);
00101 itkGetMacro(AutomaticInitialSimplex, bool);
00103
00106 itkSetMacro(InitialSimplexDelta, ParametersType);
00107 itkGetMacro(InitialSimplexDelta, ParametersType);
00109
00118 virtual void SetParametersConvergenceTolerance( double tol );
00119 itkGetMacro( ParametersConvergenceTolerance, double );
00120 virtual void SetFunctionConvergenceTolerance( double tol );
00121 itkGetMacro( FunctionConvergenceTolerance, double );
00123
00125 MeasureType GetValue() const;
00126
00127 protected:
00128 AmoebaOptimizer();
00129 virtual ~AmoebaOptimizer();
00130 void PrintSelf(std::ostream& os, Indent indent) const;
00131
00132 typedef Superclass::CostFunctionAdaptorType CostFunctionAdaptorType;
00133
00134 private:
00135 AmoebaOptimizer(const Self&);
00136 void operator=(const Self&);
00137
00138 bool m_OptimizerInitialized;
00139 InternalOptimizerType * m_VnlOptimizer;
00140 unsigned int m_MaximumNumberOfIterations;
00141 double m_ParametersConvergenceTolerance;
00142 double m_FunctionConvergenceTolerance;
00143
00144 bool m_AutomaticInitialSimplex;
00145 ParametersType m_InitialSimplexDelta;
00146 };
00147
00148 }
00149
00150 #endif
00151