ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkSingleImageCostFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkSingleImageCostFunction.h,v $
5  Language: C++
6  Date: $Date$
7  Version: $Revision$
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef itkSingleImageCostFunction_h
18 #define itkSingleImageCostFunction_h
19 
20 #include "itkNumericTraits.h"
21 #include "itkExceptionObject.h"
22 #include "itkContinuousIndex.h"
28 
29 namespace itk
30 {
31 
51 template <class TImage>
52 class ITK_EXPORT SingleImageCostFunction :
54 {
55 public:
61 
63  itkNewMacro(Self);
64 
67 
70  typedef typename Superclass::MeasureType MeasureType;
71 
74  typedef typename Superclass::DerivativeType DerivativeType;
75 
78  typedef typename Superclass::ParametersType ParametersType;
79 
81  typedef TImage ImageType;
82  typedef typename TImage::PixelType ImagePixelType;
83  typedef typename ImageType::ConstPointer ImageConstPointer;
84 
86  itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
87 
89  typedef Superclass::ParametersValueType CoordRepType;
90 
96 
102 
106 
108  itkSetObjectMacro( Interpolator, InterpolatorType );
109  itkGetConstObjectMacro( Interpolator, InterpolatorType );
111 
113  itkSetConstObjectMacro( Image, ImageType );
114  itkGetConstObjectMacro( Image, ImageType );
116 
118  virtual void Initialize(void) throw ( ExceptionObject );
119 
121  unsigned int GetNumberOfParameters(void) const ITK_OVERRIDE
122  { return ImageDimension; }
123 
126  virtual MeasureType GetValue( const ParametersType & parameters ) const ITK_OVERRIDE;
127 
130  virtual void GetDerivative( const ParametersType & parameters,
131  DerivativeType & derivative ) const ITK_OVERRIDE;
132 
133 protected:
136  void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE;
137 
138 private:
139  ITK_DISALLOW_COPY_AND_ASSIGN(SingleImageCostFunction);
140 
144 
145 };
146 
147 } // end namespace itk
148 
149 #ifndef ITK_MANUAL_INSTANTIATION
150 #include "itkSingleImageCostFunction.hxx"
151 #endif
152 
153 #endif
PhysicalCentralDifferenceImageFunction< ImageType, CoordRepType > GradientImageFunctionType
This class is a cost function which queries an underlying image for the single value.
This class is a base for the CostFunctions returning a single value.
Light weight base class for most itk classes.
Superclass::ParametersValueType CoordRepType
InterpolateImageFunction< ImageType, CoordRepType > InterpolatorType
Calculate the derivative by central differencing in physical space.
Superclass::DerivativeType DerivativeType
SmartPointer< const Self > ConstPointer
Standard exception handling object.
GradientImageFunctionType::Pointer m_GradientImageFunction
Superclass::ParametersType ParametersType
Linearly interpolate an image at specified positions.
Base class for all image interpolaters.
ImageType::ConstPointer ImageConstPointer
A templated class holding a point in n-Dimensional image space.
Point< CoordRepType, ImageDimension > PointType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
InterpolatorType::Pointer m_Interpolator
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:52
Represent a n-dimensional index in a n-dimensional image.
Definition: itkIndex.h:72
ContinuousIndex< CoordRepType, ImageDimension > ContinuousIndexType
Templated n-dimensional image class.
Definition: itkImage.h:75
LinearInterpolateImageFunction< ImageType, CoordRepType > DefaultInterpolatorType