00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkOnePlusOneEvolutionaryOptimizer_h
00018 #define __itkOnePlusOneEvolutionaryOptimizer_h
00019
00020 #include <itkSingleValuedNonLinearOptimizer.h>
00021 #include <itkRandomVariateGeneratorBase.h>
00022
00023 namespace itk
00024 {
00025
00068 class ITK_EXPORT OnePlusOneEvolutionaryOptimizer:
00069 public SingleValuedNonLinearOptimizer
00070 {
00071 public:
00073 typedef OnePlusOneEvolutionaryOptimizer Self ;
00074 typedef SingleValuedNonLinearOptimizer Superclass;
00075 typedef SmartPointer<Self> Pointer;
00076 typedef SmartPointer<const Self> ConstPointer;
00077
00079 itkNewMacro(Self);
00080
00082 itkTypeMacro(OnePlusOneEvolutionaryOptimizer, SingleValuedNonLinearOptimizer );
00083
00085 typedef SingleValuedCostFunction CostFunctionType;
00086 typedef CostFunctionType::Pointer CostFunctionPointer;
00087
00089 typedef Statistics::RandomVariateGeneratorBase NormalVariateGeneratorType ;
00090
00092 itkSetMacro( Maximize, bool );
00093 itkBooleanMacro( Maximize );
00095
00097 itkSetMacro( MaximumIteration, unsigned int );
00098 itkGetConstReferenceMacro( MaximumIteration, unsigned int );
00100
00102 itkSetMacro( GrowthFactor, double );
00103 itkGetConstReferenceMacro( GrowthFactor, double );
00105
00107 itkSetMacro( ShrinkFactor, double );
00108 itkGetConstReferenceMacro( ShrinkFactor, double );
00110
00112 itkSetMacro( InitialRadius, double ) ;
00113 itkGetConstReferenceMacro( InitialRadius, double );
00115
00116
00119 itkSetMacro( Epsilon, double );
00120 itkGetConstReferenceMacro( Epsilon, double );
00122
00124 itkGetConstReferenceMacro( FrobeniusNorm, double );
00125
00126 void SetNormalVariateGenerator(NormalVariateGeneratorType* generator) ;
00127
00134 void Initialize(double initialRadius, double grow = -1, double shrink = -1) ;
00135
00137 itkGetConstReferenceMacro( CurrentCost, MeasureType );
00138 MeasureType GetValue() const { return this->GetCurrentCost(); }
00140
00142 itkGetConstReferenceMacro( CurrentIteration, unsigned int) ;
00143
00147 void StartOptimization() ;
00148
00152 void StopOptimization()
00153 { m_Stop = true ; }
00154
00155 protected:
00156 OnePlusOneEvolutionaryOptimizer() ;
00157 OnePlusOneEvolutionaryOptimizer(const OnePlusOneEvolutionaryOptimizer&) ;
00158 virtual ~OnePlusOneEvolutionaryOptimizer() ;
00159 void PrintSelf(std::ostream& os, Indent indent) const;
00160
00161 private:
00162
00164 NormalVariateGeneratorType::Pointer m_RandomGenerator ;
00165
00167 unsigned int m_MaximumIteration ;
00168
00170 unsigned int m_CurrentIteration ;
00171
00173 bool m_Maximize;
00174
00177 double m_Epsilon ;
00178
00180 double m_InitialRadius ;
00181
00183 double m_GrowthFactor ;
00184
00186 double m_ShrinkFactor ;
00187
00189 bool m_Initialized ;
00190
00192 MeasureType m_CurrentCost;
00193
00198 bool m_Stop ;
00199
00202 double m_FrobeniusNorm;
00203
00204 } ;
00205
00206 }
00207
00208 #endif
00209