OTB  6.7.0
Orfeo Toolbox
otbDecimateImageFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 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 otbDecimateImageFilter_h
24 #define otbDecimateImageFilter_h
25 
26 #include "itkImageToImageFilter.h"
27 #include "itkImage.h"
28 
29 namespace otb {
30 
42 template <class TInputImage, class TOutputImage>
43 class ITK_EXPORT DecimateImageFilter :
44  public itk::ImageToImageFilter<TInputImage, TOutputImage>
45 {
46 public:
52 
54  itkNewMacro(Self);
55 
57  itkTypeMacro(DecimateImageFilter, ImageToImageFilter);
58 
60  itkStaticConstMacro(InputImageDimension, unsigned int,
61  TInputImage::ImageDimension);
62  itkStaticConstMacro(OutputImageDimension, unsigned int,
63  TOutputImage::ImageDimension);
65 
67  typedef TInputImage InputImageType;
68  typedef typename InputImageType::RegionType InputImageRegionType;
69 
70  typedef TOutputImage OutputImageType;
71  typedef typename OutputImageType::RegionType OutputImageRegionType;
72  typedef typename OutputImageType::PixelType OutputPixelType;
73 
75  itkGetMacro(DecimationFactor, unsigned int);
76  itkSetMacro(DecimationFactor, unsigned int);
78 
79 protected:
81  {
82  m_DecimationFactor = 1;
83  }
84  virtual ~DecimateImageFilter() {}
85 
89  virtual void CallCopyOutputRegionToInputRegion
90  (InputImageRegionType& destRegion, const OutputImageRegionType& srcRegion);
91  virtual void CallCopyInputRegionToOutputRegion
92  (OutputImageRegionType& destRegion, const InputImageRegionType& srcRegion);
94 
98  virtual void GenerateOutputInformation();
99 
101  virtual void ThreadedGenerateData
102  (const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId);
103 
104  virtual void PrintSelf(std::ostream& os, itk::Indent indent) const;
105 
106 private:
107  DecimateImageFilter (const Self &) = delete;
108  void operator =(const Self&) = delete;
109 
110  unsigned int m_DecimationFactor;
111 }; // end of class
112 
113 } // end of namespace otb
114 
115 #ifndef OTB_MANUAL_INSTANTIATION
117 #endif
118 
119 #endif
itk::SmartPointer< const Self > ConstPointer
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
OutputImageType::RegionType OutputImageRegionType
InputImageType::RegionType InputImageRegionType
itk::SmartPointer< Self > Pointer
Performs a down sampling of an image.
unsigned int ThreadIdType
OutputImageType::PixelType OutputPixelType