go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkScaledSingleValuedCostFunction.h
Go to the documentation of this file.
1 /*======================================================================
2 
3  This file is part of the elastix software.
4 
5  Copyright (c) University Medical Center Utrecht. All rights reserved.
6  See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
7  details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 ======================================================================*/
14 
15 #ifndef __itkScaledSingleValuedCostFunction_h
16 #define __itkScaledSingleValuedCostFunction_h
17 
18 #include "itkSingleValuedCostFunction.h"
19 #include "itkIntTypes.h" //temp, needed for IdentifierType
20 
21 namespace itk
22 {
35 class ScaledSingleValuedCostFunction : public SingleValuedCostFunction
36 {
37 public:
38 
41  typedef SingleValuedCostFunction Superclass;
42  typedef SmartPointer< Self > Pointer;
43  typedef SmartPointer< const Self > ConstPointer;
44 
46  itkNewMacro( Self );
47 
49  itkTypeMacro( ScaledSingleValuedCostFunction, SingleValuedCostFunction );
50 
52  typedef Superclass::MeasureType MeasureType;
53  typedef Superclass::DerivativeType DerivativeType;
54  typedef Superclass::ParametersType ParametersType;
55  // temporary, untill it is fixed in the ITK4
56  //typedef IdentifierType NumberOfParametersType; // temp, copied from itk::TransformBase
57  typedef unsigned int NumberOfParametersType; // temp, copied from itk::CostFunction
58  typedef Superclass::Pointer SingleValuedCostFunctionPointer;
59 
60  typedef Array< double > ScalesType;
61 
65  virtual MeasureType GetValue( const ParametersType & parameters ) const;
66 
71  virtual void GetDerivative(
72  const ParametersType & parameters,
73  DerivativeType & derivative ) const;
74 
76  virtual void GetValueAndDerivative(
77  const ParametersType & parameters,
78  MeasureType & value,
79  DerivativeType & derivative ) const;
80 
82  virtual NumberOfParametersType GetNumberOfParameters( void ) const;
83 
85  itkSetObjectMacro( UnscaledCostFunction, Superclass );
87  itkGetObjectMacro( UnscaledCostFunction, Superclass );
88 
91  virtual void SetScales( const ScalesType & scales );
92 
94  itkGetConstReferenceMacro( Scales, ScalesType );
95 
99  virtual void SetSquaredScales( const ScalesType & squaredScales );
100 
103  itkGetConstReferenceMacro( SquaredScales, ScalesType );
104 
106  itkSetMacro( UseScales, bool );
107 
109  itkGetConstMacro( UseScales, bool );
110 
112  itkBooleanMacro( NegateCostFunction );
113 
115  itkSetMacro( NegateCostFunction, bool );
117  itkGetConstMacro( NegateCostFunction, bool );
118 
120  virtual void ConvertScaledToUnscaledParameters( ParametersType & parameters ) const;
121 
123  virtual void ConvertUnscaledToScaledParameters( ParametersType & parameters ) const;
124 
125 protected:
126 
131 
133  void PrintSelf( std::ostream & os, Indent indent ) const;
134 
135 private:
136 
138  ScaledSingleValuedCostFunction( const Self & ); // purposely not implemented
140  void operator=( const Self & ); // purposely not implemented
141 
148 
149 };
150 
151 } //end namespace itk
152 
153 #endif // #ifndef __itkScaledSingleValuedCostFunction_h
virtual void SetSquaredScales(const ScalesType &squaredScales)
virtual void ConvertUnscaledToScaledParameters(ParametersType &parameters) const
void PrintSelf(std::ostream &os, Indent indent) const
virtual MeasureType GetValue(const ParametersType &parameters) const
virtual void GetDerivative(const ParametersType &parameters, DerivativeType &derivative) const
virtual void SetScales(const ScalesType &scales)
virtual NumberOfParametersType GetNumberOfParameters(void) const
virtual void GetValueAndDerivative(const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
A cost function that applies a scaling to another cost function.
virtual void ConvertScaledToUnscaledParameters(ParametersType &parameters) const
SingleValuedCostFunctionPointer m_UnscaledCostFunction


Generated on 27-04-2014 for elastix by doxygen 1.8.6 elastix logo