| 1 |
|
/*========================================================================= |
| 2 |
|
|
| 3 |
|
Program: Insight Segmentation & Registration Toolkit |
| 4 |
|
Module: $RCSfile: itkForwardDifferenceOperator.h.html,v $ |
| 5 |
|
Language: C++ |
| 6 |
|
Date: $Date: 2006/01/17 19:15:35 $ |
| 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 |
|
#ifndef __itkForwardDifferenceOperator_h |
| 18 |
|
#define __itkForwardDifferenceOperator_h |
| 19 |
|
|
| 20 |
|
#include "itkNeighborhoodOperator.h" |
| 21 |
|
#include "itkExceptionObject.h" |
| 22 |
|
|
| 23 |
|
namespace itk { |
| 24 |
|
|
| 25 |
|
/** |
| 26 |
|
* \class ForwardDifferenceOperator |
| 27 |
|
* \brief Operator whose inner product with a neighborhood returns |
| 28 |
|
* a "half" derivative at the center of the neighborhood. |
| 29 |
|
* |
| 30 |
|
* ForwardDifferenceOperator uses forward differences |
| 31 |
|
* i.e. F(x+1) - F(x) to calculate a "half" derivative useful, among |
| 32 |
|
* other things, in solving differential equations. It is a directional |
| 33 |
|
* NeighborhoodOperator that should be applied to a Neighborhood using the |
| 34 |
|
* inner product. |
| 35 |
|
* |
| 36 |
|
* \ingroup Operators |
| 37 |
|
*/ |
| 38 |
|
template<class TPixel, unsigned int VDimension=2, |
| 39 |
|
class TAllocator = NeighborhoodAllocator<TPixel> > |
| 40 |
|
class ITK_EXPORT ForwardDifferenceOperator |
| 41 |
IND |
**: public NeighborhoodOperator<TPixel, VDimension, TAllocator> |
| 42 |
|
{ |
| 43 |
|
public: |
| 44 |
|
/** Standard class typedefs. */ |
| 45 |
|
typedef ForwardDifferenceOperator Self; |
| 46 |
TDA |
typedef NeighborhoodOperator<TPixel, VDimension, TAllocator> Superclass; |
| 47 |
|
|
| 48 |
|
typedef typename Superclass::PixelType PixelType; |
| 49 |
|
|
| 50 |
|
/** Constructor. */ |
| 51 |
|
ForwardDifferenceOperator() {} |
| 52 |
|
|
| 53 |
|
/** Copy constructor */ |
| 54 |
|
ForwardDifferenceOperator(const Self& other) |
| 55 |
IND |
****: NeighborhoodOperator<TPixel, VDimension, TAllocator>(other) |
| 56 |
IND |
**{ } |
| 57 |
|
|
| 58 |
|
/** Assignment operator */ |
| 59 |
|
Self &operator=(const Self& other) |
| 60 |
IND |
**{ |
| 61 |
|
Superclass::operator=(other); |
| 62 |
|
return *this; |
| 63 |
IND |
**} |
| 64 |
|
|
| 65 |
|
protected: |
| 66 |
|
/** Necessary to work around VC++ compiler bug. */ |
| 67 |
|
typedef typename Superclass::CoefficientVector CoefficientVector; |
| 68 |
|
|
| 69 |
|
/** Calculates operator coefficients. */ |
| 70 |
|
CoefficientVector GenerateCoefficients(); |
| 71 |
|
|
| 72 |
|
/** Arranges coefficients spatially in the memory buffer. */ |
| 73 |
|
void Fill(const CoefficientVector &coeff) |
| 74 |
|
|
| 75 |
|
{ this->FillCenteredDirectional(coeff); } |
| 76 |
|
|
| 77 |
|
}; |
| 78 |
|
|
| 79 |
|
|
| 80 |
|
} // namespace itk |
| 81 |
|
|
| 82 |
|
#ifndef ITK_MANUAL_INSTANTIATION |
| 83 |
|
#include "itkForwardDifferenceOperator.txx" |
| 84 |
|
#endif |
| 85 |
|
|
| 86 |
|
#endif |
| 87 |
|
|
| 88 |
EOF |
|
| 89 |
EOF,EML |
|