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.cxx,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 00023 #include "freSetupOptimizationOptimizer.h" 00024 #include "itkCommand.h" 00025 #include "itkEventObject.h" 00026 00027 namespace FREE 00028 { 00029 00033 SetupOptimizationOptimizer 00034 ::SetupOptimizationOptimizer() 00035 { 00036 itkDebugMacro("Constructor"); 00037 00038 m_CurrentValue = 0; 00039 m_CurrentDecomposedValue.Fill(0.0); 00040 } 00041 00042 void 00043 SetupOptimizationOptimizer 00044 ::PrintSelf(std::ostream& os, itk::Indent indent) const 00045 { 00046 Superclass::PrintSelf(os,indent); 00047 00048 os << indent << "CurrentValue = " << m_CurrentValue << std::endl; 00049 os << indent << "CurrentDecomposedValue = " << m_CurrentDecomposedValue << std::endl; 00050 } 00051 00052 SetupOptimizationOptimizer::MeasureType 00053 SetupOptimizationOptimizer 00054 ::GetValue (const ParametersType ¶meters) 00055 { 00056 if (m_CostFunction.IsNull()) throwExceptionMacro("Error; cannot compute optimzer value, no cost function set."); 00057 return this->m_CostFunction->GetValue(parameters); 00058 }; 00059 00060 SetupOptimizationOptimizer::DecomposedMeasureType 00061 SetupOptimizationOptimizer 00062 ::GetDecomposedValue (const ParametersType ¶meters) 00063 { 00064 if (m_CostFunction.IsNull()) throwExceptionMacro("Error; cannot compute optimzer value, no cost function set."); 00065 this->m_CostFunction->GetValue(parameters); 00066 return this->m_CostFunction->GetCurrentDecomposedValue(); 00067 }; 00068 00069 void 00070 SetupOptimizationOptimizer:: 00071 SetCostFunction( CostFunctionType * costFunction ) 00072 { 00073 if( m_CostFunction.GetPointer() == costFunction ) 00074 { 00075 return; 00076 } 00077 00078 itkDebugMacro("setting CostFunction to " << costFunction); 00079 00080 m_CostFunction = costFunction; 00081 00082 this->Modified(); 00083 } 00084 00085 bool 00086 SetupOptimizationOptimizer:: 00087 IsStoppable() const 00088 { 00089 return false; 00090 } 00091 00092 void 00093 SetupOptimizationOptimizer:: 00094 StopOptimization() 00095 { 00096 } 00097 00098 bool 00099 SetupOptimizationOptimizer:: 00100 IsResumeable() const 00101 { 00102 return false; 00103 } 00104 00105 void 00106 SetupOptimizationOptimizer:: 00107 ResumeOptimization() 00108 { 00109 } 00110 00111 } // end namespace FREE 00112 00113
1.5.3 written by Dimitri van Heesch,
© 1997-2000