Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __itkScaledSingleValuedCostFunction_h
00016 #define __itkScaledSingleValuedCostFunction_h
00017
00018 #include "itkSingleValuedCostFunction.h"
00019
00020 namespace itk
00021 {
00034 class ScaledSingleValuedCostFunction : public SingleValuedCostFunction
00035 {
00036 public:
00037
00039 typedef ScaledSingleValuedCostFunction Self;
00040 typedef SingleValuedCostFunction Superclass;
00041 typedef SmartPointer<Self> Pointer;
00042 typedef SmartPointer<const Self> ConstPointer;
00043
00045 itkNewMacro( Self );
00046
00048 itkTypeMacro( ScaledSingleValuedCostFunction, SingleValuedCostFunction );
00049
00051 typedef Superclass::MeasureType MeasureType;
00052 typedef Superclass::DerivativeType DerivativeType;
00053 typedef Superclass::ParametersType ParametersType;
00054 typedef Superclass::Pointer SingleValuedCostFunctionPointer;
00055
00056 typedef Array<double> ScalesType;
00057
00061 virtual MeasureType GetValue( const ParametersType & parameters ) const;
00062
00067 virtual void GetDerivative(
00068 const ParametersType & parameters,
00069 DerivativeType & derivative ) const;
00070
00072 virtual void GetValueAndDerivative(
00073 const ParametersType & parameters,
00074 MeasureType & value,
00075 DerivativeType & derivative ) const;
00076
00078 virtual unsigned int GetNumberOfParameters( void ) const;
00079
00081 itkSetObjectMacro( UnscaledCostFunction, Superclass );
00083 itkGetObjectMacro( UnscaledCostFunction, Superclass );
00084
00087 virtual void SetScales( const ScalesType & scales );
00088
00090 itkGetConstReferenceMacro( Scales, ScalesType );
00091
00095 virtual void SetSquaredScales( const ScalesType & squaredScales );
00096
00099 itkGetConstReferenceMacro( SquaredScales, ScalesType );
00100
00102 itkSetMacro( UseScales, bool );
00103
00105 itkGetConstMacro( UseScales, bool );
00106
00108 itkBooleanMacro( NegateCostFunction );
00109
00111 itkSetMacro( NegateCostFunction, bool );
00113 itkGetConstMacro( NegateCostFunction, bool );
00114
00116 virtual void ConvertScaledToUnscaledParameters( ParametersType & parameters ) const;
00117
00119 virtual void ConvertUnscaledToScaledParameters( ParametersType & parameters ) const;
00120
00121 protected:
00122
00124 ScaledSingleValuedCostFunction();
00126 virtual ~ScaledSingleValuedCostFunction() {};
00127
00129 void PrintSelf( std::ostream & os, Indent indent ) const;
00130
00131 private:
00132
00134 ScaledSingleValuedCostFunction( const Self& );
00136 void operator=( const Self& );
00137
00139 ScalesType m_Scales;
00140 ScalesType m_SquaredScales;
00141 SingleValuedCostFunctionPointer m_UnscaledCostFunction;
00142 bool m_UseScales;
00143 bool m_NegateCostFunction;
00144
00145 };
00146
00147 }
00148
00149
00150 #endif // #ifndef __itkScaledSingleValuedCostFunction_h
00151