freConsistencySOMetricController.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: freConsistencySOMetricController.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 __freConsistencySOMetricController_h
00023 #define __freConsistencySOMetricController_h
00024 
00025 #include "freSetupOptimizationMetricControllerBase.h"
00026 
00027 #include "freConsistencySOMetric.h"
00028 
00029 namespace FREE
00030 {
00031 
00040   freControllerIDMacro(ConsistencySOMetricControllerBase, "ConsistencySOMetricControllerBase");
00041 template <class TControlledMetric>
00042 class ConsistencySOMetricControllerBase : public SetupOptimizationMetricControllerBase<TControlledMetric>
00043 {
00044 public:  
00045 
00046         typedef  TControlledMetric ComponentType;
00047   typedef SetupOptimizationMetricControllerBase<ComponentType> Superclass;
00048 
00049   itkTypeMacro(ConsistencySOMetricControllerBase, SetupOptimizationMetricControllerBase);
00050 
00051 protected:
00052         ConsistencySOMetricControllerBase()
00053         {
00054                 //Profile settings
00055                 this->UpdateControllerID(ControllerID::ConsistencySOMetricControllerBase);
00056                 this->m_Description = "Base class for consistency registration metric.";
00057         };
00058 
00059   virtual void GenerateProfile(CtrlProfile::ControllerProfile& profile,
00060                   const SessionComponentCache* pComponentCache,
00061                   bool bRegardOldSetup) const
00062   {
00063     Superclass::GenerateProfile(profile,pComponentCache,bRegardOldSetup);
00064 
00065                 //Parameters
00066     profile.Parameters().AddParameter(Superclass::cParam_MetricScales,CtrlProfile::Parameter::PVTDouble,Superclass::cParamDsc_MetricScales,5,"1.0");
00067   };
00068 
00069         void
00070         SetStatisticEntryMainComponent(StatisticEntry& rStatisticEntry,
00071                                              ComponentType* pMainComponent,
00072                                              SessionComponentCache* pMainComponentCache,
00073                                              SessionInfo* pSessionInfo,
00074                                              StatisticDictionary& rDictionary) const
00075         {
00076                 typename ComponentType::DecomposedMeasureType values = pMainComponent->GetCurrentDecomposedValue();
00077 
00078     std::string sIDPath = pMainComponentCache->GetIDPath();
00079                 StatisticValueDefinition* pEntry = rDictionary.GetValueDefinitionByName(sIDPath,"mean error");
00080             
00081                 if (!pEntry) //Entry is not recorded yet, so do so.
00082                 {
00083                         pEntry = rDictionary.AddValueDefinition(sIDPath,"mean error", "mean error of the registration.");
00084                         rDictionary.AddValueDefinition(sIDPath,"std error", "standard deviation of the error.");
00085                         rDictionary.AddValueDefinition(sIDPath,"min error", "minimum error of the registration.");
00086                         rDictionary.AddValueDefinition(sIDPath,"max error", "maximum error of the registration.");
00087                         rDictionary.AddValueDefinition(sIDPath,"failure", "number of failed registration.");
00088                 }
00089           
00090                 for (unsigned int i = 0; i<values.Size(); i++)
00091                 {
00092                         rStatisticEntry.AddValue(Convert::ToStr(values[i]),pEntry->GetRefID()+i);
00093                 }
00094         };
00095 
00096 };
00097 
00106   freControllerIDMacro(Consistency2DSOMetricController, "Consistency 2D SO Metric");
00107 class Consistency2DSOMetricController : public ConsistencySOMetricControllerBase< ConsistencyRegistrationMetric<2> >
00108 {
00109 public:  
00110   typedef ConsistencyRegistrationMetric<2> ComponentType;
00111   typedef ConsistencySOMetricControllerBase<ComponentType> Superclass;
00112 
00113   itkTypeMacro(Consistency2DSOMetricController, ConsistencySOMetricControllerBase);
00114 
00115   Consistency2DSOMetricController();
00116 
00117 };
00118 
00127   freControllerIDMacro(Consistency3DSOMetricController, "Consistency 3D SO Metric");
00128 class Consistency3DSOMetricController : public ConsistencySOMetricControllerBase< ConsistencyRegistrationMetric<3> >
00129 {
00130 public:  
00131   typedef ConsistencyRegistrationMetric<3> ComponentType;
00132   typedef ConsistencySOMetricControllerBase<ComponentType> Superclass;
00133 
00134   itkTypeMacro(Consistency3DSOMetricController, ConsistencySOMetricControllerBase);
00135 
00136   Consistency3DSOMetricController();
00137 
00138 };
00139 
00140 } //end of namespace free
00141 
00142 #endif

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