00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __frePrecisionSOMetric_h
00023 #define __frePrecisionSOMetric_h
00024
00025 #include "freSetupOptimizationMetric.h"
00026
00027 namespace FREE
00028 {
00029
00049 template <unsigned int VImageDimension>
00050 class ITK_EXPORT PrecisionSOMetric :
00051 public SetupOptimizationMetric
00052 {
00053 public:
00055 typedef PrecisionSOMetric<VImageDimension> Self;
00056 typedef SetupOptimizationMetric Superclass;
00057 typedef itk::SmartPointer<Self> Pointer;
00058 typedef itk::SmartPointer<const Self> ConstPointer;
00059
00060 typedef typename Superclass::DecomposedMeasureType DecomposedMeasureType;
00061
00063 itkTypeMacro( PrecisionSOMetric, SetupOptimizationMetric );
00064
00065 itkNewMacro( Self );
00066
00067 void SetResultFieldPath(const IDPath& path);
00068 IDPath& GetResultFieldPath() const {return m_ResultFieldPath;};
00069
00070 void SetInterimFieldPath(const std::string& path);
00071 IDPath& GetInterimFieldPath() const {return m_InterimFieldPath;};
00072
00073 itkSetMacro( SaveInterimOnDisc, bool);
00074 itkGetMacro( SaveInterimOnDisc, bool);
00075
00076 itkSetMacro( SampleSize, unsigned long);
00077 itkGetMacro( SampleSize, unsigned long);
00078
00079 virtual unsigned int GetNumberOfValues(void) const {return 5;};
00080
00081 protected:
00082 PrecisionSOMetric();
00083
00084 virtual ~PrecisionSOMetric() {};
00085
00086 typedef typename ImageTypes<VImageDimension>::TransformationFieldType TransformationFieldType;
00087
00088 typename ProgressEvent< PrecisionSOMetric<VImageDimension> >::Pointer m_IterationEvent;
00089
00096 void OnEvaluationProgress(const long status, const std::string& sComment, void* pSender, long threadID);
00097
00098 virtual DecomposedMeasureType ComputeDecomposedValue( const ParametersType & parameters ) const;
00099
00100 mutable Setup::Pointer m_smpSetup;
00101
00102 mutable double m_dMinError;
00103 mutable double m_dMaxError;
00104 mutable unsigned long m_lFailedRegistrations;
00105 mutable unsigned long m_lActAdaptation;
00106 mutable double m_dErrorMean;
00107 mutable double m_dErrorVar;
00108
00109 IDPath m_ResultFieldPath;
00110
00111 std::string m_InterimFieldPath;
00112
00113 bool m_SaveInterimOnDisc;
00114
00115 unsigned long m_SampleSize;
00116
00117 private:
00118 PrecisionSOMetric(const Self&);
00119 void operator=(const Self&);
00120 };
00121
00122 }
00123
00124 #ifndef ITK_MANUAL_INSTANTIATION
00125 #include "frePrecisionSOMetric.txx"
00126 #endif
00127
00128 #endif
00129
00130
00131