OTB  9.0.0
Orfeo Toolbox
otbStreamingMultibandFeatherMosaicFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1999-2011 Insight Software Consortium
3  * Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
4  * Copyright (C) 2016-2019 IRSTEA
5  *
6  * This file is part of Orfeo Toolbox
7  *
8  * https://www.orfeo-toolbox.org/
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  */
22 #ifndef StreamingMultibandFeatherMosaicFilter_H_
23 #define StreamingMultibandFeatherMosaicFilter_H_
24 
25 #include "itkImageToImageFilter.h"
28 #include "itkSubtractImageFilter.h"
29 #include "otbSummingFilter.h"
30 #include "itkMacro.h"
31 
32 // For gaussian filtering
33 #include "itkDiscreteGaussianImageFilter.h"
34 //#include "itkGPUDiscreteGaussianImageFilter.h" // TODO: Make this happen
36 
37 namespace otb
38 {
39 
55 template <class TInputImage, class TOutputImage, class TDistanceImage>
56 class ITK_EXPORT StreamingMultibandFeatherMosaicFilter : public otb::StreamingFeatherMosaicFilter<TInputImage, TOutputImage, TDistanceImage>
57 {
58 public:
62  typedef itk::SmartPointer<Self> Pointer;
63  typedef itk::SmartPointer<const Self> ConstPointer;
64 
66  itkNewMacro(Self);
67 
70 
72  typedef TInputImage ImageType;
73  typedef typename ImageType::ConstPointer ImageConstPointer;
74  typedef TDistanceImage DistanceImageType;
75  typedef typename DistanceImageType::ConstPointer DistanceImageConstPointer;
76  typedef typename DistanceImageType::PixelType DistanceImageValueType;
77  typedef TOutputImage OutputImage;
78  typedef typename OutputImage::SpacingType OutputImageSpacingType;
79 
81  typedef typename TInputImage::InternalPixelType InputImageInternalValueType;
83  typedef itk::DiscreteGaussianImageFilter<SingleImageType, SingleImageType> DiscreteGaussianFilterType;
84  typedef typename DiscreteGaussianFilterType::Pointer DiscreteGaussianFilterPointer;
87 
89  typedef itk::SubtractImageFilter<TInputImage, TInputImage, TInputImage> SubImageFilterType;
90  typedef typename SubImageFilterType::Pointer SubImageFilterPointer;
95 
97  itkSetMacro(NumberOfLevels, unsigned int);
98  itkGetMacro(NumberOfLevels, unsigned int);
100 
102  itkSetMacro(FirstLevelTransitionDistance, DistanceImageValueType);
103  itkGetMacro(FirstLevelTransitionDistance, DistanceImageValueType);
104  itkSetMacro(FirstLevelVariance, double);
105  itkGetMacro(FirstLevelVariance, double);
107 
108 protected:
111  {
112  }
113 
114  virtual void Modified();
115 
117  virtual void GenerateData();
118 
120  {
121  itkDebugMacro("GenerateOutputInformation");
122 
123  Superclass::GenerateOutputInformation();
124  this->Modified();
125  }
126 
127 private:
128  StreamingMultibandFeatherMosaicFilter(const Self&); // purposely not
129  // implemented
130  void operator=(const Self&); // purposely not
131  // implemented
132 
133  unsigned int m_NumberOfLevels; // number of scales
134 
135  /* Variances */
136  double m_FirstLevelVariance; // variance of first scale
137  std::vector<double> m_Variances; // variances values
138 
139  /* Transitions parameters */
141  // distance
142  // of the
143  // first
144  // scale
145  std::vector<DistanceImageValueType> m_TransitionDistances; // transition
146  // distances
147  // for
148  // each
149  // scale
150  std::vector<DistanceImageValueType> m_TransitionOffsets; // transition
151  // offsets
152  // for
153  // each
154  // scale
155 
156  /* Internal filters */
157  std::vector<std::vector<SubImageFilterPointer>> m_SubImageFilter; // subtract
158  // filter
159  // array
160  // (2D)
161  std::vector<std::vector<PerBandFilterPointer>> m_Filter; // smoothing
162  // filter
163  // array
164  // (2D)
165  std::vector<std::vector<DiscreteGaussianFilterPointer>> m_SingleFilter; // smoothing
166  // filter
167  // (per
168  // band)
169  // array
170  // (2D)
171  std::vector<MosaicFilterPointer> m_MosaicFilter; // mosaicking
172  // filter
173  // array
174  // (1D)
176  // filter
177 };
178 
179 } // end namespace gtb
180 
182 
183 #endif /* StreamingMultibandFeatherMosaicFilter_H_ */
otb::PerBandVectorImageFilter
This filter is a helper class to apply per band a standard itk::ImageToImageFilter to a VectorImage.
Definition: otbPerBandVectorImageFilter.h:49
otb::StreamingMultibandFeatherMosaicFilter::m_SingleFilter
std::vector< std::vector< DiscreteGaussianFilterPointer > > m_SingleFilter
Definition: otbStreamingMultibandFeatherMosaicFilter.h:165
otb::StreamingMultibandFeatherMosaicFilter::SingleImageType
otb::Image< InputImageInternalValueType > SingleImageType
Definition: otbStreamingMultibandFeatherMosaicFilter.h:82
otb::StreamingMultibandFeatherMosaicFilter::PerBandFilterType
otb::PerBandVectorImageFilter< ImageType, ImageType, DiscreteGaussianFilterType > PerBandFilterType
Definition: otbStreamingMultibandFeatherMosaicFilter.h:85
otb::StreamingMultibandFeatherMosaicFilter::Superclass
otb::StreamingFeatherMosaicFilter< TInputImage, TOutputImage, TDistanceImage > Superclass
Definition: otbStreamingMultibandFeatherMosaicFilter.h:61
otb::StreamingMultibandFeatherMosaicFilter::DiscreteGaussianFilterType
itk::DiscreteGaussianImageFilter< SingleImageType, SingleImageType > DiscreteGaussianFilterType
Definition: otbStreamingMultibandFeatherMosaicFilter.h:83
otb::StreamingMultibandFeatherMosaicFilter::InputImageInternalValueType
TInputImage::InternalPixelType InputImageInternalValueType
Definition: otbStreamingMultibandFeatherMosaicFilter.h:81
otbSummingFilter.h
otb::StreamingMultibandFeatherMosaicFilter::OutputImage
TOutputImage OutputImage
Definition: otbStreamingMultibandFeatherMosaicFilter.h:77
otb::StreamingMultibandFeatherMosaicFilter::m_TransitionDistances
std::vector< DistanceImageValueType > m_TransitionDistances
Definition: otbStreamingMultibandFeatherMosaicFilter.h:145
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::Image
Creation of an "otb" image which contains metadata.
Definition: otbImage.h:89
otb::StreamingMultibandFeatherMosaicFilter::m_SummingFilter
SummingFilterPointer m_SummingFilter
Definition: otbStreamingMultibandFeatherMosaicFilter.h:175
otb::StreamingMultibandFeatherMosaicFilter::ImageType
TInputImage ImageType
Definition: otbStreamingMultibandFeatherMosaicFilter.h:69
otb::SummingFilter
Computes the sum of the input images pixels.
Definition: otbSummingFilter.h:40
otb::StreamingMultibandFeatherMosaicFilter::m_FirstLevelTransitionDistance
DistanceImageValueType m_FirstLevelTransitionDistance
Definition: otbStreamingMultibandFeatherMosaicFilter.h:140
otb::StreamingMultibandFeatherMosaicFilter::OutputImageSpacingType
OutputImage::SpacingType OutputImageSpacingType
Definition: otbStreamingMultibandFeatherMosaicFilter.h:78
otb::StreamingFeatherMosaicFilter< TInputImage, TOutputImage, TDistanceImage >::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbStreamingFeatherMosaicFilter.h:60
otb::StreamingMultibandFeatherMosaicFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbStreamingMultibandFeatherMosaicFilter.h:63
otb::StreamingMultibandFeatherMosaicFilter::MosaicFilterPointer
MosaicFilterType::Pointer MosaicFilterPointer
Definition: otbStreamingMultibandFeatherMosaicFilter.h:92
otbStreamingMosaicFilterBase.h
otb::StreamingMultibandFeatherMosaicFilter::m_Filter
std::vector< std::vector< PerBandFilterPointer > > m_Filter
Definition: otbStreamingMultibandFeatherMosaicFilter.h:161
otb::StreamingMultibandFeatherMosaicFilter::GenerateOutputInformation
virtual void GenerateOutputInformation()
Definition: otbStreamingMultibandFeatherMosaicFilter.h:119
otb::StreamingMultibandFeatherMosaicFilter
Computes a nice seamless mosaic using multiband strategy.
Definition: otbStreamingMultibandFeatherMosaicFilter.h:56
otb::StreamingMultibandFeatherMosaicFilter::SummingFilterType
otb::SummingFilter< TOutputImage, TOutputImage > SummingFilterType
Definition: otbStreamingMultibandFeatherMosaicFilter.h:93
otb::StreamingMultibandFeatherMosaicFilter::DistanceImageConstPointer
DistanceImageType::ConstPointer DistanceImageConstPointer
Definition: otbStreamingMultibandFeatherMosaicFilter.h:75
otb::StreamingMultibandFeatherMosaicFilter::m_NumberOfLevels
unsigned int m_NumberOfLevels
Definition: otbStreamingMultibandFeatherMosaicFilter.h:133
otb::StreamingMultibandFeatherMosaicFilter::DistanceImageType
TDistanceImage DistanceImageType
Definition: otbStreamingMultibandFeatherMosaicFilter.h:74
otb::StreamingMultibandFeatherMosaicFilter::m_MosaicFilter
std::vector< MosaicFilterPointer > m_MosaicFilter
Definition: otbStreamingMultibandFeatherMosaicFilter.h:171
otbStreamingMultibandFeatherMosaicFilter.hxx
otb::StreamingMultibandFeatherMosaicFilter::SummingFilterPointer
SummingFilterType::Pointer SummingFilterPointer
Definition: otbStreamingMultibandFeatherMosaicFilter.h:94
otbStreamingFeatherMosaicFilter.h
otb::StreamingMultibandFeatherMosaicFilter::m_Variances
std::vector< double > m_Variances
Definition: otbStreamingMultibandFeatherMosaicFilter.h:137
otb::StreamingMultibandFeatherMosaicFilter::SubImageFilterPointer
SubImageFilterType::Pointer SubImageFilterPointer
Definition: otbStreamingMultibandFeatherMosaicFilter.h:90
otb::StreamingMultibandFeatherMosaicFilter::DiscreteGaussianFilterPointer
DiscreteGaussianFilterType::Pointer DiscreteGaussianFilterPointer
Definition: otbStreamingMultibandFeatherMosaicFilter.h:84
otb::SummingFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbSummingFilter.h:46
otb::PerBandVectorImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbPerBandVectorImageFilter.h:55
otbPerBandVectorImageFilter.h
otb::StreamingFeatherMosaicFilter
Computes the mosaic of an input images set using feathering technique. The output is a nice seamless ...
Definition: otbStreamingFeatherMosaicFilter.h:54
otb::StreamingMultibandFeatherMosaicFilter::SubImageFilterType
itk::SubtractImageFilter< TInputImage, TInputImage, TInputImage > SubImageFilterType
Definition: otbStreamingMultibandFeatherMosaicFilter.h:89
otb::StreamingMultibandFeatherMosaicFilter::PerBandFilterPointer
PerBandFilterType::Pointer PerBandFilterPointer
Definition: otbStreamingMultibandFeatherMosaicFilter.h:86
otb::StreamingMultibandFeatherMosaicFilter::~StreamingMultibandFeatherMosaicFilter
virtual ~StreamingMultibandFeatherMosaicFilter()
Definition: otbStreamingMultibandFeatherMosaicFilter.h:110
otb::StreamingMultibandFeatherMosaicFilter::m_TransitionOffsets
std::vector< DistanceImageValueType > m_TransitionOffsets
Definition: otbStreamingMultibandFeatherMosaicFilter.h:150
otb::StreamingMultibandFeatherMosaicFilter::m_SubImageFilter
std::vector< std::vector< SubImageFilterPointer > > m_SubImageFilter
Definition: otbStreamingMultibandFeatherMosaicFilter.h:157
otb::StreamingMultibandFeatherMosaicFilter::DistanceImageValueType
DistanceImageType::PixelType DistanceImageValueType
Definition: otbStreamingMultibandFeatherMosaicFilter.h:76
otb::StreamingMultibandFeatherMosaicFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbStreamingMultibandFeatherMosaicFilter.h:62
otb::StreamingMultibandFeatherMosaicFilter::m_FirstLevelVariance
double m_FirstLevelVariance
Definition: otbStreamingMultibandFeatherMosaicFilter.h:136
otb::StreamingMultibandFeatherMosaicFilter::ImageConstPointer
ImageType::ConstPointer ImageConstPointer
Definition: otbStreamingMultibandFeatherMosaicFilter.h:73
otb::StreamingMultibandFeatherMosaicFilter::MosaicFilterType
otb::StreamingFeatherMosaicFilter< TInputImage, TOutputImage, TDistanceImage > MosaicFilterType
Definition: otbStreamingMultibandFeatherMosaicFilter.h:91
otb::StreamingMultibandFeatherMosaicFilter::Self
StreamingMultibandFeatherMosaicFilter Self
Definition: otbStreamingMultibandFeatherMosaicFilter.h:60