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  * Copyright UMC Utrecht and contributors
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 
19 #ifndef __itkScaledSingleValuedCostFunction_h
20 #define __itkScaledSingleValuedCostFunction_h
21 
22 #include "itkSingleValuedCostFunction.h"
23 #include "itkIntTypes.h" //temp, needed for IdentifierType
24 
25 namespace itk
26 {
39 class ScaledSingleValuedCostFunction : public SingleValuedCostFunction
40 {
41 public:
42 
45  typedef SingleValuedCostFunction Superclass;
47  typedef SmartPointer< const Self > ConstPointer;
48 
50  itkNewMacro( Self );
51 
53  itkTypeMacro( ScaledSingleValuedCostFunction, SingleValuedCostFunction );
54 
56  typedef Superclass::MeasureType MeasureType;
57  typedef Superclass::DerivativeType DerivativeType;
58  typedef Superclass::ParametersType ParametersType;
59  // temporary, untill it is fixed in the ITK4
60  //typedef IdentifierType NumberOfParametersType; // temp, copied from itk::TransformBase
61  typedef unsigned int NumberOfParametersType; // temp, copied from itk::CostFunction
62  typedef Superclass::Pointer SingleValuedCostFunctionPointer;
63 
64  typedef Array< double > ScalesType;
65 
69  virtual MeasureType GetValue( const ParametersType & parameters ) const;
70 
75  virtual void GetDerivative(
76  const ParametersType & parameters,
77  DerivativeType & derivative ) const;
78 
80  virtual void GetValueAndDerivative(
81  const ParametersType & parameters,
82  MeasureType & value,
83  DerivativeType & derivative ) const;
84 
86  virtual NumberOfParametersType GetNumberOfParameters( void ) const;
87 
89  itkSetObjectMacro( UnscaledCostFunction, Superclass );
91  itkGetObjectMacro( UnscaledCostFunction, Superclass );
92 
95  virtual void SetScales( const ScalesType & scales );
96 
98  itkGetConstReferenceMacro( Scales, ScalesType );
99 
103  virtual void SetSquaredScales( const ScalesType & squaredScales );
104 
107  itkGetConstReferenceMacro( SquaredScales, ScalesType );
108 
110  itkSetMacro( UseScales, bool );
111 
113  itkGetConstMacro( UseScales, bool );
114 
116  itkBooleanMacro( NegateCostFunction );
117 
119  itkSetMacro( NegateCostFunction, bool );
121  itkGetConstMacro( NegateCostFunction, bool );
122 
124  virtual void ConvertScaledToUnscaledParameters( ParametersType & parameters ) const;
125 
127  virtual void ConvertUnscaledToScaledParameters( ParametersType & parameters ) const;
128 
129 protected:
130 
135 
137  void PrintSelf( std::ostream & os, Indent indent ) const;
138 
139 private:
140 
142  ScaledSingleValuedCostFunction( const Self & ); // purposely not implemented
144  void operator=( const Self & ); // purposely not implemented
145 
147  ScalesType m_Scales;
148  ScalesType m_SquaredScales;
149  SingleValuedCostFunctionPointer m_UnscaledCostFunction;
152 
153 };
154 
155 } //end namespace itk
156 
157 #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 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo