OTB  6.7.0
Orfeo Toolbox
otbStreamingConnectedComponentSegmentationOBIAToVectorDataFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbStreamingConnectedComponentSegmentationOBIAToVectorDataFilter_h
22 #define otbStreamingConnectedComponentSegmentationOBIAToVectorDataFilter_h
23 
26 
29 #include "otbMaskMuParserFilter.h"
37 #include <string>
38 
39 namespace otb {
40 
62 template <class TVImage, class TLabelImage, class TMaskImage, class TOutputVectorData>
64 {
65 public:
71 
72  typedef TVImage VectorImageType;
73  typedef TLabelImage LabelImageType;
74  typedef TMaskImage MaskImageType;
75  typedef TOutputVectorData VectorDataType;
76 
77  typedef typename VectorImageType::Pointer VectorImagePointerType;
78  typedef typename VectorDataType::Pointer VectorDataPointerType;
79 
80  typedef typename VectorImageType::PixelType VectorImagePixelType;
81 
83  itkNewMacro(Self);
84 
87 
89  itkStaticConstMacro(InputImageDimension, unsigned int,
90  TVImage::ImageDimension);
91 
92  // Mask generation
99 
100  // mask typedef
102 
103  // Labelization
106 
110 
114 
117 
119 
121 
122 
123  /* Set the mathematical expression used for the mask */
124  itkSetStringMacro(MaskExpression);
125 
126  /* Get the mathematical expression used for the mask */
127  itkGetStringMacro(MaskExpression);
128 
129  /* Set the mathematical expression used during connected component segmentation */
130  itkSetStringMacro(ConnectedComponentExpression);
131 
132  /* Get the mathematical expression used during connected component segmentation */
133  itkGetStringMacro(ConnectedComponentExpression);
134 
135  /* Set the minimum object size */
136  itkSetMacro(MinimumObjectSize, ObjectSizeType);
137 
138  /* Get the minimum object size */
139  itkGetMacro(MinimumObjectSize, ObjectSizeType);
140 
141  /* Set the mathematical expression for filtering labelobjects */
142  itkSetStringMacro(OBIAExpression);
143 
144  /* Get the mathematical expression for filtering labelobjects */
145  itkGetStringMacro(OBIAExpression);
146 
147  /* Set shape reduced set attributes flag for object attributes computing */
148  itkSetMacro(ShapeReducedSetOfAttributes, bool);
149 
150  /* Get shape reduced set attributes flag for object attributes computing */
151  itkGetMacro(ShapeReducedSetOfAttributes, bool);
152 
153  /* Set stat reduced set attributes flag for object attributes computing */
154  itkSetMacro(StatsReducedSetOfAttributes, bool);
155 
156  /* Get stat reduced set attributes flag for object attributes computing */
157  itkGetMacro(StatsReducedSetOfAttributes, bool);
158 
159  /* Set compute polygon flag for object attributes computing */
160  itkSetMacro(ComputePolygon, bool);
161 
162  /* Get compute polygon flag for object attributes computing */
163  itkGetMacro(ComputePolygon, bool);
164 
165  /* Set compute Flusser flag for object attributes computing */
166  itkSetMacro(ComputeFlusser, bool);
167 
168  /* Get compute Flusser flag for object attributes computing */
169  itkGetMacro(ComputeFlusser, bool);
170 
171  /* Set compute perimeter flag for object attributes computing */
172  itkSetMacro(ComputePerimeter, bool);
173 
174  /* Get compute perimeter flag for object attributes computing */
175  itkGetMacro(ComputePerimeter, bool);
176 
177  /* Set compute feret diameter flag for object attributes computing */
178  itkSetMacro(ComputeFeretDiameter, bool);
179 
180  /* Get compute FeretdDiameter flag for object attributes computing */
181  itkGetMacro(ComputeFeretDiameter, bool);
182 
183 
184 protected:
186 
188 
189  void GenerateInputRequestedRegion() override;
190 private:
191 
193  std::string m_MaskExpression;
195  std::string m_OBIAExpression;
196 
197  // attributes
204 
206 };
207 
235 template <class TVImage, class TLabelImage, class TMaskImage, class TOutputVectorData>
237 {
238 public:
239 
240  // define the PersistentStreamingLineSegmentDetector template
242  TVImage, TLabelImage, TMaskImage, TOutputVectorData>
244 
249 
250  // typedef for streaming capable filter
253 };
254 
255 } // end namespace itk
256 
257 #ifndef OTB_MANUAL_INSTANTIATION
259 #endif
260 
261 #endif
[internal] Helper class to perform connected component segmentation on an input image, apply OBIA filtering and output a VectorData
convert a labeled image to a label map with adjacency information.
otb::AttributesMapLabelObject< unsigned int, InputImageDimension, double > AttributesMapLabelObjectType
otb::LabelMapToVectorDataFilter< AttributesLabelMapType, VectorDataType > LabelMapToVectorDataFilterType
Performs connected component segmentation on an input image, apply OBIA filtering and output a Vector...
This class is a LabelMap with additional adjacency information.
PersistentConnectedComponentSegmentationOBIAToVectorDataFilterType::VectorImageType VectorImageType
This class vectorizes a LabelObject to a VectorData.
This filter computes band statistics attributes for each object.
otb::BandsStatisticsAttributesLabelMapFilter< AttributesLabelMapType, VectorImageType > RadiometricLabelMapFilterType
PersistentConnectedComponentSegmentationOBIAToVectorDataFilterType::VectorDataType VectorDataType
PersistentConnectedComponentSegmentationOBIAToVectorDataFilter< TVImage, TLabelImage, TMaskImage, TOutputVectorData > PersistentConnectedComponentSegmentationOBIAToVectorDataFilterType
PersistentConnectedComponentSegmentationOBIAToVectorDataFilterType::MaskImageType MaskImageType
A LabelObject with a generic attributes map.
PersistentFilterStreamingDecorator< PersistentConnectedComponentSegmentationOBIAToVectorDataFilterType > FilterType
otb::LabelImageToLabelMapWithAdjacencyFilter< LabelImageType, AttributesLabelMapType > LabelImageToLabelMapFilterType
This class is a fork of the itk::ShapeLabelMapFilter working with AttributesMapLabelObject.
Perform vectorization in a persistent way.
itk::ConnectedComponentFunctorImageFilter< VectorImageType, LabelImageType, FunctorType, MaskImageType > ConnectedComponentFilterType
PersistentConnectedComponentSegmentationOBIAToVectorDataFilterType::LabelImageType LabelImageType
This filter link a persistent filter with a StreamingImageVirtualWriter.