OTB  10.0.0
Orfeo Toolbox
otbScalarImageToTexturesFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 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 
22 #ifndef otbScalarImageToTexturesFilter_h
23 #define otbScalarImageToTexturesFilter_h
24 
26 #include "itkImageToImageFilter.h"
27 
28 namespace otb
29 {
73 
104 template <class TInpuImage, class TOutputImage>
105 class ScalarImageToTexturesFilter : public itk::ImageToImageFilter<TInpuImage, TOutputImage>
106 {
107 public:
110  typedef itk::ImageToImageFilter<TInpuImage, TOutputImage> Superclass;
111  typedef itk::SmartPointer<Self> Pointer;
112  typedef itk::SmartPointer<const Self> ConstPointer;
113 
115  itkNewMacro(Self);
116 
118  itkTypeMacro(ScalarImageToTexturesFilter, ImageToImageFilter);
119 
121  typedef TInpuImage InputImageType;
122  typedef typename InputImageType::Pointer InputImagePointerType;
123  typedef typename InputImageType::PixelType InputPixelType;
124  typedef typename InputImageType::RegionType InputRegionType;
125  typedef typename InputRegionType::SizeType SizeType;
126  typedef typename InputImageType::OffsetType OffsetType;
127 
128  typedef TOutputImage OutputImageType;
129  typedef typename OutputImageType::Pointer OutputImagePointerType;
130  typedef typename OutputImageType::RegionType OutputRegionType;
131 
139 
140  typedef typename VectorType::iterator VectorIteratorType;
141  typedef typename VectorType::const_iterator VectorConstIteratorType;
142 
144  itkSetMacro(Radius, SizeType);
145 
147  itkGetMacro(Radius, SizeType);
148 
150  itkSetMacro(Offset, OffsetType);
151 
153  itkGetMacro(Offset, OffsetType);
154 
156  itkSetMacro(NumberOfBinsPerAxis, unsigned int);
157 
159  itkGetMacro(NumberOfBinsPerAxis, unsigned int);
160 
162  itkSetMacro(InputImageMinimum, InputPixelType);
163 
165  itkGetMacro(InputImageMinimum, InputPixelType);
166 
168  itkSetMacro(InputImageMaximum, InputPixelType);
169 
171  itkGetMacro(InputImageMaximum, InputPixelType);
172 
174  itkSetMacro(SubsampleFactor, SizeType);
175 
177  itkGetMacro(SubsampleFactor, SizeType);
178 
180  itkSetMacro(SubsampleOffset, OffsetType);
181 
183  itkGetMacro(SubsampleOffset, OffsetType);
184 
187 
190 
193 
196 
199 
202 
205 
208 
209 protected:
212 
214  ~ScalarImageToTexturesFilter() override;
215 
217  void GenerateOutputInformation() override;
218 
220  void GenerateInputRequestedRegion() override;
221 
223  void BeforeThreadedGenerateData() override;
224 
226  void DynamicThreadedGenerateData(const OutputRegionType& outputRegion) override;
227 
228 private:
230  void operator=(const Self&) = delete;
231 
233  static OutputRegionType RegionUnion(const OutputRegionType& region1, const OutputRegionType& region2);
234 
237 
240 
243 
245  unsigned int m_NumberOfBinsPerAxis;
246 
249 
252 
253  // TODO: should we use constexpr? only c++11 and problem for msvc
254  inline double GetPixelValueTolerance() const
255  {
256  return 0.0001;
257  }
258 
261 
264 };
265 } // End namespace otb
266 
267 #ifndef OTB_MANUAL_INSTANTIATION
269 #endif
270 
271 #endif
This class holds a VectorType of CooccurrencePairType with each pair is a combination of pixel index ...
itk::NumericTraits< FrequencyType >::RealType RelativeFrequencyType
itk::NumericTraits< PixelType >::RealType PixelValueType
This class compute 8 local Haralick textures features. The 8 output image channels are: Energy,...
void operator=(const Self &)=delete
void DynamicThreadedGenerateData(const OutputRegionType &outputRegion) override
VectorType::const_iterator VectorConstIteratorType
CooccurrenceIndexedListType::VectorType VectorType
CooccurrenceIndexedListType::ConstPointer CooccurrenceIndexedListConstPointerType
static OutputRegionType RegionUnion(const OutputRegionType &region1, const OutputRegionType &region2)
GreyLevelCooccurrenceIndexedList< InputPixelType > CooccurrenceIndexedListType
CooccurrenceIndexedListType::RelativeFrequencyType RelativeFrequencyType
CooccurrenceIndexedListType::PixelValueType PixelValueType
ScalarImageToTexturesFilter(const Self &)=delete
CooccurrenceIndexedListType::IndexType CooccurrenceIndexType
itk::ImageToImageFilter< TInpuImage, TOutputImage > Superclass
CooccurrenceIndexedListType::Pointer CooccurrenceIndexedListPointerType
itk::SmartPointer< const Self > ConstPointer
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.