KWStyle - itkCentralDifferenceImageFunction.h
 
Matrix View
Description

1 /*=========================================================================
2
3   Program:   Insight Segmentation & Registration Toolkit
4   Module:    $RCSfile: itkCentralDifferenceImageFunction.h.html,v $
5   Language:  C++
6   Date:      $Date: 2006/01/17 19:15:33 $
7   Version:   $Revision: 1.4 $
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 DEF #ifndef _itkCentralDifferenceImageFunction_h
18 DEF #define _itkCentralDifferenceImageFunction_h
19
20 #include "itkImageFunction.h"
21 #include "itkCovariantVector.h"
22 #include "itkImageBase.h"
23
24 namespace itk
25 {
26
27 /**
28  * \class CentralDifferenceImageFunction
29  * \brief Calculate the derivative by central differencing.
30  *
31  * This class is templated over the input image type and
32  * the coordinate representation type (e.g. float or double).
33  *
34  * Possible improvements:
35  * - the use of Neighborhood operators may improve efficiency.
36  *
37  * \ingroup ImageFunctions
38  */
39 template <
40   class TInputImage, 
41   class TCoordRep = float >
42 class ITK_EXPORT CentralDifferenceImageFunction :
43 IND **public ImageFunction< TInputImage, 
44 LEN                         CovariantVector<double, ::itk::GetImageDimension<TInputImage>::ImageDimension>, 
45 IND ************************TCoordRep >
46 {
47 public:
48   /** Dimension underlying input image. */
49   itkStaticConstMacro(ImageDimension, unsigned int,
50                       TInputImage::ImageDimension);
51
52   /** Standard class typedefs. */
53   typedef CentralDifferenceImageFunction Self;
54   typedef ImageFunction<TInputImage,
55 LEN                         CovariantVector<double, itkGetStaticConstMacro(ImageDimension)>,
56 TDA,IND ************************TCoordRep> Superclass;
57 TDA   typedef SmartPointer<Self> Pointer;
58 TDA   typedef SmartPointer<const Self>  ConstPointer;
59   
60   /** Run-time type information (and related methods). */
61   itkTypeMacro(CentralDifferenceImageFunction, ImageFunction);
62
63   /** Method for creation through the object factory. */
64   itkNewMacro(Self);
65
66   /** InputImageType typedef support. */
67   typedef TInputImage InputImageType;
68
69   /** OutputType typdef support. */
70   typedef typename Superclass::OutputType OutputType;
71
72   /** Index typedef support. */
73   typedef typename Superclass::IndexType IndexType;
74   
75   /** ContinuousIndex typedef support. */
76   typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
77
78   /** Point typedef support. */
79   typedef typename Superclass::PointType PointType;
80
81   /** Evalulate the image derivative by central differencing at specified index.
82    *
83    *  No bounds checking is done.
84    *  The point is assume to lie within the image buffer.
85    *
86    *  ImageFunction::IsInsideBuffer() can be used to check bounds before
87    * calling the method. */
88   virtual OutputType EvaluateAtIndex( const IndexType& index ) const;
89   
90 LEN   /** Evalulate the image derivative by central differencing at non-integer positions.
91    *
92    *  No bounds checking is done.
93    *  The point is assume to lie within the image buffer.
94    *
95    *  ImageFunction::IsInsideBuffer() can be used to check bounds before
96    * calling the method. */
97 IND ***virtual OutputType Evaluate( const PointType& point ) const
98     { 
99 IND ******IndexType index;
100 IND ******this->ConvertPointToNearestIndex( point, index );
101 IND ******return this->EvaluateAtIndex( index ); 
102     }
103   virtual OutputType EvaluateAtContinuousIndex( 
104     const ContinuousIndexType& cindex ) const
105     { 
106 IND ******IndexType index;
107 IND ******this->ConvertContinuousIndexToNearestIndex( cindex, index );
108 SEM,IND ******return this->EvaluateAtIndex( index ) ; 
109     }
110   
111 protected:
112   CentralDifferenceImageFunction();
113   ~CentralDifferenceImageFunction(){};
114   void PrintSelf(std::ostream& os, Indent indent) const;
115
116 private:
117   CentralDifferenceImageFunction( const Self& ); //purposely not implemented
118   void operator=( const Self& ); //purposely not implemented
119
120 };
121
122 // namespace itk
123
124 #ifndef ITK_MANUAL_INSTANTIATION
125 #include "itkCentralDifferenceImageFunction.txx"
126 #endif
127
128 #endif
129
130 EOF

Generated by KWStyle 1.0b on Tuesday January,17 at 02:14:02PM
© Kitware Inc.