OTB  10.0.0
Orfeo Toolbox
otbScalarImageToHigherOrderTexturesFilter.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 #ifndef otbScalarImageToHigherOrderTexturesFilter_h
22 #define otbScalarImageToHigherOrderTexturesFilter_h
23 
24 #include "itkImageToImageFilter.h"
25 #include "itkScalarImageToRunLengthFeaturesFilter.h"
26 
27 namespace otb
28 {
72 template <class TInpuImage, class TOutputImage>
73 class ScalarImageToHigherOrderTexturesFilter : public itk::ImageToImageFilter<TInpuImage, TOutputImage>
74 {
75 public:
78  typedef itk::ImageToImageFilter<TInpuImage, TOutputImage> Superclass;
79  typedef itk::SmartPointer<Self> Pointer;
80  typedef itk::SmartPointer<const Self> ConstPointer;
81 
83  itkNewMacro(Self);
84 
86  itkTypeMacro(ScalarImageToHigherOrderTexturesFilter, ImageToImageFilter);
87 
89  typedef TInpuImage InputImageType;
90  typedef typename InputImageType::Pointer InputImagePointerType;
91  typedef typename InputImageType::PixelType InputPixelType;
92  typedef typename InputImageType::RegionType InputRegionType;
93  typedef typename InputRegionType::SizeType SizeType;
94  typedef TOutputImage OutputImageType;
95  typedef typename OutputImageType::Pointer OutputImagePointerType;
96  typedef typename OutputImageType::RegionType OutputRegionType;
97 
98  typedef itk::Statistics::ScalarImageToRunLengthFeaturesFilter<InputImageType> ScalarImageToRunLengthFeaturesFilterType;
99  typedef typename InputImageType::OffsetType OffsetType;
100  typedef itk::VectorContainer<unsigned char, OffsetType> OffsetVector;
101  typedef typename OffsetVector::Pointer OffsetVectorPointer;
102  typedef typename OffsetVector::ConstPointer OffsetVectorConstPointer;
103 
104 
106  itkSetMacro(Radius, SizeType);
107 
109  itkGetMacro(Radius, SizeType);
110 
113  itkSetConstObjectMacro(Offsets, OffsetVector);
114  itkGetConstObjectMacro(Offsets, OffsetVector);
116 
117  void SetOffset(const OffsetType offset);
118 
120  itkSetMacro(NumberOfBinsPerAxis, unsigned int);
121 
123  itkGetMacro(NumberOfBinsPerAxis, unsigned int);
124 
126  itkSetMacro(InputImageMinimum, InputPixelType);
127 
129  itkGetMacro(InputImageMinimum, InputPixelType);
130 
132  itkSetMacro(InputImageMaximum, InputPixelType);
133 
135  itkGetMacro(InputImageMaximum, InputPixelType);
136 
137  /* Enable/Disable fast calculation */
138  itkGetConstMacro(FastCalculations, bool);
139  itkSetMacro(FastCalculations, bool);
140  itkBooleanMacro(FastCalculations);
141 
143  itkSetMacro(SubsampleFactor, SizeType);
144 
146  itkGetMacro(SubsampleFactor, SizeType);
147 
149  itkSetMacro(SubsampleOffset, OffsetType);
150 
152  itkGetMacro(SubsampleOffset, OffsetType);
153 
156 
159 
162 
165 
168 
171 
174 
177 
180 
183 
184 protected:
187 
190 
192  void GenerateOutputInformation() override;
193 
195  void GenerateInputRequestedRegion() override;
196 
198  void DynamicThreadedGenerateData(const OutputRegionType& outputRegion) override;
199 
200 private:
202  void operator=(const Self&) = delete;
203 
205  static OutputRegionType RegionUnion(const OutputRegionType& region1, const OutputRegionType& region2);
206 
209 
212 
214  unsigned int m_NumberOfBinsPerAxis;
215 
218 
221 
224 
227 
230 };
231 } // End namespace otb
232 
233 #ifndef OTB_MANUAL_INSTANTIATION
235 #endif
236 
237 #endif
This class compute 10 local higher order statistics textures coefficients based on the grey level run...
itk::ImageToImageFilter< TInpuImage, TOutputImage > Superclass
itk::VectorContainer< unsigned char, OffsetType > OffsetVector
static OutputRegionType RegionUnion(const OutputRegionType &region1, const OutputRegionType &region2)
itk::Statistics::ScalarImageToRunLengthFeaturesFilter< InputImageType > ScalarImageToRunLengthFeaturesFilterType
void DynamicThreadedGenerateData(const OutputRegionType &outputRegion) override
ScalarImageToHigherOrderTexturesFilter(const Self &)=delete
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.