ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkObjectToObjectMetricBase.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 #ifndef __itkObjectToObjectMetricBase_h
19 #define __itkObjectToObjectMetricBase_h
20 
21 #include "itkTransformBase.h"
23 
24 
25 namespace itk
26 {
49 template<typename TInternalComputationValueType=double>
51  public SingleValuedCostFunctionv4Template<TInternalComputationValueType>
52 {
53 public:
59 
62 
64  typedef TInternalComputationValueType CoordinateRepresentationType;
65 
68 
71  typedef typename DerivativeType::ValueType DerivativeValueType;
72 
75  typedef TInternalComputationValueType ParametersValueType;
76 
80  typedef enum { GRADIENT_SOURCE_FIXED=0,
83 
90  itkSetMacro( GradientSource, GradientSourceType );
91 
96  itkGetConstMacro( GradientSource, GradientSourceType );
97 
100  bool GetGradientSourceIncludesFixed() const;
101 
104  bool GetGradientSourceIncludesMoving() const;
105 
110  virtual void Initialize(void) throw ( ExceptionObject ) = 0;
111 
114  typedef unsigned int NumberOfParametersType;
115 
119  virtual MeasureType GetValue() const = 0;
120 
124  virtual void GetDerivative( DerivativeType & ) const = 0;
125 
128  virtual void GetValueAndDerivative( MeasureType & value, DerivativeType & derivative ) const = 0;
129 
133  virtual NumberOfParametersType GetNumberOfParameters() const = 0;
134  virtual NumberOfParametersType GetNumberOfLocalParameters() const = 0;
136 
138  virtual void SetParameters( ParametersType & params ) = 0;
139 
141  virtual const ParametersType & GetParameters() const = 0;
142 
145  virtual bool HasLocalSupport() const = 0;
146 
153  virtual void UpdateTransformParameters( const DerivativeType & derivative,
155 
162 
163 protected:
165  virtual ~ObjectToObjectMetricBaseTemplate();
166 
167  void PrintSelf(std::ostream & os, Indent indent) const;
168 
170 
173 
174 private:
175  ObjectToObjectMetricBaseTemplate(const Self &); //purposely not implemented
176  void operator=(const Self &); //purposely not implemented
177 };
178 
180 typedef ObjectToObjectMetricBaseTemplate<double> ObjectToObjectMetricBase;
181 
182 } // end namespace itk
183 
184 #ifndef ITK_MANUAL_INSTANTIATION
185 #include "itkObjectToObjectMetricBase.hxx"
186 #endif
187 
188 #endif
virtual void GetValueAndDerivative(MeasureType &value, DerivativeType &derivative) const =0
virtual NumberOfParametersType GetNumberOfParameters() const =0
Array< TInternalComputationValueType > DerivativeType
Light weight base class for most itk classes.
SingleValuedCostFunctionv4Template< TInternalComputationValueType > Superclass
virtual MeasureType GetValue() const =0
TInternalComputationValueType ParametersValueType
Base class for all object-to-object similarlity metrics added in ITKv4.
TInternalComputationValueType CoordinateRepresentationType
virtual void GetDerivative(DerivativeType &) const =0
MeasureType GetCurrentValue() const
virtual void SetParameters(ParametersType &params)=0
virtual bool HasLocalSupport() const =0
TInternalComputationValueType ParametersValueType
Standard exception handling object.
void PrintSelf(std::ostream &os, Indent indent) const
This class is a base for a CostFunction that returns a single value.
virtual NumberOfParametersType GetNumberOfLocalParameters() const =0
Control indentation during Print() invocation.
Definition: itkIndent.h:49
virtual void UpdateTransformParameters(const DerivativeType &derivative, ParametersValueType factor=NumericTraits< ParametersValueType >::One)=0
Define additional traits for native types such as int or float.
virtual const ParametersType & GetParameters() const =0