ITK  4.9.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 
78  typedef Object ObjectType;
80 
82  itkSetConstObjectMacro( FixedObject, ObjectType );
83  itkGetConstObjectMacro( FixedObject, ObjectType );
85 
87  itkSetConstObjectMacro( MovingObject, ObjectType );
88  itkGetConstObjectMacro( MovingObject, ObjectType );
90 
94  typedef enum { GRADIENT_SOURCE_FIXED=0,
97 
104  itkSetMacro( GradientSource, GradientSourceType );
105 
110  itkGetConstMacro( GradientSource, GradientSourceType );
111 
114  bool GetGradientSourceIncludesFixed() const;
115 
118  bool GetGradientSourceIncludesMoving() const;
119 
124  virtual void Initialize(void) throw ( ExceptionObject ) = 0;
125 
128  typedef unsigned int NumberOfParametersType;
129 
133  virtual MeasureType GetValue() const ITK_OVERRIDE = 0;
134 
138  virtual void GetDerivative( DerivativeType & ) const = 0;
139 
142  virtual void GetValueAndDerivative( MeasureType & value, DerivativeType & derivative ) const ITK_OVERRIDE = 0;
143 
147  virtual NumberOfParametersType GetNumberOfParameters() const ITK_OVERRIDE = 0;
148  virtual NumberOfParametersType GetNumberOfLocalParameters() const = 0;
150 
152  virtual void SetParameters( ParametersType & params ) = 0;
153 
155  virtual const ParametersType & GetParameters() const = 0;
156 
159  virtual bool HasLocalSupport() const = 0;
160 
167  virtual void UpdateTransformParameters( const DerivativeType & derivative,
168  ParametersValueType factor = NumericTraits<ParametersValueType>::OneValue()) = 0;
169 
176 
177  typedef enum {
184 
187  {
188  return UNKNOWN_METRIC;
189  }
190 
191 protected:
194 
195  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
196 
200 
202 
205 
206 private:
207  ObjectToObjectMetricBaseTemplate(const Self &) ITK_DELETE_FUNCTION;
208  void operator=(const Self &) ITK_DELETE_FUNCTION;
209 };
210 
213 
214 } // end namespace itk
215 
216 #ifndef ITK_MANUAL_INSTANTIATION
217 #include "itkObjectToObjectMetricBase.hxx"
218 #endif
219 
220 #endif
Array< TInternalComputationValueType > DerivativeType
Light weight base class for most itk classes.
SingleValuedCostFunctionv4Template< TInternalComputationValueType > Superclass
TInternalComputationValueType ParametersValueType
Base class for all object-to-object similarlity metrics added in ITKv4.
TInternalComputationValueType CoordinateRepresentationType
virtual void GetDerivative(DerivativeType &) const =0
virtual void UpdateTransformParameters(const DerivativeType &derivative, ParametersValueType factor=NumericTraits< ParametersValueType >::OneValue())=0
virtual MetricCategoryType GetMetricCategory() const
MeasureType GetCurrentValue() const
virtual void SetParameters(ParametersType &params)=0
Class to hold and manage different parameter types used during optimization.
virtual bool HasLocalSupport() const =0
Standard exception handling object.
virtual MeasureType GetValue() const override=0
void PrintSelf(std::ostream &os, Indent indent) const override
virtual NumberOfParametersType GetNumberOfParameters() const override=0
This class is a base for a CostFunction that returns a single value.
virtual NumberOfParametersType GetNumberOfLocalParameters() const =0
virtual void GetValueAndDerivative(MeasureType &value, DerivativeType &derivative) const override=0
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Define additional traits for native types such as int or float.
Base class for most ITK classes.
Definition: itkObject.h:57
virtual const ParametersType & GetParameters() const =0