OTB  9.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-2022 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:
153  NormalizeAttributesLabelMapFilter(const Self&) = delete;
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
otb::Functor::NormalizeAttributesLabelObjectFunctor::m_Max
AttributesMapType m_Max
Definition: otbNormalizeAttributesLabelMapFilter.h:86
otb::NormalizeAttributesLabelMapFilter::Superclass
LabelMapFeaturesFunctorImageFilter< ImageType, FunctorType > Superclass
Definition: otbNormalizeAttributesLabelMapFilter.h:113
otb::NormalizeAttributesLabelMapFilter::LabelObjectType
ImageType::LabelObjectType LabelObjectType
Definition: otbNormalizeAttributesLabelMapFilter.h:106
otb::NormalizeAttributesLabelMapFilter::ImageType
TImage ImageType
Definition: otbNormalizeAttributesLabelMapFilter.h:105
otb::Functor::NormalizeAttributesLabelObjectFunctor::~NormalizeAttributesLabelObjectFunctor
virtual ~NormalizeAttributesLabelObjectFunctor()
Definition: otbNormalizeAttributesLabelMapFilter.h:60
otb::NormalizeAttributesLabelMapFilter
This class works with AttributesMapLabelObject, and normalizes all attributes wrt a map of minimal an...
Definition: otbNormalizeAttributesLabelMapFilter.h:100
otb::LabelMapFeaturesFunctorImageFilter
This class applies a functor to compute new features.
Definition: otbLabelMapFeaturesFunctorImageFilter.h:53
otb::NormalizeAttributesLabelMapFilter::~NormalizeAttributesLabelMapFilter
~NormalizeAttributesLabelMapFilter() override
Definition: otbNormalizeAttributesLabelMapFilter.h:145
otb::NormalizeAttributesLabelMapFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbNormalizeAttributesLabelMapFilter.h:115
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::NormalizeAttributesLabelMapFilter::AttributesMapType
LabelObjectType::AttributesMapType AttributesMapType
Definition: otbNormalizeAttributesLabelMapFilter.h:107
otb::Functor::NormalizeAttributesLabelObjectFunctor::operator()
void operator()(LabelObjectType *lo) const
Definition: otbNormalizeAttributesLabelMapFilter.hxx:55
otb::Functor::NormalizeAttributesLabelObjectFunctor::operator!=
bool operator!=(const Self &self)
Definition: otbNormalizeAttributesLabelMapFilter.hxx:40
otb::Functor::NormalizeAttributesLabelObjectFunctor::AttributesValueType
LabelObjectType::AttributesValueType AttributesValueType
Definition: otbNormalizeAttributesLabelMapFilter.h:54
otb::Functor::NormalizeAttributesLabelObjectFunctor::Self
NormalizeAttributesLabelObjectFunctor Self
Definition: otbNormalizeAttributesLabelMapFilter.h:49
otb::Functor::NormalizeAttributesLabelObjectFunctor::m_Min
AttributesMapType m_Min
Definition: otbNormalizeAttributesLabelMapFilter.h:85
otb::Functor::NormalizeAttributesLabelObjectFunctor::LabelObjectType
TLabelObject LabelObjectType
Definition: otbNormalizeAttributesLabelMapFilter.h:52
otb::NormalizeAttributesLabelMapFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbNormalizeAttributesLabelMapFilter.h:114
otb::Functor::NormalizeAttributesLabelObjectFunctor::operator==
bool operator==(const Self &self)
Definition: otbNormalizeAttributesLabelMapFilter.hxx:49
otb::Functor::NormalizeAttributesLabelObjectFunctor::SetMinAttributesValues
void SetMinAttributesValues(const AttributesMapType &minValues)
Definition: otbNormalizeAttributesLabelMapFilter.h:74
otb::NormalizeAttributesLabelMapFilter::SetMinAttributesValues
void SetMinAttributesValues(const AttributesMapType &minValues)
Definition: otbNormalizeAttributesLabelMapFilter.h:126
otb::Functor::NormalizeAttributesLabelObjectFunctor::AttributesMapType
LabelObjectType::AttributesMapType AttributesMapType
Definition: otbNormalizeAttributesLabelMapFilter.h:53
otb::NormalizeAttributesLabelMapFilter::SetMaxAttributesValues
void SetMaxAttributesValues(const AttributesMapType &maxValues)
Definition: otbNormalizeAttributesLabelMapFilter.h:132
otb::Functor::NormalizeAttributesLabelObjectFunctor::SetMaxAttributesValues
void SetMaxAttributesValues(const AttributesMapType &maxValues)
Definition: otbNormalizeAttributesLabelMapFilter.h:79
otbNormalizeAttributesLabelMapFilter.hxx
otb::Functor::NormalizeAttributesLabelObjectFunctor::NormalizeAttributesLabelObjectFunctor
NormalizeAttributesLabelObjectFunctor()
Definition: otbNormalizeAttributesLabelMapFilter.hxx:34
otb::Functor::NormalizeAttributesLabelObjectFunctor
Functor to normalize all attributes of a LabelMap.
Definition: otbNormalizeAttributesLabelMapFilter.h:45
otbLabelMapFeaturesFunctorImageFilter.h
otb::NormalizeAttributesLabelMapFilter::NormalizeAttributesLabelMapFilter
NormalizeAttributesLabelMapFilter()
Definition: otbNormalizeAttributesLabelMapFilter.h:140
otb::NormalizeAttributesLabelMapFilter::Self
NormalizeAttributesLabelMapFilter Self
Definition: otbNormalizeAttributesLabelMapFilter.h:112
otb::NormalizeAttributesLabelMapFilter::FunctorType
Functor::NormalizeAttributesLabelObjectFunctor< LabelObjectType > FunctorType
Definition: otbNormalizeAttributesLabelMapFilter.h:109