OTB  9.0.0
Orfeo Toolbox
otbWaveletTransform.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
3  * Copyright (C) 2007-2012 Institut Mines Telecom / Telecom Bretagne
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 
23 #ifndef otbWaveletTransform_h
24 #define otbWaveletTransform_h
25 
28 #include "otbObjectList.h"
29 #include "otbWaveletGenerator.h"
30 #include "otbWaveletOperatorBase.h"
31 
32 namespace otb
33 {
34 
57 template <class TInputImage, class TOutputImage, class TFilter, Wavelet::WaveletDirection TDirectionOfTransformation>
58 class ITK_EXPORT WaveletTransform : public itk::ImageSource<TOutputImage>
59 {
60 public:
63  typedef itk::ImageSource<TOutputImage> Superclass;
64  typedef itk::SmartPointer<Self> Pointer;
65  typedef itk::SmartPointer<const Self> ConstPointer;
66 
68  itkNewMacro(Self);
69 
71  itkTypeMacro(WaveletTransform, ImageSource);
72 
73 protected:
76  virtual ~WaveletTransform();
78 
79 private:
80  WaveletTransform(const Self&);
81  void operator=(const Self&);
82 };
83 
108 template <class TInputImage, class TOutputImage, class TFilter>
109 class ITK_EXPORT WaveletTransform<TInputImage, TOutputImage, TFilter, Wavelet::FORWARD> : public ImageToImageListFilter<TInputImage, TOutputImage>
110 {
111 public:
115  typedef itk::SmartPointer<Self> Pointer;
116  typedef itk::SmartPointer<const Self> ConstPointer;
117 
119  itkNewMacro(Self);
120 
123 
124  typedef TInputImage InputImageType;
125  typedef typename InputImageType::Pointer InputImagePointerType;
126  typedef typename InputImageType::ConstPointer InputImageConstPointerType;
127  typedef typename InputImageType::RegionType InputImageRegionType;
128  typedef typename InputImageType::PixelType InputImagePixelType;
129  typedef typename InputImageType::SizeType SizeType;
130  typedef typename InputImageType::ValueType ValueType;
131 
132  typedef typename Superclass::OutputImageType OutputImageType;
133  typedef typename Superclass::OutputImagePointerType OutputImagePointerType;
134  typedef typename Superclass::OutputImageListType OutputImageListType;
137 
138  typedef TFilter FilterType;
139  typedef typename FilterType::Pointer FilterPointerType;
143 
144  itkGetObjectMacro(FilterList, FilterListType);
145  FilterType* GetNthFilter(unsigned int idx) const
146  {
147  if (idx >= m_NumberOfDecompositions)
148  {
149  itkExceptionMacro(<< "Impossible to GetNthFilter with the index element " << idx << "; this element don't exist, the size of the filter list is "
150  << m_FilterList->Size() << ".");
151  }
152  return static_cast<FilterType*>(m_FilterList->GetNthElement(idx));
153  }
154 
156  itkStaticConstMacro(DirectionOfTransformation, DirectionOfTransformationEnumType, Wavelet::FORWARD);
157 
158  itkGetMacro(NumberOfDecompositions, unsigned int);
159  itkSetMacro(NumberOfDecompositions, unsigned int);
160 
161  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
162 
171  itkGetMacro(SubsampleImageFactor, unsigned int);
172  itkSetMacro(SubsampleImageFactor, unsigned int);
174 
175 protected:
177  ~WaveletTransform() override
178  {
179  }
180 
182  void GenerateData() override;
183 
184 private:
185  WaveletTransform(const Self&);
186  void operator=(const Self&);
187 
192 
200 
205 }; // end of Forward class
206 
235 template <class TInputImage, class TOutputImage, class TFilter>
236 class ITK_EXPORT WaveletTransform<TInputImage, TOutputImage, TFilter, Wavelet::INVERSE> : public ImageListToImageFilter<TInputImage, TOutputImage>
237 {
238 public:
242  typedef itk::SmartPointer<Self> Pointer;
243  typedef itk::SmartPointer<const Self> ConstPointer;
244 
246  itkNewMacro(Self);
247 
250 
251  typedef TInputImage InputImageType;
252  typedef typename InputImageType::Pointer InputImagePointerType;
253  typedef typename InputImageType::ConstPointer InputImageConstPointerType;
254  typedef typename InputImageType::RegionType InputImageRegionType;
255  typedef typename InputImageType::PixelType InputImagePixelType;
256  typedef typename InputImageType::SizeType SizeType;
257  typedef typename InputImageType::IndexType IndexType;
258  typedef typename InputImageType::ValueType ValueType;
259 
260  typedef typename Superclass::InputImageListType InputImageListType;
263 
264  typedef typename Superclass::OutputImageType OutputImageType;
265  typedef typename OutputImageType::Pointer OutputImagePointerType;
266  typedef typename OutputImageType::RegionType OutputImageRegionType;
267  typedef typename OutputImageType::SizeType OutputImageSizeType;
268  typedef typename OutputImageType::IndexType OutputImageIndexType;
269  typedef typename OutputImageType::ValueType OutputValueType;
270 
271  typedef TFilter FilterType;
272  typedef typename FilterType::Pointer FilterPointerType;
276 
277  itkGetObjectMacro(FilterList, FilterListType);
278  FilterType* GetNthFilter(unsigned int idx) const
279  {
280  if (idx >= m_NumberOfDecompositions)
281  {
282  itkExceptionMacro(<< "Impossible to GetNthFilter with the index element " << idx << "; this element don't exist, the size of the filter list is "
283  << m_FilterList->Size() << ".");
284  }
285  return static_cast<FilterType*>(m_FilterList->GetNthElement(idx));
286  }
287 
289  itkStaticConstMacro(DirectionOfTransformation, DirectionOfTransformationEnumType, Wavelet::INVERSE);
290 
291  itkGetMacro(NumberOfDecompositions, unsigned int);
292 
293  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
294 
303  itkGetMacro(SubsampleImageFactor, unsigned int);
304  itkSetMacro(SubsampleImageFactor, unsigned int);
306 
307 protected:
309  ~WaveletTransform() override
310  {
311  }
312 
317  void GenerateOutputInformation() override;
318 
320  void GenerateData() override;
321 
322 private:
323  WaveletTransform(const Self&);
324  void operator=(const Self&);
325 
330 
338 
343 }; // end of inverse class
344 
345 } // end of namespace
346 
347 #ifndef OTB_MANUAL_INSTANTIATION
348 #include "otbWaveletTransform.hxx"
349 #endif
350 
351 #endif
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::IndexType
InputImageType::IndexType IndexType
Definition: otbWaveletTransform.h:257
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::ValueType
InputImageType::ValueType ValueType
Definition: otbWaveletTransform.h:130
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::OutputImageType
Superclass::OutputImageType OutputImageType
Definition: otbWaveletTransform.h:264
otb::Wavelet::INVERSE
@ INVERSE
Definition: otbWaveletOperatorBase.h:39
otb::WaveletTransform::Self
WaveletTransform Self
Definition: otbWaveletTransform.h:62
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::OutputImageIndexType
OutputImageType::IndexType OutputImageIndexType
Definition: otbWaveletTransform.h:268
otbWaveletOperatorBase.h
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::InputImageRegionType
InputImageType::RegionType InputImageRegionType
Definition: otbWaveletTransform.h:127
otb::WaveletTransform
Wavelet transformation framework.
Definition: otbWaveletTransform.h:58
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::GetNthFilter
FilterType * GetNthFilter(unsigned int idx) const
Definition: otbWaveletTransform.h:278
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::FilterListIterator
FilterListType::Iterator FilterListIterator
Definition: otbWaveletTransform.h:275
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::m_NumberOfDecompositions
unsigned int m_NumberOfDecompositions
Definition: otbWaveletTransform.h:329
otb::ImageListToImageFilter
Base class for all the filters taking an images list as input to produce an image.
Definition: otbImageListToImageFilter.h:40
otbImageToImageListFilter.h
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::OutputValueType
OutputImageType::ValueType OutputValueType
Definition: otbWaveletTransform.h:269
otb::ImageListSource
Base class for all the filters producing an otbImageList.
Definition: otbImageListSource.h:40
otb::Wavelet::Wavelet
Wavelet
Definition: otbWaveletGenerator.h:35
otbWaveletGenerator.h
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::GetNthFilter
FilterType * GetNthFilter(unsigned int idx) const
Definition: otbWaveletTransform.h:145
otb::WaveletTransform::Superclass
itk::ImageSource< TOutputImage > Superclass
Definition: otbWaveletTransform.h:63
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::FilterPointerType
FilterType::Pointer FilterPointerType
Definition: otbWaveletTransform.h:139
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::OutputImagePointerType
Superclass::OutputImagePointerType OutputImagePointerType
Definition: otbWaveletTransform.h:133
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::Self
WaveletTransform Self
Definition: otbWaveletTransform.h:113
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::FilterListIterator
FilterListType::Iterator FilterListIterator
Definition: otbWaveletTransform.h:142
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::OutputImagePointerType
OutputImageType::Pointer OutputImagePointerType
Definition: otbWaveletTransform.h:265
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::SizeType
InputImageType::SizeType SizeType
Definition: otbWaveletTransform.h:256
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::FilterListType
ObjectList< FilterType > FilterListType
Definition: otbWaveletTransform.h:140
otb::ObjectList::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbObjectList.h:46
otbWaveletTransform.hxx
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::FilterListPointerType
FilterListType::Pointer FilterListPointerType
Definition: otbWaveletTransform.h:274
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::Self
WaveletTransform Self
Definition: otbWaveletTransform.h:240
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::OutputImageIterator
OutputImageListType::Iterator OutputImageIterator
Definition: otbWaveletTransform.h:136
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbWaveletTransform.h:243
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::m_FilterList
FilterListPointerType m_FilterList
Definition: otbWaveletTransform.h:204
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::m_FilterList
FilterListPointerType m_FilterList
Definition: otbWaveletTransform.h:342
otb::ImageList::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbImageList.h:45
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::InputImagePixelType
InputImageType::PixelType InputImagePixelType
Definition: otbWaveletTransform.h:255
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::InputImageListType
Superclass::InputImageListType InputImageListType
Definition: otbWaveletTransform.h:260
otb::Wavelet::WaveletDirection
WaveletDirection
Definition: otbWaveletOperatorBase.h:36
otb::WaveletTransform::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbWaveletTransform.h:65
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::InputImagePointerType
InputImageType::Pointer InputImagePointerType
Definition: otbWaveletTransform.h:252
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::OutputImageType
Superclass::OutputImageType OutputImageType
Definition: otbWaveletTransform.h:132
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::Superclass
ImageListToImageFilter< TInputImage, TOutputImage > Superclass
Definition: otbWaveletTransform.h:241
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::m_SubsampleImageFactor
unsigned int m_SubsampleImageFactor
Definition: otbWaveletTransform.h:337
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::FilterType
TFilter FilterType
Definition: otbWaveletTransform.h:138
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbWaveletTransform.h:242
otbObjectList.h
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::SizeType
InputImageType::SizeType SizeType
Definition: otbWaveletTransform.h:129
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::OutputImageSizeType
OutputImageType::SizeType OutputImageSizeType
Definition: otbWaveletTransform.h:267
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::InputImageConstPointerType
InputImageType::ConstPointer InputImageConstPointerType
Definition: otbWaveletTransform.h:126
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::m_SubsampleImageFactor
unsigned int m_SubsampleImageFactor
Definition: otbWaveletTransform.h:199
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::InputImageConstPointerType
InputImageType::ConstPointer InputImageConstPointerType
Definition: otbWaveletTransform.h:253
otb::WaveletTransform::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbWaveletTransform.h:64
otb::ObjectList::Iterator
Iterator of the object list.
Definition: otbObjectList.h:168
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::DirectionOfTransformationEnumType
Wavelet::WaveletDirection DirectionOfTransformationEnumType
Definition: otbWaveletTransform.h:155
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::OutputImageRegionType
OutputImageType::RegionType OutputImageRegionType
Definition: otbWaveletTransform.h:266
otbImageListToImageFilter.h
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::FilterType
TFilter FilterType
Definition: otbWaveletTransform.h:271
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::~WaveletTransform
~WaveletTransform() override
Definition: otbWaveletTransform.h:309
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::FilterListType
ObjectList< FilterType > FilterListType
Definition: otbWaveletTransform.h:273
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::m_NumberOfDecompositions
unsigned int m_NumberOfDecompositions
Definition: otbWaveletTransform.h:191
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::FilterPointerType
FilterType::Pointer FilterPointerType
Definition: otbWaveletTransform.h:272
otb::ImageList::Iterator
Superclass::Iterator Iterator
Definition: otbImageList.h:57
otb::Wavelet::FORWARD
@ FORWARD
Definition: otbWaveletOperatorBase.h:38
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::FilterListPointerType
FilterListType::Pointer FilterListPointerType
Definition: otbWaveletTransform.h:141
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::InputImageRegionType
InputImageType::RegionType InputImageRegionType
Definition: otbWaveletTransform.h:254
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbWaveletTransform.h:115
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::InputImageType
TInputImage InputImageType
Definition: otbWaveletTransform.h:249
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::InputImagePixelType
InputImageType::PixelType InputImagePixelType
Definition: otbWaveletTransform.h:128
otb::ObjectList
This class is a generic all-purpose wrapping around an std::vector<itk::SmartPointer<ObjectType> >.
Definition: otbObjectList.h:40
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::ValueType
InputImageType::ValueType ValueType
Definition: otbWaveletTransform.h:258
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbWaveletTransform.h:116
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::InputImagePointerType
InputImageType::Pointer InputImagePointerType
Definition: otbWaveletTransform.h:125
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::Superclass
ImageToImageListFilter< TInputImage, TOutputImage > Superclass
Definition: otbWaveletTransform.h:114
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::OutputImageListType
Superclass::OutputImageListType OutputImageListType
Definition: otbWaveletTransform.h:134
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::InputImageListPointerType
InputImageListType::Pointer InputImageListPointerType
Definition: otbWaveletTransform.h:261
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::InputImageType
TInputImage InputImageType
Definition: otbWaveletTransform.h:122
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::OutputImageListPointerType
OutputImageListType::Pointer OutputImageListPointerType
Definition: otbWaveletTransform.h:135
otb::ImageToImageListFilter
Base class for all the filters taking an image input to produce an image list.
Definition: otbImageToImageListFilter.h:39
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::FORWARD >::~WaveletTransform
~WaveletTransform() override
Definition: otbWaveletTransform.h:177
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::InputImageIterator
InputImageListType::Iterator InputImageIterator
Definition: otbWaveletTransform.h:262
otb::WaveletTransform< TInputImage, TOutputImage, TFilter, Wavelet::INVERSE >::DirectionOfTransformationEnumType
Wavelet::WaveletDirection DirectionOfTransformationEnumType
Definition: otbWaveletTransform.h:288