forked from InsightSoftwareConsortium/ITK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
itkBackwardDifferenceOperator.h
78 lines (61 loc) · 2.47 KB
/
itkBackwardDifferenceOperator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*=========================================================================
Program: Insight Segmentation & Registration Toolkit
Module: itkBackwardDifferenceOperator.h
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Insight Software Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __itkBackwardDifferenceOperator_h
#define __itkBackwardDifferenceOperator_h
#include "itkNeighborhoodOperator.h"
#include "itkExceptionObject.h"
namespace itk {
/**
* \class BackwardDifferenceOperator
* \brief Operator whose inner product with a neighborhood returns
* a "half" derivative at the center of the neighborhood.
*
* BackwardDifferenceOperator uses backward differences
* i.e. F(x) - F(x-1) to calculate a "half" derivative useful, among
* other things, in solving differential equations. It is a directional
* NeighborhoodOperator that should be applied to a Neighborhood using the
* inner product.
*
* \ingroup Operators
*
*/
template<class TPixel, unsigned int TDimension=2,
class TAllocator = NeighborhoodAllocator<TPixel> >
class ITK_EXPORT BackwardDifferenceOperator
: public NeighborhoodOperator<TPixel, TDimension, TAllocator>
{
public:
/** Standard class typedefs. */
typedef BackwardDifferenceOperator Self;
typedef NeighborhoodOperator<TPixel, TDimension, TAllocator> Superclass;
/** From Superclass */
typedef typename Superclass::PixelType PixelType;
/** Constructor. */
BackwardDifferenceOperator() {}
protected:
/** Necessary to work around a compiler bug in VC++. */
typedef typename Superclass::CoefficientVector CoefficientVector;
/** Calculates operator coefficients. */
CoefficientVector GenerateCoefficients();
/** Arranges coefficients spatially in the memory buffer. */
void Fill(const CoefficientVector &coeff)
{ this->FillCenteredDirectional(coeff); }
private:
BackwardDifferenceOperator(const Self& other); //purposely not implemented
Self &operator=(const Self& other); //purposely not implemented
};
} // namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
#include "itkBackwardDifferenceOperator.txx"
#endif
#endif