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: freVnlSetupOptimizationOptimizer.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 __freVnlSetupOptimizationOptimizer_h 00023 #define __freVnlSetupOptimizationOptimizer_h 00024 00025 #include "freSetupOptimizationOptimizer.h" 00026 #include "freSingleValuedVnlSOMetricAdaptor.h" 00027 00028 namespace FREE 00029 { 00030 00035 class ITK_EXPORT VnlSetupOptimizationOptimizer : 00036 public SetupOptimizationOptimizer 00037 { 00038 public: 00040 typedef VnlSetupOptimizationOptimizer Self; 00041 typedef SetupOptimizationOptimizer Superclass; 00042 typedef itk::SmartPointer<Self> Pointer; 00043 typedef itk::SmartPointer<const Self> ConstPointer; 00044 00045 typedef Superclass::CostFunctionType CostFunctionType; 00046 typedef CostFunctionType::Pointer CostFunctionPointer; 00047 00048 typedef Superclass::MeasureType MeasureType; 00049 typedef itk::Array< double > DerivativeType; 00050 typedef Superclass::DecomposedMeasureType DecomposedMeasureType; 00051 00053 itkTypeMacro( VnlSetupOptimizationOptimizer, SetupOptimizationOptimizer ); 00054 00059 typedef itk::ReceptorMemberCommand< Self > CommandType; 00060 00066 itkGetConstReferenceMacro( Maximize, bool ); 00067 itkSetMacro( Maximize, bool ); 00068 itkBooleanMacro( Maximize ); 00069 00070 bool GetMinimize( ) const 00071 { return !m_Maximize; } 00072 void SetMinimize(bool v) 00073 { this->SetMaximize(!v); } 00074 void MinimizeOn() 00075 { this->MaximizeOff(); } 00076 void MinimizeOff() 00077 { this->MaximizeOn(); } 00078 00084 itkGetConstReferenceMacro(CachedValue, MeasureType); 00085 itkGetConstReferenceMacro(CachedDerivative, DerivativeType); 00086 itkGetConstReferenceMacro(CachedCurrentPosition, ParametersType); 00087 00088 virtual void SetCostFunction( CostFunctionType * costFunction ) = 0; 00089 00090 protected: 00091 VnlSetupOptimizationOptimizer(); 00092 virtual ~VnlSetupOptimizationOptimizer(); 00093 void PrintSelf(std::ostream& os, itk::Indent indent) const; 00094 00095 typedef SingleValuedVnlSOMetricAdaptor CostFunctionAdaptorType; 00096 00097 void SetCostFunctionAdaptor( CostFunctionAdaptorType * adaptor ); 00098 const CostFunctionAdaptorType * GetCostFunctionAdaptor( void ) const; 00099 CostFunctionAdaptorType * GetCostFunctionAdaptor( void ); 00100 00103 CostFunctionAdaptorType * GetNonConstCostFunctionAdaptor( void ) const; 00104 00105 private: 00106 VnlSetupOptimizationOptimizer(const Self&); //purposely not implemented 00107 void operator=(const Self&);//purposely not implemented 00108 00115 void IterationReport( const itk::EventObject & event ); 00116 00117 CostFunctionAdaptorType * m_CostFunctionAdaptor; 00118 00119 bool m_Maximize; 00120 00121 CommandType::Pointer m_Command; 00122 00123 mutable ParametersType m_CachedCurrentPosition; 00124 mutable MeasureType m_CachedValue; 00125 mutable DerivativeType m_CachedDerivative; 00126 }; 00127 00128 } // end namespace FREE 00129 00130 #endif 00131 00132
1.5.3 written by Dimitri van Heesch,
© 1997-2000