ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkPointSetFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkPointSetFunction_h
19 #define __itkPointSetFunction_h
20 
21 #include "itkFunctionBase.h"
22 #include "itkPoint.h"
23 
24 namespace itk
25 {
26 
27 
55 template <
56 class TInputPointSet,
57 class TOutput,
58 class TCoordRep = float
59 >
60 class ITK_EXPORT PointSetFunction :
61  public FunctionBase<typename TInputPointSet::PointType, TOutput>
62 {
63 public:
65  itkStaticConstMacro(Dimension, unsigned int,
66  TInputPointSet::PointDimension);
67 
70  typedef FunctionBase
71  <typename TInputPointSet::PointType, TOutput> Superclass;
74 
76  itkTypeMacro( PointSetFunction, FunctionBase );
77 
79  typedef TInputPointSet InputPointSetType;
80 
82  typedef typename InputPointSetType::PointType InputPointType;
83  typedef typename InputPointSetType::PixelType InputPixelType;
84 
86  typedef typename InputPointSetType::ConstPointer InputPointSetConstPointer;
87 
89  typedef TOutput OutputType;
90 
92  typedef TCoordRep CoordRepType;
93 
98  virtual void SetInputPointSet( const InputPointSetType * ptr );
99 
101  const InputPointSetType * GetInputPointSet() const
102  { return m_PointSet.GetPointer(); }
103 
106  virtual TOutput Evaluate( const InputPointType& point ) const = 0;
107 
108 protected:
110  virtual ~PointSetFunction();
111  void PrintSelf(std::ostream& os, Indent indent) const;
112 
115 
116 private:
117  PointSetFunction(const Self&); //purposely not implemented
118  void operator=(const Self&); //purposely not implemented
119 
120 };
121 
122 } // end namespace itk
123 
124 // Define instantiation macro for this template.
125 #define ITK_TEMPLATE_PointSetFunction(_, EXPORT, x, y) namespace itk { \
126  _(3(class EXPORT PointSetFunction< ITK_TEMPLATE_3 x >)) \
127  namespace Templates { typedef PointSetFunction< ITK_TEMPLATE_3 x > PointSetFunction##y; } \
128  }
129 
130 
131 #ifndef ITK_MANUAL_INSTANTIATION
132 # include "itkPointSetFunction.hxx"
133 #endif
134 
135 
136 #endif
137