OTB  10.0.0
Orfeo Toolbox
otbNormalizeAttributesLabelMapFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1999-2011 Insight Software Consortium
3  * Copyright (C) 2005-2024 Centre National d'Etudes Spatiales (CNES)
4  *
5  * This file is part of Orfeo Toolbox
6  *
7  * https://www.orfeo-toolbox.org/
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
22 #ifndef otbNormalizeAttributesLabelMapFilter_h
23 #define otbNormalizeAttributesLabelMapFilter_h
24 
26 #include <vector>
27 
28 namespace otb
29 {
30 
31 namespace Functor
32 {
44 template <class TLabelObject>
46 {
47 public:
50 
52  typedef TLabelObject LabelObjectType;
53  typedef typename LabelObjectType::AttributesMapType AttributesMapType;
54  typedef typename LabelObjectType::AttributesValueType AttributesValueType;
55 
58 
61  {
62  }
63 
65  bool operator!=(const Self& self);
66  bool operator==(const Self& self);
68 
72  inline void operator()(LabelObjectType* lo) const;
73 
75  {
76  m_Min = minValues;
77  }
78 
80  {
81  m_Max = maxValues;
82  }
83 
84 private:
87 };
88 }
89 
99 template <class TImage>
101  : public otb::LabelMapFeaturesFunctorImageFilter<TImage, typename Functor::NormalizeAttributesLabelObjectFunctor<typename TImage::LabelObjectType>>
102 {
103 public:
105  typedef TImage ImageType;
106  typedef typename ImageType::LabelObjectType LabelObjectType;
107  typedef typename LabelObjectType::AttributesMapType AttributesMapType;
108 
110 
114  typedef itk::SmartPointer<Self> Pointer;
115  typedef itk::SmartPointer<const Self> ConstPointer;
116 
118  itkStaticConstMacro(ImageDimension, unsigned int, TImage::ImageDimension);
119 
121  itkNewMacro(Self);
122 
125 
127  {
128  this->GetFunctor().SetMinAttributesValues(minValues);
129  this->Modified();
130  }
131 
133  {
134  this->GetFunctor().SetMaxAttributesValues(maxValues);
135  this->Modified();
136  }
137 
138 protected:
141  {
142  }
143 
146  {
147  }
148 
150  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
151 
152 private:
154  void operator=(const Self&) = delete;
155 
156 }; // end of class
157 
158 } // end namespace otb
159 
160 #ifndef OTB_MANUAL_INSTANTIATION
162 #endif
163 
164 #endif
Functor to normalize all attributes of a LabelMap.
This class applies a functor to compute new features.
This class works with AttributesMapLabelObject, and normalizes all attributes wrt a map of minimal an...
void SetMinAttributesValues(const AttributesMapType &minValues)
NormalizeAttributesLabelMapFilter(const Self &)=delete
LabelMapFeaturesFunctorImageFilter< ImageType, FunctorType > Superclass
void SetMaxAttributesValues(const AttributesMapType &maxValues)
void operator=(const Self &)=delete
Functor::NormalizeAttributesLabelObjectFunctor< LabelObjectType > FunctorType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.