ITK  4.3.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< class TInputSpatialObject, class TOutputPointSet >
34 class ITK_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 
74  const InputSpatialObjectType * GetInput(void);
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(){} // do nothing
96  virtual void GenerateData();
97 
98  unsigned int m_ChildrenDepth;
99 
100  virtual void PrintSelf(std::ostream & os, Indent indent) const;
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
115