freSetupOptimizationEvents.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: freSetupOptimizationEvents.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 __freSetupOptimizationEvents_h
00023 #define __freSetupOptimizationEvents_h
00024 
00025 #include "freEvents.h"
00026 
00027 namespace FREE
00028 {
00029 
00035 class SetOpIterationEventBase: public NotificationEventBase
00036 {
00037 public:
00038         typedef itk::Array<double> MetricMeasureType;
00039         typedef double                                           ComposedMetricMeasureType;
00040         typedef itk::Array<double> ParametersType;
00041 
00042         typedef void (*NextIterationEvent)(const long& lIteration,
00043                                      const ComposedMetricMeasureType& composedMeasure,
00044                                      const MetricMeasureType& measure,
00045                                      const ParametersType& parameters, void* pSender);
00046 
00047          typedef itk::SmartPointer<SetOpIterationEventBase> Pointer;
00048 
00049          freNewEventBaseMacro(SetOpIterationEventBase,NextIterationEvent);
00050          itkTypeMacro(SetOpIterationEventBase,NotificationEventBase);
00051 
00052 private:
00053    NextIterationEvent m_IterationEvent;
00054 
00055 protected:
00056   SetOpIterationEventBase();
00057   SetOpIterationEventBase(NextIterationEvent pNIE);
00058 
00059 public:
00069   virtual void Execute(const long& lIteration,
00070                        const ComposedMetricMeasureType& composedMeasure,
00071                        const MetricMeasureType& measure,
00072                        const ParametersType& parameters,
00073                        void* pSender);
00074 };
00075 
00076 
00082 template <typename T>
00083 class SetOpIterationEvent : public SetOpIterationEventBase
00084 {
00085 public:
00086   typedef void (T::*NextIterationEvent)(const long& lIteration, const ComposedMetricMeasureType& composedMeasure, const MetricMeasureType& measure, const ParametersType& parameters, void* pSender);
00087 
00088   typedef itk::SmartPointer<SetOpIterationEvent<T> > Pointer;
00089 
00090   freNewEventMacro(SetOpIterationEvent, T, NextIterationEvent);
00091         itkTypeMacro(SetOpIterationEvent,SetOpIterationEventBase);
00092 
00093 private:
00094    T* m_Object;
00095    NextIterationEvent m_IterationEvent;
00096 
00097 protected:
00098    SetOpIterationEvent(T* pObject, NextIterationEvent pNIE)
00099    {
00100          m_Object = pObject;
00101          m_IterationEvent = pNIE;
00102    };
00103    
00104 public:
00114   virtual void Execute(const long& lIteration, const ComposedMetricMeasureType& composedMeasure, const MetricMeasureType& measure, const ParametersType& parameters, void* pSender)
00115    { (m_Object->*m_IterationEvent)(lIteration, composedMeasure, measure, parameters, pSender); };
00116 };
00117 
00118 } //end of namespace free
00119 #endif

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