frePowellSOOptimizer.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   F.R.E.E. - flexible registration evaluation engine
00004   Version:   v.1.0.0
00005   Date:      $Date: 2006/09/01 12:00:00 $
00006   Module:    $RCSfile: frePowellSOOptimizer.h,v $
00007   Language:  C++
00008 
00009 
00010 
00011   Copyright (c) 2007 Ralf o Floca (Department of Medical Informatics,
00012   Institute for Medical Biometry and Informatics, University of Heidelberg,
00013   Germany). All rights reserved.
00014   See FREECopyright.txt or http://www.mi.med.uni-hd.de/free/copyright.htm
00015   for details.
00016 
00017      This software is distributed WITHOUT ANY WARRANTY; without even 
00018      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00019      PURPOSE.  See the above copyright notices for more information.
00020 
00021 =========================================================================*/
00022 #ifndef __frePowellSOOptimizer_h
00023 #define __frePowellSOOptimizer_h
00024 
00025 #include "freSetupOptimizationOptimizer.h"
00026 #include "freRegistrationObserver.h"
00027 #include "freItkSingleValuedCostFunctionWrapper.h"
00028 
00029 #include "itkPowellOptimizer.h"
00030 
00031 namespace FREE
00032 {
00033   
00039 class ITK_EXPORT PowellSOOptimizer : 
00040         public SetupOptimizationOptimizer
00041 {
00042 public:
00044   typedef PowellSOOptimizer  Self;
00045   typedef SetupOptimizationOptimizer                                                            Superclass;
00046   typedef itk::SmartPointer<Self>               Pointer;
00047   typedef itk::SmartPointer<const Self>         ConstPointer;
00048 
00050   itkTypeMacro( PowellSOOptimizer, SetupOptimizationOptimizer );
00051 
00053   itkNewMacro(Self);
00054 
00056   void SetMaximize(bool maximize);
00057   itkBooleanMacro( Maximize );
00058 
00060   void SetMaximumIteration(unsigned int iMaximumIteration);
00061   const unsigned int GetMaximumIteration() const;
00062 
00064   void SetMaximumLineIteration(unsigned int iMaximumLineIteration);
00065   const unsigned int GetMaximumLineIteration() const;
00066 
00068   void SetStepLength(double dStepLength);
00069   const double& GetStepLength() const;
00070 
00072   void SetStepTolerance(double dStepTolerance);
00073   const double& GetStepTolerance() const;
00074 
00076   void SetValueTolerance(double dValueTolerance);
00077   const double& GetValueTolerance() const;
00078 
00079         virtual void SetCostFunction( CostFunctionType * costFunction );
00080 
00081         virtual void SetInitialPosition (const ParametersType &param);
00082 
00083   virtual void StartOptimization( void );
00084 
00085         virtual void StopOptimization();
00086 
00087   virtual bool IsStoppable() const;
00088 
00089         typedef itk::PowellOptimizer ItkOptimizerType;
00090         typedef ItkOptimizerType::Pointer ItkOptimizerPointer;
00091 
00092         ItkOptimizerType * GetItkOptimizer();
00093 
00094 protected:
00095   PowellSOOptimizer();
00096   virtual ~PowellSOOptimizer();
00097         void PrintSelf(std::ostream& os, itk::Indent indent) const;
00098 
00099   void OnOptIteration(void* pSender, long threadID);
00100   void OnOptStart(void* pSender, long threadID);
00101   void OnOptEnd(void* pSender, long threadID);
00102 
00103   IterationObserver::Pointer m_IterationObserver;
00104         NotificationEvent<Self>::Pointer m_IterationNotificationEvent;
00105 
00106         typedef RegistrationObserverBase<itk::StartEvent> StartObserver;
00107         StartObserver::Pointer m_StartObserver;
00108         NotificationEvent<Self>::Pointer m_StartNotificationEvent;
00109 
00110         typedef RegistrationObserverBase<itk::EndEvent> EndObserver;
00111         EndObserver::Pointer m_EndObserver;
00112         NotificationEvent<Self>::Pointer m_EndNotificationEvent;
00113 
00114         ItkOptimizerPointer m_ItkOptimizer;
00115         ItkSingleValuedCostFunctionWrapper::Pointer m_CostFunctionWrapper;
00116 
00117 private:  
00118   PowellSOOptimizer(const Self&); //purposely not implemented
00119   void operator=(const Self&);//purposely not implemented
00120 };
00121 
00122 } // end namespace FREE
00123 
00124 #endif
00125     
00126  

Generated at Sat Oct 13 17:07:01 2007 for f.r.e.e. - Flexible Registration and Evaluation Engine by doxygen 1.5.3 written by Dimitri van Heesch, © 1997-2000