OTB  6.7.0
Orfeo Toolbox
otbExtractROIBase.h
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 #ifndef otbExtractROIBase_h
22 #define otbExtractROIBase_h
23 
24 #include "itkImageToImageFilter.h"
25 #include "itkSmartPointer.h"
27 
28 namespace otb
29 {
30 
47 template <class TInputImage, class TOutputImage>
49  public itk::ImageToImageFilter<TInputImage, TOutputImage>
50 {
51 public:
57 
59  itkNewMacro(Self);
60 
63 
65  typedef TInputImage InputImageType;
66  typedef TOutputImage OutputImageType;
67 
69  typedef typename TOutputImage::RegionType OutputImageRegionType;
70  typedef typename TInputImage::RegionType InputImageRegionType;
71 
73  typedef typename TOutputImage::PixelType OutputImagePixelType;
74  typedef typename TInputImage::PixelType InputImagePixelType;
75 
81 
83  itkStaticConstMacro(InputImageDimension, unsigned int,
84  TInputImage::ImageDimension);
85  itkStaticConstMacro(OutputImageDimension, unsigned int,
86  TOutputImage::ImageDimension);
88 
89  typedef
91  itkGetStaticConstMacro(OutputImageDimension)>
93 
94  itkGetMacro(ExtractionRegion, InputImageRegionType);
95 
98 
100  itkSetMacro(StartX, unsigned long);
101  itkGetConstMacro(StartX, unsigned long);
102  itkSetMacro(StartY, unsigned long);
103  itkGetConstMacro(StartY, unsigned long);
104 
106  itkSetMacro(SizeX, unsigned long);
107  itkGetConstMacro(SizeX, unsigned long);
108  itkSetMacro(SizeY, unsigned long);
109  itkGetConstMacro(SizeY, unsigned long);
111 
112 protected:
113  ExtractROIBase();
114  ~ExtractROIBase() override {}
115  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
116 
117  void GenerateInputRequestedRegion() override;
118 
127  void GenerateOutputInformation() override;
128 
140  const OutputImageRegionType& srcRegion) override;
141 
152 // ATTENTION bizarre
153 
154  void ThreadedGenerateData(const OutputImageRegionType& /*outputRegionForThread*/,
155  itk::ThreadIdType /*threadId*/) override
156 
157  {
158 
159  }
160 
167 
170 
171 private:
172  ExtractROIBase(const Self &) = delete;
173  void operator =(const Self&) = delete;
174 
176  unsigned long m_StartX;
177  unsigned long m_StartY;
178 
180  unsigned long m_SizeX;
181  unsigned long m_SizeY;
182 
183 };
184 
185 } // end namespace otb
186 
187 #ifndef OTB_MANUAL_INSTANTIATION
188 #include "otbExtractROIBase.hxx"
189 #endif
190 
191 #endif
TOutputImage::RegionType OutputImageRegionType
itk::Size< Monteverdi_DIMENSION > SizeType
Definition: mvdTypes.h:137
TInputImage::PixelType InputImagePixelType
TOutputImage::PixelType OutputImagePixelType
InputImageRegionType m_ExtractionRegion
itk::SmartPointer< const Self > ConstPointer
itk::ImageToImageFilterDetail::ExtractImageFilterRegionCopier< itkGetStaticConstMacro(InputImageDimension), itkGetStaticConstMacro(OutputImageDimension)> ExtractROIBaseRegionCopierType
static const unsigned int InputImageDimension
void operator=(const Self &)=delete
void SetExtractionRegion(InputImageRegionType roi)
itk::Index< Monteverdi_DIMENSION > IndexType
Definition: mvdTypes.h:133
void GenerateOutputInformation() override
TOutputImage OutputImageType
unsigned int ThreadIdType
TInputImage::RegionType InputImageRegionType
itk::SmartPointer< Self > Pointer
TInputImage::SizeType InputImageSizeType
TOutputImage::SizeType OutputImageSizeType
void CallCopyOutputRegionToInputRegion(InputImageRegionType &destRegion, const OutputImageRegionType &srcRegion) override
static const unsigned int OutputImageDimension
void ThreadedGenerateData(const OutputImageRegionType &, itk::ThreadIdType) override
TInputImage InputImageType
void GenerateInputRequestedRegion() override
OutputImageType::RegionType OutputImageRegionType
void SetInternalExtractionRegion(InputImageRegionType extractRegion)
TOutputImage::IndexType OutputImageIndexType
void PrintSelf(std::ostream &os, itk::Indent indent) const override
Base class to extract area of images.
OutputImageRegionType m_OutputImageRegion
TInputImage::IndexType InputImageIndexType
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass