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 TCoordinate = 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 CoordinateType = TCoordinate;
88#ifndef ITK_FUTURE_LEGACY_REMOVE
89 using CoordRepType ITK_FUTURE_DEPRECATED(
90 "ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!") = CoordinateType;
91#endif
92
97 virtual void
99
101 const InputPointSetType *
103 {
104 return m_PointSet.GetPointer();
105 }
106
109 TOutput
110 Evaluate(const InputPointType & point) const override = 0;
111
112protected:
114 ~PointSetFunction() override = default;
115 void
116 PrintSelf(std::ostream & os, Indent indent) const override;
117
120};
121
122} // end namespace itk
123
124// Define instantiation macro for this template.
125#define ITK_TEMPLATE_PointSetFunction(_, EXPORT, x, y) \
126 namespace itk \
127 { \
128 _(3(class EXPORT PointSetFunction<ITK_TEMPLATE_3 x>)) \
129 namespace Templates \
130 { \
131 using PointSetFunction##y = PointSetFunction<ITK_TEMPLATE_3 x>; \
132 } \
133 }
134
135
136#ifndef ITK_MANUAL_INSTANTIATION
137# include "itkPointSetFunction.hxx"
138#endif
139
140
141#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.
~PointSetFunction() override=default
typename InputPointSetType::ConstPointer InputPointSetConstPointer
const InputPointSetType * GetInputPointSet() const
typename InputPointSetType::PixelType InputPixelType
void PrintSelf(std::ostream &os, Indent indent) const override
typename InputPointSetType::PointType InputPointType
TOutput Evaluate(const InputPointType &point) const override=0
TInputPointSet InputPointSetType
virtual void SetInputPointSet(const InputPointSetType *ptr)
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