freImageDifferenceSOMetricMonitor.cxx

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: freImageDifferenceSOMetricMonitor.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 "freImageDifferenceSOMetricMonitor.h"
00024 
00025 #include "itkNumericTraits.h"
00026 
00027 namespace FREE
00028 {
00029 
00033   ImageDifferenceSOMetricResult::
00034   ImageDifferenceSOMetricResult()
00035   {
00036     this->Reset();
00037   };
00038 
00039   void
00040   ImageDifferenceSOMetricResult::
00041   Reset()
00042   {
00043                 m_MinError = itk::NumericTraits< double >::max();
00044                 m_MaxError = 0.0;
00045                 m_Error = 0.0;
00046                 m_Var = 0.0;
00047 
00048     m_ImageError = 0;
00049 
00050                 m_Duration = 0;
00051     m_Samplesize = 0;
00052   };
00053 
00057 ImageDifferenceSOMetricMonitor::
00058 ImageDifferenceSOMetricMonitor()
00059 {};
00060 
00061 ImageDifferenceSOMetricMonitor::
00062 ~ImageDifferenceSOMetricMonitor()
00063 {
00064 };
00065 
00066 void
00067 ImageDifferenceSOMetricMonitor::
00068 InsertEvaluationResults(const ResultType& results)
00069 {
00070   m_Errors.push_back(results.GetError());
00071   m_Vars.push_back(results.GetVariance());
00072   m_MinErrors.push_back(results.GetMinError());
00073   m_MaxErrors.push_back(results.GetMaxError());
00074   m_ImageErrors.push_back(results.GetImageError());
00075   m_Samplesize.push_back(results.GetSamplesize());
00076   m_Durations.push_back(results.GetDuration());
00077 };
00078 
00079 void
00080 ImageDifferenceSOMetricMonitor::
00081 CopyAdaptationResults(const ResultIndexType& index, ResultType& results) const
00082 {
00083   results.SetError(m_Errors[index]);
00084   results.SetVariance(m_Vars[index]);
00085   results.SetMinError(m_MinErrors[index]);
00086   results.SetMaxError(m_MaxErrors[index]);
00087   results.SetImageError(m_ImageErrors[index]);
00088   results.SetSamplesize(m_Samplesize[index]);
00089   results.SetDuration(m_Durations[index]);
00090 };
00091 
00092 void
00093 ImageDifferenceSOMetricMonitor::
00094 EnlistResultsToStatistic(const ResultType& results, StatisticEntry& entry)
00095 {
00096   entry.AddValue(Convert::ToStr(results.GetError()),2);
00097   entry.AddValue(Convert::ToStr(sqrt(results.GetVariance())),3);
00098   entry.AddValue(Convert::ToStr(results.GetMinError()),4);
00099   entry.AddValue(Convert::ToStr(results.GetMaxError()),5);
00100   entry.AddValue(Convert::ToStr(results.GetImageError()),6);
00101   entry.AddValue(Convert::ToStr(results.GetDuration()),7);
00102 };
00103 
00104 void
00105 ImageDifferenceSOMetricMonitor::
00106 EnlistDictionaryEntries(StatisticDictionary& dictionary)
00107 {
00108   dictionary.AddValueDefinition(this->GetNameOfClass(),"Error", "Mean error; deviation in real world spacing");
00109   dictionary.AddValueDefinition(this->GetNameOfClass(),"Std dev", "Standard deviation of the error");
00110   dictionary.AddValueDefinition(this->GetNameOfClass(),"Minimum", "Minimum error");
00111   dictionary.AddValueDefinition(this->GetNameOfClass(),"Maximum", "Maximum error");
00112   dictionary.AddValueDefinition(this->GetNameOfClass(),"ImageError", "Sum of the absolute differences of an adaptation");
00113   dictionary.AddValueDefinition(this->GetNameOfClass(),"Duration", "Duration of the registration in 1/10 sec");
00114 };
00115 
00116 
00117 } // end namespace FREE

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