OTB  7.1.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 {
31 
43 template <class TInputImage, class TOutputImage>
44 class ITK_EXPORT DecimateImageFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage>
45 {
46 public:
49  typedef itk::ImageToImageFilter<TInputImage, TOutputImage> Superclass;
50  typedef itk::SmartPointer<Self> Pointer;
51  typedef itk::SmartPointer<const Self> ConstPointer;
52 
54  itkNewMacro(Self);
55 
57  itkTypeMacro(DecimateImageFilter, ImageToImageFilter);
58 
60  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
61  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
63 
65  typedef TInputImage InputImageType;
66  typedef typename InputImageType::RegionType InputImageRegionType;
67 
68  typedef TOutputImage OutputImageType;
69  typedef typename OutputImageType::RegionType OutputImageRegionType;
70  typedef typename OutputImageType::PixelType OutputPixelType;
71 
73  itkGetMacro(DecimationFactor, unsigned int);
74  itkSetMacro(DecimationFactor, unsigned int);
76 
77 protected:
79  {
80  m_DecimationFactor = 1;
81  }
83  {
84  }
85 
89  virtual void CallCopyOutputRegionToInputRegion(InputImageRegionType& destRegion, const OutputImageRegionType& srcRegion);
90  virtual void CallCopyInputRegionToOutputRegion(OutputImageRegionType& destRegion, const InputImageRegionType& srcRegion);
92 
96  virtual void GenerateOutputInformation();
97 
99  virtual void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId);
100 
101  virtual void PrintSelf(std::ostream& os, itk::Indent indent) const;
102 
103 private:
104  DecimateImageFilter(const Self&) = delete;
105  void operator=(const Self&) = delete;
106 
107  unsigned int m_DecimationFactor;
108 }; // end of class
109 
110 } // end of namespace otb
111 
112 #ifndef OTB_MANUAL_INSTANTIATION
114 #endif
115 
116 #endif
itk::SmartPointer< const Self > ConstPointer
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
OutputImageType::RegionType OutputImageRegionType
InputImageType::RegionType InputImageRegionType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
itk::SmartPointer< Self > Pointer
Performs a down sampling of an image.
OutputImageType::PixelType OutputPixelType