Orfeo Toolbox  4.0
otbVectorDataToLabelMapFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ORFEO Toolbox
4  Language: C++
5  Date: $Date$
6  Version: $Revision$
7 
8 
9  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10  See OTBCopyright.txt for details.
11 
12 
13  This software is distributed WITHOUT ANY WARRANTY; without even
14  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  PURPOSE. See the above copyright notices for more information.
16 
17 =========================================================================*/
18 
19 #ifndef __otbVectorDataToLabelMapFilter_h
20 #define __otbVectorDataToLabelMapFilter_h
21 
22 #include "itkLabelObject.h"
23 #include "itkProgressReporter.h"
24 #include "itkBarrier.h"
25 #include "itkConceptChecking.h"
26 #include "itkContinuousIndex.h"
27 //#include "itkDataObject.h"
28 
29 #include "otbLabelMapSource.h"
30 #include "otbVectorData.h"
32 
33 #include <vector>
34 #include <map>
35 
36 // #include "itkImageToImageFilter.h"
37 
38 namespace otb
39 {
40 
52 template <class TVectorData, class TLabelMap>
53 class ITK_EXPORT VectorDataToLabelMapFilter :
54  public LabelMapSource <TLabelMap>
55 
56 {
57 public:
63 
65  typedef TVectorData InputVectorDataType;
66  typedef TLabelMap OutputLabelMapType;
67  typedef typename InputVectorDataType::Pointer InputVectorDataPointer;
68  typedef typename InputVectorDataType::ConstPointer InputVectorDataConstPointer;
69 
70  typedef typename OutputLabelMapType::Pointer OutputLabelMapPointer;
71  typedef typename OutputLabelMapType::ConstPointer OutputLabelMapConstPointer;
72 
73  typedef typename InputVectorDataType::DataTreeType::TreeNodeType InternalTreeNodeType;
74  typedef typename InternalTreeNodeType::ChildrenListType ChildrenListType;
75  typedef typename InputVectorDataType::DataNodeType DataNodeType;
76  typedef typename DataNodeType::Pointer DataNodePointerType;
77  typedef typename DataNodeType::PolygonType PolygonType;
78  typedef typename PolygonType::Pointer PolygonPointerType;
79  typedef typename OutputLabelMapType::LabelType LabelType;
80 
81  typedef typename OutputLabelMapType::IndexType IndexType;
82  typedef typename OutputLabelMapType::PixelType OutputLabelMapPixelType;
83  typedef typename OutputLabelMapType::PointType OriginType;
84  typedef typename OutputLabelMapType::SpacingType SpacingType;
85  typedef typename OutputLabelMapType::DirectionType DirectionType;
86 
89 
91  itkStaticConstMacro(VectorDataDimension, unsigned int,
92  TVectorData::Dimension);
93 
96 
97  typedef typename InputVectorDataType::PointType PointType;
98 
104 
106 // itkSetMacro( Size, SizeType );
107 
109 // itkSetMacro( StartIndex, IndexType );
113  itkTypeMacro(VectorDataToLabelMapFilter, ImageToImageFilter);
114 
118  itkNewMacro(Self);
119 
124  itkSetMacro(BackgroundValue, OutputLabelMapPixelType);
125  itkGetConstMacro(BackgroundValue, OutputLabelMapPixelType);
126 
128  itkSetMacro(Size, SizeType);
129 
131  itkGetConstReferenceMacro(Size, SizeType);
132 
135  itkSetMacro(Origin, OriginType);
136  virtual void SetOrigin(const double origin[2]);
137  virtual void SetOrigin(const float origin[2]);
138 
139  itkGetConstReferenceMacro(Origin, OriginType);
140 
142  itkGetConstReferenceMacro(StartIndex, IndexType);
143  itkSetMacro(StartIndex, IndexType);
146  virtual void SetSpacing(const SpacingType& spacing);
147  virtual void SetSpacing(const double spacing[2]);
148  virtual void SetSpacing(const float spacing[2]);
149 
150  itkGetConstReferenceMacro(Spacing, SpacingType);
151 
153  virtual void SetInput(const InputVectorDataType *input);
154  virtual void SetInput(unsigned int idx, const InputVectorDataType *input);
155  const InputVectorDataType * GetInput(void);
156  const InputVectorDataType * GetInput(unsigned int idx);
157 
158  virtual void GenerateOutputInformation();
159 
160 protected:
163  void PrintSelf(std::ostream& os, itk::Indent indent) const;
164 
169  virtual void GenerateData();
170 
174 // void GenerateInputRequestedRegion();
175 
180 // void EnlargeOutputRequestedRegion(itk::DataObject *itkNotUsed(output));
181 
182 private:
183  VectorDataToLabelMapFilter(const Self &); //purposely not implemented
184  void operator =(const Self&); //purposely not implemented
185 
186  void ProcessNode(InternalTreeNodeType * source);
187 
190 
191  //TODO donc need this attribute now compute with VectorDataProperties
197 
200 };
201 
202 } // end namespace itk
203 
204 #ifndef OTB_MANUAL_INSTANTIATION
206 #endif
207 
208 #endif

Generated at Sat Mar 8 2014 16:24:40 for Orfeo Toolbox with doxygen 1.8.3.1