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
25namespace itk
26{
39class ScaledSingleValuedCostFunction : public SingleValuedCostFunction
40{
41public:
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 MeasureType GetValue( const ParametersType & parameters ) const override;
70
76 const ParametersType & parameters,
77 DerivativeType & derivative ) const override;
78
81 const ParametersType & parameters,
82 MeasureType & value,
83 DerivativeType & derivative ) const override;
84
87
89 itkSetObjectMacro( UnscaledCostFunction, Superclass );
91 itkGetModifiableObjectMacro( 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
129protected:
130
135
137 void PrintSelf( std::ostream & os, Indent indent ) const override;
138
139private:
140
142 ScaledSingleValuedCostFunction( const Self & ); // purposely not implemented
144 void operator=( const Self & ); // purposely not implemented
145
152
153};
154
155} //end namespace itk
156
157#endif // #ifndef __itkScaledSingleValuedCostFunction_h
A cost function that applies a scaling to another cost function.
virtual void SetScales(const ScalesType &scales)
itkGetModifiableObjectMacro(UnscaledCostFunction, Superclass)
virtual void ConvertUnscaledToScaledParameters(ParametersType &parameters) const
virtual void ConvertScaledToUnscaledParameters(ParametersType &parameters) const
SingleValuedCostFunctionPointer m_UnscaledCostFunction
void PrintSelf(std::ostream &os, Indent indent) const override
virtual void SetSquaredScales(const ScalesType &squaredScales)
NumberOfParametersType GetNumberOfParameters(void) const override
void GetDerivative(const ParametersType &parameters, DerivativeType &derivative) const override
MeasureType GetValue(const ParametersType &parameters) const override
void GetValueAndDerivative(const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const override


Generated on 1667476801 for elastix by doxygen 1.9.4 elastix logo