00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __freAccuracySOMetric_h
00023 #define __freAccuracySOMetric_h
00024
00025 #include "freSetupOptimizationMultiThreadMetric.h"
00026 #include "freAccuracySOMetricMonitor.h"
00027 #include "freAccuracySOMetricThread.h"
00028
00029 #include "freImageTypes.h"
00030
00031 namespace FREE
00032 {
00033
00075 template <unsigned int VImageDimension>
00076 class ITK_EXPORT AccuracySOMetric :
00077 public SetupOptimizationMultiThreadMetric<AccuracySOMetricMonitor, AccuracySOMetricThread<VImageDimension> >
00078 {
00079 public:
00081 typedef AccuracySOMetric<VImageDimension> Self;
00082 typedef SetupOptimizationMultiThreadMetric<AccuracySOMetricMonitor,
00083 AccuracySOMetricThread<VImageDimension> > Superclass;
00084 typedef itk::SmartPointer<Self> Pointer;
00085 typedef itk::SmartPointer<const Self> ConstPointer;
00086
00087 typedef typename Superclass::MonitorType MonitorType;
00088 typedef typename Superclass::MonitorPointer MonitorPointer;
00089 typedef typename Superclass::ThreadType ThreadType;
00090 typedef typename Superclass::ThreadPointer ThreadPointer;
00091 typedef typename Superclass::EvaluationResultType EvaluationResultType;
00092 typedef typename Superclass::DecomposedMeasureType DecomposedMeasureType;
00094 itkTypeMacro( AccuracySOMetric, SetupOptimizationMultiThreadMetric );
00095
00096 itkNewMacro( Self );
00097
00098 void SetResultFieldPath(const IDPath& path);
00099 const IDPath& GetResultFieldPath() const {return m_ResultFieldPath;};
00100
00101 void SetReferenceFieldPath(const IDPath& path);
00102 const IDPath& GetReferenceFieldPath() const {return m_ReferenceFieldPath;};
00103
00104 void SetReferencePointsPath(const IDPath& path);
00105 const IDPath& GetReferencePointsPath() const {return m_ReferencePointsPath;};
00106
00107 void SetMovingPointsPath(const IDPath& path);
00108 const IDPath& GetMovingPointsPath() const {return m_MovingPointsPath;};
00109
00110 itkSetMacro( UseField, bool);
00111 itkGetMacro( UseField, bool);
00112
00113 itkSetMacro( ComputeAdaptationMean, bool);
00114 itkGetMacro( ComputeAdaptationMean, bool);
00115
00116 virtual unsigned int GetNumberOfValues(void) const {return 10;};
00117
00118 protected:
00119 AccuracySOMetric();
00120
00121 virtual ~AccuracySOMetric();
00122
00123 virtual void InitializeValueComputation() const;
00124 virtual void InitializeMonitor(MonitorType& monitor) const;
00125 virtual void InitializeThread(ThreadType& thread) const;
00126 virtual DecomposedMeasureType ComputeMeasure(MonitorType& monitor) const;
00127
00129 mutable double m_dMinError;
00131 mutable double m_dMaxError;
00133 mutable unsigned long m_lFailedProcessings;
00135 mutable unsigned long m_lCurAdaptation;
00137 mutable double m_dErrorMean;
00139 mutable double m_dErrorDev;
00141 mutable unsigned long m_lUnevaluatedPoints;
00142
00144 mutable double m_dDurMean;
00146 mutable double m_dDurDev;
00148 mutable double m_dMinDur;
00150 mutable double m_dMaxDur;
00151
00153 mutable std::vector<double> m_Errors;
00155 mutable std::vector<double> m_Vars;
00157 mutable std::vector<double> m_MinErrors;
00159 mutable std::vector<double> m_MaxErrors;
00160
00162 mutable std::vector<double> m_PointErrors;
00163
00165 mutable std::vector<long> m_Samplesize;
00167 mutable std::vector<long> m_Durations;
00168
00169 IDPath m_ResultFieldPath;
00170 IDPath m_ReferenceFieldPath;
00171 IDPath m_ReferencePointsPath;
00172 IDPath m_MovingPointsPath;
00173
00174 bool m_UseField;
00175 bool m_ComputeAdaptationMean;
00176
00186 DecomposedMeasureType ComputeFieldMeasures() const;
00196 DecomposedMeasureType ComputePointsMeasures() const;
00197
00198 private:
00199 AccuracySOMetric(const Self&);
00200 void operator=(const Self&);
00201 };
00202
00203 }
00204
00205 #ifndef ITK_MANUAL_INSTANTIATION
00206 #include "freAccuracySOMetric.txx"
00207 #endif
00208
00209 #endif
00210
00211
00212