KWStyle - itkBSplineInterpolationWeightFunction.h
 
Matrix View
Description

1 /*=========================================================================
2
3   Program:   Insight Segmentation & Registration Toolkit
4   Module:    $RCSfile: itkBSplineInterpolationWeightFunction.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 _itkBSplineInterpolationWeightFunction_h
18 DEF #define _itkBSplineInterpolationWeightFunction_h
19
20 #include "itkFunctionBase.h"
21 #include "itkContinuousIndex.h"
22 #include "itkBSplineKernelFunction.h"
23 #include "itkArray.h"
24 #include "itkArray2D.h"
25
26 namespace itk
27 {
28
29 /** \class BSplineInterpolationWeightFunction
30  * \brief Returns the weights over the support region used for B-spline
31  * interpolation/reconstruction.
32  *
33  * Computes/evaluate the B-spline interpolation weights over the
34  * support region of the B-spline.
35  *
36  * This class is templated over the coordinate representation type,
37  * the space dimension and the spline order.
38  *
39  * \sa Point
40  * \sa Index
41  * \sa ContinuousIndex
42  *
43  * \ingroup Functions ImageInterpolators
44  */
45 template <
46 class TCoordRep = float, 
47 unsigned int VSpaceDimension = 2,
48 unsigned int VSplineOrder = 3 
49 >
50 class ITK_EXPORT BSplineInterpolationWeightFunction : 
51 IND **public FunctionBase< ContinuousIndex<TCoordRep,VSpaceDimension>, 
52 IND ***********************Array<double> > 
53 {
54 public:
55   /** Standard class typedefs. */
56   typedef BSplineInterpolationWeightFunction Self;
57   typedef FunctionBase< ContinuousIndex<TCoordRep,VSpaceDimension>,
58 TDA,IND ************Array<double> > Superclass;
59 TDA   typedef SmartPointer<Self>  Pointer;
60 TDA   typedef SmartPointer<const Self>  ConstPointer;
61
62   /** New macro for creation of through the object factory.*/
63   itkNewMacro( Self );
64   
65   /** Run-time type information (and related methods). */
66   itkTypeMacro(BSplineInterpolationWeightFunction, FunctionBase);
67
68   /** Space dimension. */
69   itkStaticConstMacro(SpaceDimension, unsigned int, VSpaceDimension);
70
71   /** Spline order. */
72   itkStaticConstMacro(SplineOrder, unsigned int, VSplineOrder);
73
74   /** OutputType typedef support. */
75   typedef Array<double> WeightsType;
76
77   /** Index and size typedef support. */
78   typedef Index<VSpaceDimension> IndexType;
79 TDA   typedef Size<VSpaceDimension> SizeType;
80
81   /** ContinuousIndex typedef support. */
82   typedef ContinuousIndex<TCoordRep,VSpaceDimension> ContinuousIndexType;
83
84   /** Evaluate the weights at specified ContinousIndex position.
85    * Subclasses must provide this method. */
86   virtual WeightsType Evaluate( const ContinuousIndexType & index ) const;
87
88   /** Evaluate the weights at specified ContinousIndex position.
89    * The weights are returned in the user specified container.
90    * This function assume that weights can hold 
91    * (SplineOrder + 1)^(SpaceDimension) elements. For efficiency,
92    * no size checking is done. 
93    * On return, startIndex contains the start index of the
94    * support region over which the weights are defined.
95    */
96   virtual void Evaluate( const ContinuousIndexType & index,
97     WeightsType & weights, IndexType & startIndex ) const;
98
99   /** Get support region size. */
100   itkGetMacro( SupportSize, SizeType );
101
102   /** Get number of weights. */
103   itkGetMacro( NumberOfWeights, unsigned long );
104   
105 protected:
106   BSplineInterpolationWeightFunction();
107   ~BSplineInterpolationWeightFunction() {}
108   void PrintSelf(std::ostream& os, Indent indent) const;
109
110 private:
111   BSplineInterpolationWeightFunction(const Self&); //purposely not implemented
112   void operator=(const Self&); //purposely not implemented
113
114   /** Number of weights. */
115   unsigned long  m_NumberOfWeights; 
116
117   /** Size of support region. */
118   SizeType m_SupportSize;
119
120   /** Lookup table type. */
121   typedef Array2D<unsigned long> TableType;
122
123   /** Table mapping linear offset to indices. */
124   TableType m_OffsetToIndexTable;
125
126   /** Interpolation kernel type. */
127   typedef BSplineKernelFunction<itkGetStaticConstMacro(SplineOrder)>
128 IND *****KernelType;
129   
130   /** Interpolation kernel. */
131   typename KernelType::Pointer m_Kernel;
132   
133 };
134
135 // namespace itk
136
137 #ifndef ITK_MANUAL_INSTANTIATION
138 #include "itkBSplineInterpolationWeightFunction.txx"
139 #endif
140
141 #endif
142

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