ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkSpatialObjectToPointSetFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 itkSpatialObjectToPointSetFilter_h
19 #define itkSpatialObjectToPointSetFilter_h
20 
21 #include "itkPointSet.h"
22 #include "itkMeshSource.h"
24 
25 namespace itk
26 {
33 template< typename TInputSpatialObject, typename TOutputPointSet >
34 class ITK_TEMPLATE_EXPORT SpatialObjectToPointSetFilter:public MeshSource< TOutputPointSet >
35 {
36 public:
42 
43  typedef TOutputPointSet OutputPointSetType;
44  typedef typename OutputPointSetType::Pointer OutputPointSetPointer;
45 
48 
50  itkNewMacro(Self);
51 
54 
56  typedef TInputSpatialObject InputSpatialObjectType;
57  typedef typename InputSpatialObjectType::Pointer InputSpatialObjectPointer;
58  typedef typename InputSpatialObjectType::ConstPointer InputSpatialObjectConstPointer;
59  typedef typename TInputSpatialObject::ChildrenListType ChildrenListType;
60 
62  itkStaticConstMacro(ObjectDimension, unsigned int,
63  InputSpatialObjectType::ObjectDimension);
64 
67 
69  using Superclass::SetInput;
70  virtual void SetInput(const InputSpatialObjectType *object);
71 
72  virtual void SetInput(unsigned int, const InputSpatialObjectType *object);
73 
75  const InputSpatialObjectType * GetInput();
76  const InputSpatialObjectType * GetInput(unsigned int idx);
78 
83  itkSetMacro(ChildrenDepth, unsigned int);
84  itkGetConstMacro(ChildrenDepth, unsigned int);
86 
87  /* Set the sampling factor of the object. The resulting pointset will have a size
88  * inversely proportional to the sampling factor.*/
89  itkSetMacro(SamplingFactor, unsigned int);
90  itkGetConstMacro(SamplingFactor, unsigned int);
91 
92 protected:
94  ~SpatialObjectToPointSetFilter() ITK_OVERRIDE;
95 
96  virtual void GenerateOutputInformation() ITK_OVERRIDE {} // do nothing
97  virtual void GenerateData() ITK_OVERRIDE;
98 
99  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
100 
101 private:
102  ITK_DISALLOW_COPY_AND_ASSIGN(SpatialObjectToPointSetFilter);
103 
104  unsigned int m_ChildrenDepth;
105  unsigned int m_SamplingFactor;
106 };
107 } // end namespace itk
108 
109 #ifndef ITK_MANUAL_INSTANTIATION
110 #include "itkSpatialObjectToPointSetFilter.hxx"
111 #endif
112 
113 #endif
TInputSpatialObject::ChildrenListType ChildrenListType
Light weight base class for most itk classes.
itk::SpatialObjectPoint< itkGetStaticConstMacro(ObjectDimension) > PointType
InputSpatialObjectType::Pointer InputSpatialObjectPointer
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
This class serves as the base class for point-based spatial objects.
Base class for filters that take a SpatialObject as input and produce a PointSet as output...
Base class for all process objects that output mesh data.
Definition: itkMeshSource.h:49
itk::PointBasedSpatialObject< itkGetStaticConstMacro(ObjectDimension) > PointBasedSpatialObjectType
Point used for spatial objets.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
InputSpatialObjectType::ConstPointer InputSpatialObjectConstPointer