00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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
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
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)
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 }
00141
00142 #endif