freMetricControllerBase.txx

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: freMetricControllerBase.txx,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 __freMetricControllerBase_txx
00023 #define __freMetricControllerBase_txx
00024 
00025 #include "freMetricControllerBase.h"
00026 
00027 namespace FREE
00028 {
00029 
00030 
00034 
00035 
00036 template <class TControlledMetric>
00037 MetricControllerBase<TControlledMetric>::
00038 MetricControllerBase():ComponentControllerBase<TControlledMetric>()
00039 {
00040   this->UpdateControllerID(ControllerID::MetricControllerBase);
00041   this->m_Description = "Base class for metric controller; not for practical use.";
00042 };
00043 
00044 template <class TControlledMetric>
00045 Parameter::Pointer
00046 MetricControllerBase<TControlledMetric>::
00047 GetParameter(const SessionComponentCache* pComponentCache,
00048              const std::string& sParameterName) const
00049 {
00050   if (sParameterName == cParam_MetricMinimize)
00051   {
00052     bool bMinimize = true;
00053 
00054     CtrlProfile::Parameter::Pointer smpParamInfo = this->GetProfile(pComponentCache)->Parameters().GetElement(cParam_MetricMinimize);
00055     if (smpParamInfo.IsNotNull())
00056                 {
00057       smpParamInfo->GetParameterValue(bMinimize);
00058                 }
00059 
00060     Parameter::Pointer smpParam = Parameter::New(sParameterName);
00061     smpParam->SetParameterValue(bMinimize);
00062     return smpParam;
00063   }
00064   
00065   return ComponentControllerBase<TControlledMetric>::GetParameter(pComponentCache,sParameterName);
00066 };
00067 
00068 template <class TControlledMetric>
00069 void
00070 MetricControllerBase<TControlledMetric>::
00071 GenerateProfile(CtrlProfile::ControllerProfile& profile,
00072                      const SessionComponentCache* pComponentCache,
00073                      bool bRegardOldSetup) const
00074 {
00075   Superclass::GenerateProfile(profile,pComponentCache,bRegardOldSetup);
00076 
00077   //Parameters
00078   profile.Parameters().AddParameter(cParam_MetricMinimize,Parameter::PVTBool,cParamDsc_MetricMinimize,1,"true",1,false,0,DAGet);        
00079 };
00080 
00081 } //end of namespace FREE
00082 
00083 #endif

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