ITK
4.0.0
Insight Segmentation and Registration Toolkit
|
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 00053 class ITK_EXPORT ObjectToObjectMetric: 00054 public SingleValuedCostFunctionv4 00055 { 00056 public: 00058 typedef ObjectToObjectMetric Self; 00059 typedef SingleValuedCostFunctionv4 Superclass; 00060 typedef SmartPointer< Self > Pointer; 00061 typedef SmartPointer< const Self > ConstPointer; 00062 00064 itkTypeMacro(ObjectToObjectMetric, SingleValuedCostFunctionv4); 00065 00067 typedef Superclass::ParametersValueType CoordinateRepresentationType; 00068 00070 typedef double InternalComputationValueType; 00071 00073 typedef Superclass::MeasureType MeasureType; 00074 00076 typedef Superclass::DerivativeType DerivativeType; 00077 00079 typedef Superclass::ParametersType ParametersType; 00080 typedef Superclass::ParametersValueType ParametersValueType; 00081 00085 typedef enum { GRADIENT_SOURCE_FIXED=0, 00086 GRADIENT_SOURCE_MOVING, 00087 GRADIENT_SOURCE_BOTH } GradientSourceType; 00088 00095 itkSetMacro( GradientSource, GradientSourceType ); 00096 00101 itkGetConstMacro( GradientSource, GradientSourceType ); 00102 00105 bool GetGradientSourceIncludesFixed() const; 00106 00109 bool GetGradientSourceIncludesMoving() const; 00110 00115 virtual void Initialize(void) throw ( ExceptionObject ) = 0; 00116 00119 typedef unsigned int NumberOfParametersType; 00120 00124 virtual NumberOfParametersType GetNumberOfParameters() const = 0; 00125 virtual NumberOfParametersType GetNumberOfLocalParameters() const = 0; 00127 00129 virtual const ParametersType & GetParameters() const = 0; 00130 00133 virtual bool HasLocalSupport() const = 0; 00134 00141 virtual void UpdateTransformParameters( DerivativeType & derivative, 00142 ParametersValueType factor = NumericTraits<ParametersValueType>::One) = 0; 00143 00144 protected: 00145 ObjectToObjectMetric(); 00146 virtual ~ObjectToObjectMetric(); 00147 00148 void PrintSelf(std::ostream & os, Indent indent) const; 00149 00150 GradientSourceType m_GradientSource; 00151 00152 private: 00153 ObjectToObjectMetric(const Self &); //purposely not implemented 00154 void operator=(const Self &); //purposely not implemented 00155 00156 }; 00157 } // end namespace itk 00158 00159 #endif 00160