ITK  4.8.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 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 
70  virtual void SetInput(const InputSpatialObjectType *object);
71 
72  virtual void SetInput(unsigned int, const InputSpatialObjectType *object);
73 
75 
76  const InputSpatialObjectType * GetInput(unsigned int idx);
77 
82  itkSetMacro(ChildrenDepth, unsigned int);
83  itkGetConstMacro(ChildrenDepth, unsigned int);
85 
86  /* Set the sampling factor of the object. The resulting pointset will have a size
87  * inversely proportional to the sampling factor.*/
88  itkSetMacro(SamplingFactor, unsigned int);
89  itkGetConstMacro(SamplingFactor, unsigned int);
90 
91 protected:
94 
95  virtual void GenerateOutputInformation() ITK_OVERRIDE {} // do nothing
96  virtual void GenerateData() ITK_OVERRIDE;
97 
98  unsigned int m_ChildrenDepth;
99 
100  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
101 
102 private:
103  SpatialObjectToPointSetFilter(const Self &); //purposely not implemented
104  void operator=(const Self &); //purposely not implemented
105 
106  unsigned int m_SamplingFactor; //default 1
107 };
108 } // end namespace itk
109 
110 #ifndef ITK_MANUAL_INSTANTIATION
111 #include "itkSpatialObjectToPointSetFilter.hxx"
112 #endif
113 
114 #endif
TInputSpatialObject::ChildrenListType ChildrenListType
Light weight base class for most itk classes.
itk::SpatialObjectPoint< itkGetStaticConstMacro(ObjectDimension) > PointType
InputSpatialObjectType::Pointer InputSpatialObjectPointer
virtual void PrintSelf(std::ostream &os, Indent indent) const override
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
const InputSpatialObjectType * GetInput()
virtual void GenerateData() override
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
virtual void SetInput(const InputSpatialObjectType *object)
virtual void SetInput(const DataObjectIdentifierType &key, DataObject *input)
Protected method for setting indexed and named inputs.
itk::PointBasedSpatialObject< itkGetStaticConstMacro(ObjectDimension) > PointBasedSpatialObjectType
Point used for spatial objets.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
InputSpatialObjectType::ConstPointer InputSpatialObjectConstPointer