OTB  10.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-2024 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_ */
Creation of an "otb" image which contains metadata.
Definition: otbImage.h:92
This filter is a helper class to apply per band a standard itk::ImageToImageFilter to a VectorImage.
Computes the mosaic of an input images set using feathering technique. The output is a nice seamless ...
Computes a nice seamless mosaic using multiband strategy.
std::vector< std::vector< SubImageFilterPointer > > m_SubImageFilter
std::vector< std::vector< PerBandFilterPointer > > m_Filter
std::vector< std::vector< DiscreteGaussianFilterPointer > > m_SingleFilter
otb::StreamingFeatherMosaicFilter< TInputImage, TOutputImage, TDistanceImage > Superclass
itk::DiscreteGaussianImageFilter< SingleImageType, SingleImageType > DiscreteGaussianFilterType
itk::SubtractImageFilter< TInputImage, TInputImage, TInputImage > SubImageFilterType
otb::PerBandVectorImageFilter< ImageType, ImageType, DiscreteGaussianFilterType > PerBandFilterType
otb::StreamingFeatherMosaicFilter< TInputImage, TOutputImage, TDistanceImage > MosaicFilterType
otb::SummingFilter< TOutputImage, TOutputImage > SummingFilterType
Computes the sum of the input images pixels.
itk::SmartPointer< Self > Pointer
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.