ITK  6.0.0
Insight Toolkit
itkSpatialObjectToPointSetFilter.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 itkSpatialObjectToPointSetFilter_h
19#define itkSpatialObjectToPointSetFilter_h
20
21#include "itkPointSet.h"
22#include "itkDataObject.h"
23#include "itkMeshSource.h"
25
26namespace itk
27{
35template <typename TPointBasedSpatialObject, typename TOutputPointSet>
36class ITK_TEMPLATE_EXPORT SpatialObjectToPointSetFilter : public MeshSource<TOutputPointSet>
37{
38public:
39 ITK_DISALLOW_COPY_AND_MOVE(SpatialObjectToPointSetFilter);
40
46
47 using OutputPointSetType = TOutputPointSet;
49
52
54
56 itkNewMacro(Self);
57
59 itkOverrideGetNameOfClassMacro(SpatialObjectToPointSetFilter);
60
62 using PointBasedSpatialObjectType = TPointBasedSpatialObject;
65 using ChildrenListType = typename TPointBasedSpatialObject::ChildrenListType;
66
68 static constexpr unsigned int ObjectDimension = PointBasedSpatialObjectType::ObjectDimension;
69
71
73
75 using Superclass::SetInput;
76
77 void
79
80 void
82
84 const SpatialObjectType *
86 const SpatialObjectType *
87 GetInput(unsigned int idx);
94 itkSetMacro(ChildrenDepth, unsigned int);
95 itkGetConstMacro(ChildrenDepth, unsigned int);
98 /* Set the sampling factor of the object. The resulting pointset will have a
99 * size inversely proportional to the sampling factor.*/
100 itkSetMacro(SamplingFactor, unsigned int);
101 itkGetConstMacro(SamplingFactor, unsigned int);
102
103protected:
105 ~SpatialObjectToPointSetFilter() override = default;
106
107 void
109 {} // do nothing
110 void
111 GenerateData() override;
112
113 void
114 PrintSelf(std::ostream & os, Indent indent) const override;
115
116private:
117 unsigned int m_ChildrenDepth{ 0 };
118 unsigned int m_SamplingFactor{ 1 };
119};
120} // end namespace itk
121
122#ifndef ITK_MANUAL_INSTANTIATION
123# include "itkSpatialObjectToPointSetFilter.hxx"
124#endif
125
126#endif
SmartPointer< Self > Pointer
std::string DataObjectIdentifierType
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Base class for all process objects that output mesh data.
Definition: itkMeshSource.h:50
DataObject::DataObjectIdentifierType DataObjectIdentifierType
Point used for spatial objects.
Base class for filters that take a SpatialObject as input and produce a PointSet as output....
const SpatialObjectType * GetInput(unsigned int idx)
void SetInput(const DataObjectIdentifierType &key, const SpatialObjectType *object)
const SpatialObjectType * GetInput()
typename OutputPointSetType::Pointer OutputPointSetPointer
typename TPointBasedSpatialObject::ChildrenListType ChildrenListType
typename PointBasedSpatialObjectType::ConstPointer PointBasedSpatialObjectConstPointer
typename PointBasedSpatialObjectType::Pointer PointBasedSpatialObjectPointer
void PrintSelf(std::ostream &os, Indent indent) const override
void SetInput(const SpatialObjectType *input)
~SpatialObjectToPointSetFilter() override=default
Implementation of the composite pattern.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....