freSetupOptimizationOptimizer.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: freSetupOptimizationOptimizer.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 __freSetupOptimizationOptimizer_h
00023 #define __freSetupOptimizationOptimizer_h
00024 
00025 #include "freSetupOptimizationMetric.h"
00026 
00027 #include "itkNonLinearOptimizer.h"
00028 
00029 namespace FREE
00030 {
00031   
00036 class ITK_EXPORT SetupOptimizationOptimizer : 
00037         public itk::NonLinearOptimizer
00038 {
00039 public:
00041   typedef SetupOptimizationOptimizer                                Self;
00042   typedef itk::NonLinearOptimizer                                                               Superclass;
00043   typedef itk::SmartPointer<Self>               Pointer;
00044   typedef itk::SmartPointer<const Self>         ConstPointer;
00045   
00046         typedef SetupOptimizationMetric                                                                 CostFunctionType;
00047         typedef CostFunctionType::Pointer                                                               CostFunctionPointer;
00048         typedef CostFunctionType::MeasureType                                           MeasureType;
00049         typedef CostFunctionType::DecomposedMeasureType DecomposedMeasureType;
00050 
00052   itkTypeMacro( SetupOptimizationOptimizer, NonLinearOptimizer );
00053  
00054   virtual void StartOptimization() = 0;
00055 
00057   virtual bool IsStoppable() const;
00058  
00061   virtual void StopOptimization();
00062 
00064   virtual bool IsResumeable() const;
00065 
00068   virtual void ResumeOptimization();
00069 
00070   itkGetConstReferenceMacro( CurrentValue, MeasureType );
00071   itkGetConstReferenceMacro( CurrentDecomposedValue, DecomposedMeasureType );
00072   itkGetConstReferenceMacro( BestPosition, ParametersType );
00073   itkGetConstReferenceMacro( BestValue, MeasureType );
00074 
00075         virtual MeasureType  GetValue (const ParametersType &parameters);
00076         virtual DecomposedMeasureType  GetDecomposedValue (const ParametersType &parameters);
00077 
00078   virtual void SetCostFunction( CostFunctionType * costFunction );
00079   itkGetConstObjectMacro( CostFunction, CostFunctionType );
00080 
00081 protected:
00082   SetupOptimizationOptimizer();
00083   virtual ~SetupOptimizationOptimizer() {};
00084         void PrintSelf(std::ostream& os, itk::Indent indent) const;
00085 
00086 private:  
00087   SetupOptimizationOptimizer(const Self&); //purposely not implemented
00088   void operator=(const Self&);//purposely not implemented
00089 
00090 protected:
00091   mutable MeasureType          m_CurrentValue;
00092   mutable DecomposedMeasureType  m_CurrentDecomposedValue;
00093         mutable ParametersType                   m_BestPosition;
00094         mutable MeasureType                                      m_BestValue;
00095 
00096         CostFunctionPointer  m_CostFunction;
00097 };
00098 
00099 } // end namespace FREE
00100 
00101 #endif
00102     
00103  

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