OTB  9.0.0
Orfeo Toolbox
otbMinMaxAttributesLabelMapFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 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 otbMinMaxAttributesLabelMapFilter_h
22 #define otbMinMaxAttributesLabelMapFilter_h
23 
24 #include "itkLabelMapFilter.h"
25 #include "itkSimpleDataObjectDecorator.h"
26 
27 namespace otb
28 {
29 
37 template <class TInputImage>
38 class ITK_EXPORT MinMaxAttributesLabelMapFilter : public itk::LabelMapFilter<TInputImage, TInputImage>
39 {
40 public:
43  typedef itk::LabelMapFilter<TInputImage, TInputImage> Superclass;
44  typedef itk::SmartPointer<Self> Pointer;
45  typedef itk::SmartPointer<const Self> ConstPointer;
46 
48  typedef itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType;
49  typedef TInputImage InputImageType;
50  typedef typename InputImageType::Pointer InputImagePointer;
51  typedef typename InputImageType::ConstPointer InputImageConstPointer;
52  typedef typename InputImageType::RegionType InputImageRegionType;
53  typedef typename InputImageType::PixelType InputImagePixelType;
54  typedef typename InputImageType::LabelObjectType LabelObjectType;
55  typedef typename InputImageType::ConstIterator ConstIteratorType;
56 
57  typedef typename LabelObjectType::AttributesValueType AttributesValueType;
58  typedef typename LabelObjectType::AttributesMapType AttributesMapType;
59  typedef itk::SimpleDataObjectDecorator<AttributesMapType> AttributesMapObjectType;
60 
61  typedef itk::DataObject DataObjectType;
62  typedef DataObjectType::Pointer DataObjectPointerType;
63 
65  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
66 
68  itkNewMacro(Self);
69 
71  itkTypeMacro(MinMaxAttributesLabelMapFilter, LabelMapFilter);
72 
73 
76  {
77  return this->GetMinimumOutput()->Get();
78  }
79  AttributesMapObjectType* GetMinimumOutput();
80  const AttributesMapObjectType* GetMinimumOutput() const;
82 
85  {
86  return this->GetMaximumOutput()->Get();
87  }
88  AttributesMapObjectType* GetMaximumOutput();
89  const AttributesMapObjectType* GetMaximumOutput() const;
91 
92  DataObjectPointerType MakeOutput(DataObjectPointerArraySizeType idx) override;
93  using Superclass::MakeOutput;
94 
95 protected:
98 
99  void GenerateData() override;
100 
101 private:
102  MinMaxAttributesLabelMapFilter(const Self&) = delete;
103  void operator=(const Self&) = delete;
104 
105  // typedef typename InputImageType::LabelObjectContainerType LabelObjectContainerType;
106  // typedef typename LabelObjectContainerType::const_iterator LabelObjectContainerConstIterator;
107 
108 
109 }; // end of class
110 
111 } // end namespace otb
112 
113 #ifndef OTB_MANUAL_INSTANTIATION
115 #endif
116 
117 #endif
otb::MinMaxAttributesLabelMapFilter
Computes the min/max of all attributes of a LabelMap where LabelObject type is compatible with otb::A...
Definition: otbMinMaxAttributesLabelMapFilter.h:38
otb::MinMaxAttributesLabelMapFilter::AttributesMapType
LabelObjectType::AttributesMapType AttributesMapType
Definition: otbMinMaxAttributesLabelMapFilter.h:58
otb::MinMaxAttributesLabelMapFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbMinMaxAttributesLabelMapFilter.h:44
otb::MinMaxAttributesLabelMapFilter::InputImageConstPointer
InputImageType::ConstPointer InputImageConstPointer
Definition: otbMinMaxAttributesLabelMapFilter.h:51
otb::MinMaxAttributesLabelMapFilter::DataObjectPointerType
DataObjectType::Pointer DataObjectPointerType
Definition: otbMinMaxAttributesLabelMapFilter.h:62
otb::MinMaxAttributesLabelMapFilter::LabelObjectType
InputImageType::LabelObjectType LabelObjectType
Definition: otbMinMaxAttributesLabelMapFilter.h:54
otb::MinMaxAttributesLabelMapFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbMinMaxAttributesLabelMapFilter.h:45
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::MinMaxAttributesLabelMapFilter::InputImageRegionType
InputImageType::RegionType InputImageRegionType
Definition: otbMinMaxAttributesLabelMapFilter.h:52
otb::MinMaxAttributesLabelMapFilter::~MinMaxAttributesLabelMapFilter
~MinMaxAttributesLabelMapFilter() override
Definition: otbMinMaxAttributesLabelMapFilter.h:97
otb::MinMaxAttributesLabelMapFilter::InputImagePixelType
InputImageType::PixelType InputImagePixelType
Definition: otbMinMaxAttributesLabelMapFilter.h:53
otb::MinMaxAttributesLabelMapFilter::InputImageType
TInputImage InputImageType
Definition: otbMinMaxAttributesLabelMapFilter.h:49
otb::MinMaxAttributesLabelMapFilter::Self
MinMaxAttributesLabelMapFilter Self
Definition: otbMinMaxAttributesLabelMapFilter.h:42
otb::MinMaxAttributesLabelMapFilter::DataObjectType
itk::DataObject DataObjectType
Definition: otbMinMaxAttributesLabelMapFilter.h:61
otb::MinMaxAttributesLabelMapFilter::Superclass
itk::LabelMapFilter< TInputImage, TInputImage > Superclass
Definition: otbMinMaxAttributesLabelMapFilter.h:43
otb::MinMaxAttributesLabelMapFilter::GetMinimum
AttributesMapType GetMinimum() const
Definition: otbMinMaxAttributesLabelMapFilter.h:75
otb::MinMaxAttributesLabelMapFilter::ConstIteratorType
InputImageType::ConstIterator ConstIteratorType
Definition: otbMinMaxAttributesLabelMapFilter.h:55
otb::MinMaxAttributesLabelMapFilter::DataObjectPointerArraySizeType
itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
Definition: otbMinMaxAttributesLabelMapFilter.h:48
otbMinMaxAttributesLabelMapFilter.hxx
otb::MinMaxAttributesLabelMapFilter::AttributesValueType
LabelObjectType::AttributesValueType AttributesValueType
Definition: otbMinMaxAttributesLabelMapFilter.h:57
otb::MinMaxAttributesLabelMapFilter::GetMaximum
AttributesMapType GetMaximum() const
Definition: otbMinMaxAttributesLabelMapFilter.h:84
otb::MinMaxAttributesLabelMapFilter::InputImagePointer
InputImageType::Pointer InputImagePointer
Definition: otbMinMaxAttributesLabelMapFilter.h:50
otb::MinMaxAttributesLabelMapFilter::AttributesMapObjectType
itk::SimpleDataObjectDecorator< AttributesMapType > AttributesMapObjectType
Definition: otbMinMaxAttributesLabelMapFilter.h:59