ITK  5.0.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 typename TInputPointSet,
57 typename TOutput,
58 typename TCoordRep = float
59 >
60 class ITK_TEMPLATE_EXPORT PointSetFunction :
61  public FunctionBase<typename TInputPointSet::PointType, TOutput>
62 {
63 public:
64  ITK_DISALLOW_COPY_AND_ASSIGN(PointSetFunction);
65 
67  static constexpr unsigned int Dimension = TInputPointSet::PointDimension;
68 
71  using Superclass = FunctionBase
72  <typename TInputPointSet::PointType, TOutput>;
75 
77  itkTypeMacro( PointSetFunction, FunctionBase );
78 
80  using InputPointSetType = TInputPointSet;
81 
84  using InputPixelType = typename InputPointSetType::PixelType;
85 
87  using InputPointSetConstPointer = typename InputPointSetType::ConstPointer;
88 
90  using OutputType = TOutput;
91 
93  using CoordRepType = TCoordRep;
94 
99  virtual void SetInputPointSet( const InputPointSetType * ptr );
100 
103  { return m_PointSet.GetPointer(); }
104 
107  TOutput Evaluate( const InputPointType& point ) const override = 0;
108 
109 protected:
111  ~PointSetFunction() override = default;
112  void PrintSelf(std::ostream& os, Indent indent) const override;
113 
116 };
117 
118 } // end namespace itk
119 
120 // Define instantiation macro for this template.
121 #define ITK_TEMPLATE_PointSetFunction(_, EXPORT, x, y) namespace itk { \
122  _(3(class EXPORT PointSetFunction< ITK_TEMPLATE_3 x >)) \
123  namespace Templates { using PointSetFunction##y = PointSetFunction< ITK_TEMPLATE_3 x >; } \
124  }
125 
126 
127 #ifndef ITK_MANUAL_INSTANTIATION
128 # include "itkPointSetFunction.hxx"
129 #endif
130 
131 
132 #endif
Light weight base class for most itk classes.
typename InputPointSetType::PixelType InputPixelType
const InputPointSetType * GetInputPointSet() const
Base class for all ITK function objects.
Evaluates a function of an image at specified position.
InputPointSetConstPointer m_PointSet
typename InputPointSetType::ConstPointer InputPointSetConstPointer
typename InputPointSetType::PointType InputPointType
Control indentation during Print() invocation.
Definition: itkIndent.h:49