OTB  6.7.0
Orfeo Toolbox
otbWaveletInverseImageFilter.hxx
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 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 __otbWaveletInverseImageFilter_hxx
23 #define __otbWaveletInverseImageFilter_hxx
24 
26 
27 namespace otb
28 {
30 template <class TInputImage, class TOutputImage, Wavelet::Wavelet TMotherWaveletOperator>
32 ::WaveletInverseImageFilter() : m_NumberOfDecompositions(2)
33 {
34  m_SynopsisImageToWaveletsBandsList = WaveletsSynopsisImageToWaveletsBandsListFilterType::New();
35  m_SynopsisImageToWaveletsBandsList->SetDecimationRatio(2);
37 
38  m_WaveletTransform = WaveletInverseTransformFilterType::New();
39  m_WaveletTransform->SetSubsampleImageFactor(2);
40  m_WaveletTransform->SetInput( m_SynopsisImageToWaveletsBandsList->GetOutput() );
41 
42 }
43 
45 template <class TInputImage, class TOutputImage, Wavelet::Wavelet TMotherWaveletOperator>
48 {
49 }
50 
52 template <class TInputImage, class TOutputImage, Wavelet::Wavelet TMotherWaveletOperator>
53 void
55 ::Modified() const
56 {
57  Superclass::Modified();
58  m_SynopsisImageToWaveletsBandsList->Modified();
59  m_WaveletTransform->Modified();
60 }
62 
66 template <class TInputImage, class TOutputImage, Wavelet::Wavelet TMotherWaveletOperator>
67 void
70 {
71  // call the superclass' implementation of this method
72  Superclass::GenerateInputRequestedRegion();
73 
74  // get pointers to the inputs
75  typename InputImageType::Pointer input =
76  const_cast<InputImageType *> (this->GetInput());
77 
78  if ( !input )
79  {
80  return;
81  }
82 
83  input->SetRequestedRegionToLargestPossibleRegion();
84 }
85 
89 template <class TInputImage, class TOutputImage, Wavelet::Wavelet TMotherWaveletOperator>
90 void
93 {
94  m_SynopsisImageToWaveletsBandsList->SetInput( this->GetInput() );
95  m_SynopsisImageToWaveletsBandsList->SetNumberOfLevels( m_NumberOfDecompositions );
97 
98  m_WaveletTransform->GraftOutput( this->GetOutput() );
99  m_WaveletTransform->Update();
100  this->GraftOutput( m_WaveletTransform->GetOutput() );
101 }
102 
106 template <class TInputImage, class TOutputImage, Wavelet::Wavelet TMotherWaveletOperator>
107 void
109 ::PrintSelf(std::ostream& os, itk::Indent indent) const
110 {
111  Superclass::PrintSelf(os, indent);
112 }
113 
114 }
115 
116 #endif
virtual void PrintSelf(std::ostream &os, itk::Indent indent) const override
virtual void Modified() const override
TInputImage InputImageType
virtual void GenerateInputRequestedRegion() override