ITK  6.0.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 * https://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
24namespace itk
25{
26
27
55template <typename TInputPointSet, typename TOutput, typename TCoordRep = float>
56class ITK_TEMPLATE_EXPORT PointSetFunction : public FunctionBase<typename TInputPointSet::PointType, TOutput>
57{
58public:
59 ITK_DISALLOW_COPY_AND_MOVE(PointSetFunction);
60
62 static constexpr unsigned int Dimension = TInputPointSet::PointDimension;
63
69
71 itkOverrideGetNameOfClassMacro(PointSetFunction);
72
74 using InputPointSetType = TInputPointSet;
75
78 using InputPixelType = typename InputPointSetType::PixelType;
79
82
84 using OutputType = TOutput;
85
87 using CoordRepType = TCoordRep;
88
93 virtual void
95
97 const InputPointSetType *
99 {
100 return m_PointSet.GetPointer();
101 }
102
105 TOutput
106 Evaluate(const InputPointType & point) const override = 0;
107
108protected:
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
Base class for all ITK function objects.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Evaluates a function of an image at specified position.
typename InputPointSetType::ConstPointer InputPointSetConstPointer
~PointSetFunction() override=default
TOutput Evaluate(const InputPointType &point) const override=0
TInputPointSet InputPointSetType
void PrintSelf(std::ostream &os, Indent indent) const override
virtual void SetInputPointSet(const InputPointSetType *ptr)
const InputPointSetType * GetInputPointSet() const
typename InputPointSetType::PixelType InputPixelType
typename InputPointSetType::PointType InputPointType
SmartPointer< const Self > ConstPointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
*par Constraints *The filter image with at least two dimensions and a vector *length of at least The theory supports extension to scalar but *the implementation of the itk vector classes do not **The template parameter TRealType must be floating point(float or double) or *a user-defined "real" numerical type with arithmetic operations defined *sufficient to compute derivatives. **\par Performance *This filter will automatically multithread if run with *SetUsePrincipleComponents