ITK  5.2.0
Insight Toolkit
itkPointSetFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 <typename TInputPointSet, typename TOutput, typename TCoordRep = float>
56 class ITK_TEMPLATE_EXPORT PointSetFunction : public FunctionBase<typename TInputPointSet::PointType, TOutput>
57 {
58 public:
59  ITK_DISALLOW_COPY_AND_MOVE(PointSetFunction);
60 
62  static constexpr unsigned int Dimension = TInputPointSet::PointDimension;
63 
69 
71  itkTypeMacro(PointSetFunction, FunctionBase);
72 
74  using InputPointSetType = TInputPointSet;
75 
78  using InputPixelType = typename InputPointSetType::PixelType;
79 
81  using InputPointSetConstPointer = typename InputPointSetType::ConstPointer;
82 
84  using OutputType = TOutput;
85 
87  using CoordRepType = TCoordRep;
88 
93  virtual void
94  SetInputPointSet(const InputPointSetType * ptr);
95 
97  const InputPointSetType *
99  {
100  return m_PointSet.GetPointer();
101  }
102 
105  TOutput
106  Evaluate(const InputPointType & point) const override = 0;
107 
108 protected:
110  ~PointSetFunction() override = default;
111  void
112  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) \
122  namespace itk \
123  { \
124  _(3(class EXPORT PointSetFunction<ITK_TEMPLATE_3 x>)) \
125  namespace Templates \
126  { \
127  using PointSetFunction##y = PointSetFunction<ITK_TEMPLATE_3 x>; \
128  } \
129  }
130 
131 
132 #ifndef ITK_MANUAL_INSTANTIATION
133 # include "itkPointSetFunction.hxx"
134 #endif
135 
136 
137 #endif
itkPoint.h
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::FunctionBase< TPointSet ::PointType, TOutput >::OutputType
TOutput OutputType
Definition: itkFunctionBase.h:62
itk::PointSetFunction< TPointSet, TOutput, TCoordRep >::CoordRepType
TCoordRep CoordRepType
Definition: itkPointSetFunction.h:87
itkFunctionBase.h
itk::PointSetFunction< TPointSet, TOutput, TCoordRep >::InputPixelType
typename InputPointSetType::PixelType InputPixelType
Definition: itkPointSetFunction.h:78
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::PointSetFunction
Evaluates a function of an image at specified position.
Definition: itkPointSetFunction.h:56
itk::PointSetFunction::m_PointSet
InputPointSetConstPointer m_PointSet
Definition: itkPointSetFunction.h:115
itk::FunctionBase
Base class for all ITK function objects.
Definition: itkFunctionBase.h:44
itk::PointSetFunction< TPointSet, TOutput, TCoordRep >::InputPointSetType
TPointSet InputPointSetType
Definition: itkPointSetFunction.h:74
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::PointSetFunction< TPointSet, TOutput, TCoordRep >::InputPointSetConstPointer
typename InputPointSetType::ConstPointer InputPointSetConstPointer
Definition: itkPointSetFunction.h:81
itk::PointSetFunction< TPointSet, TOutput, TCoordRep >::InputPointType
typename InputPointSetType::PointType InputPointType
Definition: itkPointSetFunction.h:77
itk::GTest::TypedefsAndConstructors::Dimension2::Dimension
constexpr unsigned int Dimension
Definition: itkGTestTypedefsAndConstructors.h:44
itk::PointSetFunction::GetInputPointSet
const InputPointSetType * GetInputPointSet() const
Definition: itkPointSetFunction.h:98