freSetupOptimizationProcessor.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: freSetupOptimizationProcessor.h,v $
00007   Language:  C++
00008 
00009 
00010   Copyright (c) 2007 Ralf o Floca (Department of Medical Informatics,
00011   Institute for Medical Biometry and Informatics, University of Heidelberg,
00012   Germany). All rights reserved.
00013   See FREECopyright.txt or http://www.mi.med.uni-hd.de/free/copyright.htm
00014   for details.
00015 
00016      This software is distributed WITHOUT ANY WARRANTY; without even 
00017      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00018      PURPOSE.  See the above copyright notices for more information.
00019 
00020 =========================================================================*/
00021 #ifndef __freSetupOptimizationProcessor_h
00022 #define __freSetupOptimizationProcessor_h
00023 
00024 #include "freElementals.h"
00025 #include "freSetup.h"
00026 #include "freExceptions.h"
00027 #include "freRegistrationEvents.h"
00028 #include "freSetupOptimizationEvents.h"
00029 #include "freSetupTransform.h"
00030 #include "freSetupOptimizationMetric.h"
00031 #include "freSetupOptimizationOptimizer.h"
00032 
00033 #include "itkObject.h"
00034 
00035 namespace FREE
00036 {
00037 
00047 class SetupOptimizationProcessor : public itk::Object
00048 {
00049 public:  
00051   typedef SetupOptimizationProcessor  Self;
00052   typedef itk::Object Superclass;
00053   typedef itk::SmartPointer<Self>        Pointer;
00054   typedef itk::SmartPointer<const Self>  ConstPointer;
00055   
00056   typedef SetupTransform TransformType;
00057   typedef TransformType::Pointer TransformPointer;
00058   typedef SetupOptimizationMetric MetricType;
00059   typedef MetricType::Pointer MetricPointer;
00060   typedef SetupOptimizationOptimizer OptimizerType;
00061   typedef OptimizerType::Pointer OptimizerPointer;
00062 
00063         typedef TransformType::ParametersType ParametersType;
00064         typedef MetricType::MeasureType MeasureType;
00065 
00067   itkTypeMacro( SetupOptimizationProcessor, itk::Object );
00068 
00069   itkNewMacro( Self );
00070 
00074   RegistrationProgressEventBase::Pointer fnOnProgress;
00075 
00078   SetOpIterationEventBase::Pointer fnOnNextIteration;
00079 
00083   ProgressEventBase::Pointer fnOnMetricComputationProgress;
00084 
00088   ProgressEventBase::Pointer fnOnEvaluationDone;
00089 
00093   ProgressEventBase::Pointer fnOnEvaluationProgress;
00094 
00098   ProgressEventBase::Pointer fnOnNextAdaptation;
00099 
00104   ProgressEventBase::Pointer fnOnEvaluationFailed;
00105 
00109   Setup* GetSetup();
00110   void SetSetup(Setup* pSetup);
00111 
00115   Adaptation::AdaptationList* GetAdaptationList();
00116   void SetAdaptationList(Adaptation::AdaptationList* pAdaptations);
00117 
00118   itkGetObjectMacro(Transform,TransformType);
00119   itkSetObjectMacro(Transform,TransformType);
00120 
00121   itkGetObjectMacro(Metric,MetricType);
00122   itkSetObjectMacro(Metric,MetricType);
00123 
00124   itkGetObjectMacro(Optimizer,OptimizerType);
00125   itkSetObjectMacro(Optimizer,OptimizerType);
00126 
00127         itkGetConstReferenceMacro(FinalParameters, ParametersType);
00128         itkGetConstReferenceMacro(FinalMeasure, MeasureType);
00129 
00130   const Setup* GetFinalSetup () const { return m_smpFinalSetup; };
00131 
00136   virtual const long GetMaxIterationCount() const;
00137 
00140         const long GetCurrentIterationCount() const;
00141 
00145   bool OptimizationIsFinished() const {return this->m_bOptimizationDone;};
00146 
00148   void StartOptimization();
00149 
00151   void ResumeOptimization();
00152   bool OptimizationIsResumable();
00155   void StopOptimization();
00156   bool OptimizationIsStoppable();
00157 
00158 protected:
00161   SetupOptimizationProcessor();
00162 
00163   virtual ~SetupOptimizationProcessor();
00164 
00166   void ComputeOptimization();
00167 
00169   long m_lCurIteration;
00170 
00172   bool m_bOptimizationDone;
00174         bool m_bOptimizationStarted;
00175 
00176   Adaptation::AdaptationList::Pointer           m_smpAdaptations;
00177 
00178   Setup::Pointer                                  m_smpSetup;
00179 
00180   TransformPointer                                      m_Transform;
00181   MetricPointer                                                 m_Metric;
00182   OptimizerPointer                                      m_Optimizer;
00183 
00184   Setup::Pointer                                                m_smpFinalSetup;
00185         TransformType::ParametersType m_FinalParameters;
00186         MetricType::MeasureType                         m_FinalMeasure;
00187 
00195   void OnNewIteration(void* pSender, long threadID);
00196 
00205   void OnEvaluationProgress(const long status, const std::string& sComment, void* pSender, long threadID);
00206 };
00207 
00208 }//End of Namespace free
00209 
00210 #endif

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