OTB  9.0.0
Orfeo Toolbox
otbScalarImageToTexturesFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 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 ThreadedGenerateData(const OutputRegionType& outputRegion, itk::ThreadIdType threadId) override;
227 
228 private:
229  ScalarImageToTexturesFilter(const Self&) = delete;
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
otb::ScalarImageToTexturesFilter::GetPixelValueTolerance
double GetPixelValueTolerance() const
Definition: otbScalarImageToTexturesFilter.h:254
otb::ScalarImageToTexturesFilter::m_NumberOfBinsPerAxis
unsigned int m_NumberOfBinsPerAxis
Definition: otbScalarImageToTexturesFilter.h:245
otb::ScalarImageToTexturesFilter::m_InputImageMaximum
InputPixelType m_InputImageMaximum
Definition: otbScalarImageToTexturesFilter.h:251
otb::ScalarImageToTexturesFilter::GetEnergyOutput
OutputImageType * GetEnergyOutput()
Definition: otbScalarImageToTexturesFilter.hxx:70
otb::ScalarImageToTexturesFilter::m_Radius
SizeType m_Radius
Definition: otbScalarImageToTexturesFilter.h:236
otb::GreyLevelCooccurrenceIndexedList::RelativeFrequencyType
itk::NumericTraits< FrequencyType >::RealType RelativeFrequencyType
Definition: otbGreyLevelCooccurrenceIndexedList.h:91
otb::GreyLevelCooccurrenceIndexedList::PixelValueType
itk::NumericTraits< PixelType >::RealType PixelValueType
Definition: otbGreyLevelCooccurrenceIndexedList.h:94
otb::ScalarImageToTexturesFilter::Self
ScalarImageToTexturesFilter Self
Definition: otbScalarImageToTexturesFilter.h:109
otb::ScalarImageToTexturesFilter::CooccurrenceIndexedListType
GreyLevelCooccurrenceIndexedList< InputPixelType > CooccurrenceIndexedListType
Definition: otbScalarImageToTexturesFilter.h:132
otb::ScalarImageToTexturesFilter::SizeType
InputRegionType::SizeType SizeType
Definition: otbScalarImageToTexturesFilter.h:125
otb::ScalarImageToTexturesFilter
This class compute 8 local Haralick textures features. The 8 output image channels are: Energy,...
Definition: otbScalarImageToTexturesFilter.h:105
otb::ScalarImageToTexturesFilter::GetClusterShadeOutput
OutputImageType * GetClusterShadeOutput()
Definition: otbScalarImageToTexturesFilter.hxx:122
otb::ScalarImageToTexturesFilter::m_SubsampleOffset
OffsetType m_SubsampleOffset
Definition: otbScalarImageToTexturesFilter.h:263
otb::ScalarImageToTexturesFilter::m_InputImageMinimum
InputPixelType m_InputImageMinimum
Definition: otbScalarImageToTexturesFilter.h:248
otbScalarImageToTexturesFilter.hxx
otb::ScalarImageToTexturesFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbScalarImageToTexturesFilter.h:112
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::ScalarImageToTexturesFilter::OutputImagePointerType
OutputImageType::Pointer OutputImagePointerType
Definition: otbScalarImageToTexturesFilter.h:129
otb::ScalarImageToTexturesFilter::BeforeThreadedGenerateData
void BeforeThreadedGenerateData() override
Definition: otbScalarImageToTexturesFilter.hxx:247
otb::ScalarImageToTexturesFilter::operator=
void operator=(const Self &)=delete
otb::GreyLevelCooccurrenceIndexedList::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbGreyLevelCooccurrenceIndexedList.h:72
otb::ScalarImageToTexturesFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbScalarImageToTexturesFilter.h:111
otb::ScalarImageToTexturesFilter::GetEntropyOutput
OutputImageType * GetEntropyOutput()
Definition: otbScalarImageToTexturesFilter.hxx:80
otb::ScalarImageToTexturesFilter::GetInverseDifferenceMomentOutput
OutputImageType * GetInverseDifferenceMomentOutput()
Definition: otbScalarImageToTexturesFilter.hxx:101
otb::GreyLevelCooccurrenceIndexedList::VectorType
std::vector< CooccurrencePairType > VectorType
Definition: otbGreyLevelCooccurrenceIndexedList.h:111
otb::ScalarImageToTexturesFilter::VectorConstIteratorType
VectorType::const_iterator VectorConstIteratorType
Definition: otbScalarImageToTexturesFilter.h:141
otb::ScalarImageToTexturesFilter::m_SubsampleFactor
SizeType m_SubsampleFactor
Definition: otbScalarImageToTexturesFilter.h:260
otb::ScalarImageToTexturesFilter::RegionUnion
static OutputRegionType RegionUnion(const OutputRegionType &region1, const OutputRegionType &region2)
otb::ScalarImageToTexturesFilter::CooccurrenceIndexedListPointerType
CooccurrenceIndexedListType::Pointer CooccurrenceIndexedListPointerType
Definition: otbScalarImageToTexturesFilter.h:133
otb::ScalarImageToTexturesFilter::VectorType
CooccurrenceIndexedListType::VectorType VectorType
Definition: otbScalarImageToTexturesFilter.h:138
otb::ScalarImageToTexturesFilter::~ScalarImageToTexturesFilter
~ScalarImageToTexturesFilter() override
Definition: otbScalarImageToTexturesFilter.hxx:65
otb::ScalarImageToTexturesFilter::GenerateOutputInformation
void GenerateOutputInformation() override
Definition: otbScalarImageToTexturesFilter.hxx:154
otb::ScalarImageToTexturesFilter::Superclass
itk::ImageToImageFilter< TInpuImage, TOutputImage > Superclass
Definition: otbScalarImageToTexturesFilter.h:110
otbGreyLevelCooccurrenceIndexedList.h
otb::ScalarImageToTexturesFilter::InputRegionType
InputImageType::RegionType InputRegionType
Definition: otbScalarImageToTexturesFilter.h:124
otb::ScalarImageToTexturesFilter::OffsetType
InputImageType::OffsetType OffsetType
Definition: otbScalarImageToTexturesFilter.h:126
otb::ScalarImageToTexturesFilter::CooccurrenceIndexedListConstPointerType
CooccurrenceIndexedListType::ConstPointer CooccurrenceIndexedListConstPointerType
Definition: otbScalarImageToTexturesFilter.h:134
otb::ScalarImageToTexturesFilter::m_NeighborhoodRadius
SizeType m_NeighborhoodRadius
Definition: otbScalarImageToTexturesFilter.h:242
otb::ScalarImageToTexturesFilter::ThreadedGenerateData
void ThreadedGenerateData(const OutputRegionType &outputRegion, itk::ThreadIdType threadId) override
Definition: otbScalarImageToTexturesFilter.hxx:262
otb::ScalarImageToTexturesFilter::GetInertiaOutput
OutputImageType * GetInertiaOutput()
Definition: otbScalarImageToTexturesFilter.hxx:111
otb::ScalarImageToTexturesFilter::InputImagePointerType
InputImageType::Pointer InputImagePointerType
Definition: otbScalarImageToTexturesFilter.h:122
otb::ScalarImageToTexturesFilter::m_Offset
OffsetType m_Offset
Definition: otbScalarImageToTexturesFilter.h:239
otb::ScalarImageToTexturesFilter::OutputRegionType
OutputImageType::RegionType OutputRegionType
Definition: otbScalarImageToTexturesFilter.h:130
otb::GreyLevelCooccurrenceIndexedList::IndexType
itk::Index< PixelPairSize > IndexType
Definition: otbGreyLevelCooccurrenceIndexedList.h:85
otb::ScalarImageToTexturesFilter::RelativeFrequencyType
CooccurrenceIndexedListType::RelativeFrequencyType RelativeFrequencyType
Definition: otbScalarImageToTexturesFilter.h:137
otb::ScalarImageToTexturesFilter::VectorIteratorType
VectorType::iterator VectorIteratorType
Definition: otbScalarImageToTexturesFilter.h:140
otb::GreyLevelCooccurrenceIndexedList::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbGreyLevelCooccurrenceIndexedList.h:73
otb::ScalarImageToTexturesFilter::GetClusterProminenceOutput
OutputImageType * GetClusterProminenceOutput()
Definition: otbScalarImageToTexturesFilter.hxx:133
otb::ScalarImageToTexturesFilter::CooccurrenceIndexType
CooccurrenceIndexedListType::IndexType CooccurrenceIndexType
Definition: otbScalarImageToTexturesFilter.h:135
otb::ScalarImageToTexturesFilter::PixelValueType
CooccurrenceIndexedListType::PixelValueType PixelValueType
Definition: otbScalarImageToTexturesFilter.h:136
otb::ScalarImageToTexturesFilter::GetHaralickCorrelationOutput
OutputImageType * GetHaralickCorrelationOutput()
Definition: otbScalarImageToTexturesFilter.hxx:144
otb::ScalarImageToTexturesFilter::OutputImageType
TOutputImage OutputImageType
Definition: otbScalarImageToTexturesFilter.h:128
otb::ScalarImageToTexturesFilter::InputImageType
TInpuImage InputImageType
Definition: otbScalarImageToTexturesFilter.h:118
otb::ScalarImageToTexturesFilter::InputPixelType
InputImageType::PixelType InputPixelType
Definition: otbScalarImageToTexturesFilter.h:123
otb::GreyLevelCooccurrenceIndexedList
This class holds a VectorType of CooccurrencePairType with each pair is a combination of pixel index ...
Definition: otbGreyLevelCooccurrenceIndexedList.h:66
otb::ScalarImageToTexturesFilter::ScalarImageToTexturesFilter
ScalarImageToTexturesFilter()
Definition: otbScalarImageToTexturesFilter.hxx:37
otb::ScalarImageToTexturesFilter::GetCorrelationOutput
OutputImageType * GetCorrelationOutput()
Definition: otbScalarImageToTexturesFilter.hxx:90
otb::ScalarImageToTexturesFilter::GenerateInputRequestedRegion
void GenerateInputRequestedRegion() override
Definition: otbScalarImageToTexturesFilter.hxx:184