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 
26 namespace itk
27 {
35 template <typename TPointBasedSpatialObject, typename TOutputPointSet>
36 class ITK_TEMPLATE_EXPORT SpatialObjectToPointSetFilter : public MeshSource<TOutputPointSet>
37 {
38 public:
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
78  SetInput(const SpatialObjectType * input);
79 
80  void
81  SetInput(const DataObjectIdentifierType & key, const SpatialObjectType * object);
82 
84  const SpatialObjectType *
85  GetInput();
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 
103 protected:
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 
116 private:
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
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::ProcessObject::DataObjectIdentifierType
DataObject::DataObjectIdentifierType DataObjectIdentifierType
Definition: itkProcessObject.h:162
itk::SpatialObjectToPointSetFilter
Base class for filters that take a SpatialObject as input and produce a PointSet as output....
Definition: itkSpatialObjectToPointSetFilter.h:36
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itkDataObject.h
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itk::MeshSource
Base class for all process objects that output mesh data.
Definition: itkMeshSource.h:49
itk::SpatialObjectToPointSetFilter::PointBasedSpatialObjectConstPointer
typename PointBasedSpatialObjectType::ConstPointer PointBasedSpatialObjectConstPointer
Definition: itkSpatialObjectToPointSetFilter.h:64
itkMeshSource.h
itk::SpatialObjectToPointSetFilter::OutputPointSetPointer
typename OutputPointSetType::Pointer OutputPointSetPointer
Definition: itkSpatialObjectToPointSetFilter.h:48
itk::SpatialObject
Implementation of the composite pattern.
Definition: itkSpatialObject.h:58
itk::SpatialObjectToPointSetFilter::PointBasedSpatialObjectType
TPointBasedSpatialObject PointBasedSpatialObjectType
Definition: itkSpatialObjectToPointSetFilter.h:62
itk::DataObject::DataObjectIdentifierType
std::string DataObjectIdentifierType
Definition: itkDataObject.h:304
itk::SpatialObjectToPointSetFilter::OutputPointSetType
TOutputPointSet OutputPointSetType
Definition: itkSpatialObjectToPointSetFilter.h:47
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::SpatialObjectToPointSetFilter::PointBasedSpatialObjectPointer
typename PointBasedSpatialObjectType::Pointer PointBasedSpatialObjectPointer
Definition: itkSpatialObjectToPointSetFilter.h:63
itkPointBasedSpatialObject.h
itkPointSet.h
itk::SpatialObjectToPointSetFilter::ChildrenListType
typename TPointBasedSpatialObject::ChildrenListType ChildrenListType
Definition: itkSpatialObjectToPointSetFilter.h:65
itk::DataObject::Pointer
SmartPointer< Self > Pointer
Definition: itkDataObject.h:301
itk::SpatialObjectToPointSetFilter::GenerateOutputInformation
void GenerateOutputInformation() override
Definition: itkSpatialObjectToPointSetFilter.h:108
itk::SpatialObjectPoint
Point used for spatial objects.
Definition: itkSpatialObjectPoint.h:44