OTB  6.7.0
Orfeo Toolbox
otbExtractROI.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 otbExtractROI_h
22 #define otbExtractROI_h
23 
24 #include "otbExtractROIBase.h"
25 #include "otbImage.h"
26 #include "itkMacro.h"
27 #include "OTBImageBaseExport.h"
28 
29 namespace otb
30 {
31 
42 template <class TInputPixel, class TOutputPixel>
43 class OTBImageBase_EXPORT_TEMPLATE ExtractROI :
44  public ExtractROIBase<Image<TInputPixel, 2>, Image<TOutputPixel, 2> >
45 {
46 public:
48  typedef ExtractROI Self;
52 
54  itkNewMacro(Self);
55 
57  itkTypeMacro(ExtractROI, ExtractROIBase);
58 
60  typedef typename Superclass::InputImageType InputImageType;
61  typedef typename Superclass::OutputImageType OutputImageType;
62 
64  typedef typename OutputImageType::RegionType OutputImageRegionType;
65  typedef typename InputImageType::RegionType InputImageRegionType;
66 
68  typedef typename OutputImageType::PixelType OutputImagePixelType;
69  typedef typename InputImageType::PixelType InputImagePixelType;
70 
76 
78  itkStaticConstMacro(InputImageDimension, unsigned int,
79  InputImageType::ImageDimension);
80  itkStaticConstMacro(OutputImageDimension, unsigned int,
81  OutputImageType::ImageDimension);
83 
84  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
85  itk::ThreadIdType threadId) override;
86 
87 protected:
88  ExtractROI();
89  ~ExtractROI() override {}
90  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
91 
95  void GenerateOutputInformation() override;
96 
97 private:
98  ExtractROI(const Self &) = delete;
99  void operator =(const Self&) = delete;
100 
101 };
102 
103 } // end namespace otb
104 
105 #ifndef OTB_MANUAL_INSTANTIATION
106 #include "otbExtractROI.hxx"
107 #endif
108 
109 #endif
itk::Size< Monteverdi_DIMENSION > SizeType
Definition: mvdTypes.h:137
Superclass::InputImageType InputImageType
Definition: otbExtractROI.h:57
OutputImageType::PixelType OutputImagePixelType
Definition: otbExtractROI.h:68
InputImageType::IndexType InputImageIndexType
Definition: otbExtractROI.h:73
InputImageType::PixelType InputImagePixelType
Definition: otbExtractROI.h:69
Superclass::OutputImageType OutputImageType
Definition: otbExtractROI.h:61
OutputImageType::IndexType OutputImageIndexType
Definition: otbExtractROI.h:72
~ExtractROI() override
Definition: otbExtractROI.h:89
OutputImageType::RegionType OutputImageRegionType
Definition: otbExtractROI.h:64
ExtractROI Self
Definition: otbExtractROI.h:48
Extract a subset of a mono-channel image.
Definition: otbExtractROI.h:43
itk::Index< Monteverdi_DIMENSION > IndexType
Definition: mvdTypes.h:133
itk::SmartPointer< const Self > ConstPointer
Definition: otbExtractROI.h:51
InputImageType::RegionType InputImageRegionType
Definition: otbExtractROI.h:65
unsigned int ThreadIdType
OutputImageType::SizeType OutputImageSizeType
Definition: otbExtractROI.h:74
ExtractROIBase< Image< TInputPixel, 2 >, Image< TOutputPixel, 2 > > Superclass
Definition: otbExtractROI.h:49
itk::SmartPointer< Self > Pointer
Definition: otbExtractROI.h:50
OutputImageType::RegionType OutputImageRegionType
InputImageType::SizeType InputImageSizeType
Definition: otbExtractROI.h:75
Base class to extract area of images.