ITK  4.3.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 namespace itk
25 {
26 
49 class ITK_EXPORT ObjectToObjectMetricBase:
51 {
52 public:
58 
61 
63  typedef Superclass::ParametersValueType CoordinateRepresentationType;
64 
67 
70 
72  typedef Superclass::DerivativeType DerivativeType;
73  typedef DerivativeType::ValueType DerivativeValueType;
74 
76  typedef Superclass::ParametersType ParametersType;
77  typedef Superclass::ParametersValueType ParametersValueType;
78 
82  typedef enum { GRADIENT_SOURCE_FIXED=0,
84  GRADIENT_SOURCE_BOTH } GradientSourceType;
85 
92  itkSetMacro( GradientSource, GradientSourceType );
93 
98  itkGetConstMacro( GradientSource, GradientSourceType );
99 
102  bool GetGradientSourceIncludesFixed() const;
103 
106  bool GetGradientSourceIncludesMoving() const;
107 
112  virtual void Initialize(void) throw ( ExceptionObject ) = 0;
113 
116  typedef unsigned int NumberOfParametersType;
117 
121  virtual MeasureType GetValue() const = 0;
122 
126  virtual void GetDerivative( DerivativeType & ) const = 0;
127 
130  virtual void GetValueAndDerivative( MeasureType & value, DerivativeType & derivative ) const = 0;
131 
135  virtual NumberOfParametersType GetNumberOfParameters() const = 0;
136  virtual NumberOfParametersType GetNumberOfLocalParameters() const = 0;
138 
140  virtual void SetParameters( ParametersType & params ) = 0;
141 
143  virtual const ParametersType & GetParameters() const = 0;
144 
147  virtual bool HasLocalSupport() const = 0;
148 
155  virtual void UpdateTransformParameters( const DerivativeType & derivative,
157 
163  MeasureType GetCurrentValue() const;
164 
165 protected:
167  virtual ~ObjectToObjectMetricBase();
168 
169  void PrintSelf(std::ostream & os, Indent indent) const;
170 
171  GradientSourceType m_GradientSource;
172 
174  mutable MeasureType m_Value;
175 
176 private:
177  ObjectToObjectMetricBase(const Self &); //purposely not implemented
178  void operator=(const Self &); //purposely not implemented
179 
180 };
181 } // end namespace itk
182 
183 #endif
184