ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkObjectToObjectMetric.h
Go to the documentation of this file.
00001   /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkObjectToObjectMetric_h
00019 #define __itkObjectToObjectMetric_h
00020 
00021 #include "itkSingleValuedCostFunctionv4.h"
00022 
00023 namespace itk
00024 {
00025 
00054 class ITK_EXPORT ObjectToObjectMetric:
00055   public SingleValuedCostFunctionv4
00056 {
00057 public:
00059   typedef ObjectToObjectMetric         Self;
00060   typedef SingleValuedCostFunctionv4   Superclass;
00061   typedef SmartPointer< Self >         Pointer;
00062   typedef SmartPointer< const Self >   ConstPointer;
00063 
00065   itkTypeMacro(ObjectToObjectMetric, SingleValuedCostFunctionv4);
00066 
00068   typedef Superclass::ParametersValueType CoordinateRepresentationType;
00069 
00071   typedef double                          InternalComputationValueType;
00072 
00074   typedef  Superclass::MeasureType        MeasureType;
00075 
00077   typedef  Superclass::DerivativeType     DerivativeType;
00078 
00080   typedef  Superclass::ParametersType       ParametersType;
00081   typedef  Superclass::ParametersValueType  ParametersValueType;
00082 
00086   typedef enum  { GRADIENT_SOURCE_FIXED=0,
00087                   GRADIENT_SOURCE_MOVING,
00088                   GRADIENT_SOURCE_BOTH } GradientSourceType;
00089 
00096   itkSetMacro( GradientSource, GradientSourceType );
00097 
00102   itkGetConstMacro( GradientSource, GradientSourceType );
00103 
00106   bool GetGradientSourceIncludesFixed() const;
00107 
00110   bool GetGradientSourceIncludesMoving() const;
00111 
00116   virtual void Initialize(void) throw ( ExceptionObject ) = 0;
00117 
00120   typedef unsigned int NumberOfParametersType;
00121 
00125   virtual NumberOfParametersType GetNumberOfParameters() const = 0;
00126   virtual NumberOfParametersType GetNumberOfLocalParameters() const = 0;
00128 
00130   virtual void SetParameters( ParametersType & params ) = 0;
00131 
00133   virtual const ParametersType & GetParameters() const = 0;
00134 
00137   virtual bool HasLocalSupport() const = 0;
00138 
00145   virtual void UpdateTransformParameters( DerivativeType & derivative,
00146                                           ParametersValueType factor = NumericTraits<ParametersValueType>::One) = 0;
00147 
00148 protected:
00149   ObjectToObjectMetric();
00150   virtual ~ObjectToObjectMetric();
00151 
00152   void PrintSelf(std::ostream & os, Indent indent) const;
00153 
00154   GradientSourceType       m_GradientSource;
00155 
00156 private:
00157   ObjectToObjectMetric(const Self &); //purposely not implemented
00158   void operator=(const Self &);     //purposely not implemented
00159 
00160 };
00161 } // end namespace itk
00162 
00163 #endif
00164