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 
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 
152 
153 };
154 
155 } //end namespace itk
156 
157 #endif // #ifndef __itkScaledSingleValuedCostFunction_h
itk::ScaledSingleValuedCostFunction::m_UnscaledCostFunction
SingleValuedCostFunctionPointer m_UnscaledCostFunction
Definition: itkScaledSingleValuedCostFunction.h:149
itk::ScaledSingleValuedCostFunction::ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkScaledSingleValuedCostFunction.h:47
itk::ScaledSingleValuedCostFunction::ConvertUnscaledToScaledParameters
virtual void ConvertUnscaledToScaledParameters(ParametersType &parameters) const
itk::ScaledSingleValuedCostFunction::NumberOfParametersType
unsigned int NumberOfParametersType
Definition: itkScaledSingleValuedCostFunction.h:61
itk::ScaledSingleValuedCostFunction::m_UseScales
bool m_UseScales
Definition: itkScaledSingleValuedCostFunction.h:150
itk::ScaledSingleValuedCostFunction::ScaledSingleValuedCostFunction
ScaledSingleValuedCostFunction(const Self &)
itk::ScaledSingleValuedCostFunction::ConvertScaledToUnscaledParameters
virtual void ConvertScaledToUnscaledParameters(ParametersType &parameters) const
SmartPointer< Self >
itk::ScaledSingleValuedCostFunction::MeasureType
Superclass::MeasureType MeasureType
Definition: itkScaledSingleValuedCostFunction.h:53
itk::ScaledSingleValuedCostFunction::m_NegateCostFunction
bool m_NegateCostFunction
Definition: itkScaledSingleValuedCostFunction.h:151
itk::ScaledSingleValuedCostFunction::ParametersType
Superclass::ParametersType ParametersType
Definition: itkScaledSingleValuedCostFunction.h:58
itk::ScaledSingleValuedCostFunction
A cost function that applies a scaling to another cost function.
Definition: itkScaledSingleValuedCostFunction.h:40
itk::ScaledSingleValuedCostFunction::SingleValuedCostFunctionPointer
Superclass::Pointer SingleValuedCostFunctionPointer
Definition: itkScaledSingleValuedCostFunction.h:62
itk::ScaledSingleValuedCostFunction::Self
ScaledSingleValuedCostFunction Self
Definition: itkScaledSingleValuedCostFunction.h:44
itk::ScaledSingleValuedCostFunction::ScalesType
Array< double > ScalesType
Definition: itkScaledSingleValuedCostFunction.h:64
itk::ScaledSingleValuedCostFunction::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const
itk::ScaledSingleValuedCostFunction::GetValueAndDerivative
virtual void GetValueAndDerivative(const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
itk::ScaledSingleValuedCostFunction::m_SquaredScales
ScalesType m_SquaredScales
Definition: itkScaledSingleValuedCostFunction.h:148
itk::ScaledSingleValuedCostFunction::Superclass
SingleValuedCostFunction Superclass
Definition: itkScaledSingleValuedCostFunction.h:45
itk::ScaledSingleValuedCostFunction::m_Scales
ScalesType m_Scales
Definition: itkScaledSingleValuedCostFunction.h:147
itk::ScaledSingleValuedCostFunction::SetScales
virtual void SetScales(const ScalesType &scales)
itk::ScaledSingleValuedCostFunction::ScaledSingleValuedCostFunction
ScaledSingleValuedCostFunction()
itk::ScaledSingleValuedCostFunction::Pointer
SmartPointer< Self > Pointer
Definition: itkScaledSingleValuedCostFunction.h:46
itk::ScaledSingleValuedCostFunction::GetDerivative
virtual void GetDerivative(const ParametersType &parameters, DerivativeType &derivative) const
itk::ScaledSingleValuedCostFunction::DerivativeType
Superclass::DerivativeType DerivativeType
Definition: itkScaledSingleValuedCostFunction.h:57
unsigned int
itk::ScaledSingleValuedCostFunction::~ScaledSingleValuedCostFunction
virtual ~ScaledSingleValuedCostFunction()
Definition: itkScaledSingleValuedCostFunction.h:134
itk
Definition: itkAdvancedImageToImageMetric.h:40
itk::ScaledSingleValuedCostFunction::operator=
void operator=(const Self &)
itk::ScaledSingleValuedCostFunction::GetNumberOfParameters
virtual NumberOfParametersType GetNumberOfParameters(void) const
itk::ScaledSingleValuedCostFunction::SetSquaredScales
virtual void SetSquaredScales(const ScalesType &squaredScales)
itk::ScaledSingleValuedCostFunction::GetValue
virtual MeasureType GetValue(const ParametersType &parameters) const


Generated on OURCE_DATE_EPOCH for elastix by doxygen 1.8.18 elastix logo