OTB  6.1.0
Orfeo Toolbox
otbMinMaxAttributesLabelMapFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2017 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"
26 
27 namespace otb {
28 
36 template<class TInputImage>
38  public itk::LabelMapFilter<TInputImage, TInputImage>
39 {
40 public:
46 
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;
60 
63 
65  itkStaticConstMacro(InputImageDimension, unsigned int,
66  TInputImage::ImageDimension);
67 
69  itkNewMacro(Self);
70 
72  itkTypeMacro(MinMaxAttributesLabelMapFilter,
73  LabelMapFilter);
74 
75 
78  {
79  return this->GetMinimumOutput()->Get();
80  }
81  AttributesMapObjectType* GetMinimumOutput();
82  const AttributesMapObjectType* GetMinimumOutput() const;
84 
87  {
88  return this->GetMaximumOutput()->Get();
89  }
90  AttributesMapObjectType* GetMaximumOutput();
91  const AttributesMapObjectType* GetMaximumOutput() const;
93 
94  DataObjectPointerType MakeOutput(DataObjectPointerArraySizeType idx) ITK_OVERRIDE;
95  using Superclass::MakeOutput;
96 
97 protected:
100 
101  void GenerateData() ITK_OVERRIDE;
102 
103 private:
104  MinMaxAttributesLabelMapFilter(const Self&); //purposely not implemented
105  void operator=(const Self&); //purposely not implemented
106 
107  //typedef typename InputImageType::LabelObjectContainerType LabelObjectContainerType;
108  //typedef typename LabelObjectContainerType::const_iterator LabelObjectContainerConstIterator;
109 
110 
111 }; // end of class
112 
113 } // end namespace otb
114 
115 #ifndef OTB_MANUAL_INSTANTIATION
117 #endif
118 
119 #endif
120 
121 
itk::LabelMapFilter< TInputImage, TInputImage > Superclass
LabelObjectType::AttributesMapType AttributesMapType
itk::SimpleDataObjectDecorator< AttributesMapType > AttributesMapObjectType
LabelObjectType::AttributesValueType AttributesValueType
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
Computes the min/max of all attributes of a LabelMap where LabelObject type is compatible with otb::A...
itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType