OTB  10.0.0
Orfeo Toolbox
otbExtractROI.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 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 : public ExtractROIBase<Image<TInputPixel, 2>, Image<TOutputPixel, 2>>
44 {
45 public:
47  typedef ExtractROI Self;
49  typedef itk::SmartPointer<Self> Pointer;
50  typedef itk::SmartPointer<const Self> ConstPointer;
51 
53  itkNewMacro(Self);
54 
56  itkTypeMacro(ExtractROI, ExtractROIBase);
57 
60  typedef typename Superclass::OutputImageType OutputImageType;
61 
63  typedef typename OutputImageType::RegionType OutputImageRegionType;
65 
67  typedef typename OutputImageType::PixelType OutputImagePixelType;
69 
71  typedef typename OutputImageType::IndexType OutputImageIndexType;
73  typedef typename OutputImageType::SizeType OutputImageSizeType;
75 
77  itkStaticConstMacro(InputImageDimension, unsigned int, InputImageType::ImageDimension);
78  itkStaticConstMacro(OutputImageDimension, unsigned int, OutputImageType::ImageDimension);
80 
81  void DynamicThreadedGenerateData(const OutputImageRegionType& outputRegionForThread) override;
82 
83 protected:
84  ExtractROI();
85  ~ExtractROI() override
86  {
87  }
88  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
89 
93  void GenerateOutputInformation() override;
94 
95 private:
96  ExtractROI(const Self&) = delete;
97  void operator=(const Self&) = delete;
98 };
99 
100 } // end namespace otb
101 
102 #ifndef OTB_MANUAL_INSTANTIATION
103 #include "otbExtractROI.hxx"
104 #endif
105 
106 #endif
Base class to extract area of images.
Extract a subset of a mono-channel image.
Definition: otbExtractROI.h:44
InputImageType::IndexType InputImageIndexType
Definition: otbExtractROI.h:72
~ExtractROI() override
Definition: otbExtractROI.h:85
InputImageType::SizeType InputImageSizeType
Definition: otbExtractROI.h:74
InputImageType::RegionType InputImageRegionType
Definition: otbExtractROI.h:64
OutputImageType::PixelType OutputImagePixelType
Definition: otbExtractROI.h:67
ExtractROIBase< Image< TInputPixel, 2 >, Image< TOutputPixel, 2 > > Superclass
Definition: otbExtractROI.h:48
itk::SmartPointer< Self > Pointer
Definition: otbExtractROI.h:49
ExtractROI Self
Definition: otbExtractROI.h:47
itk::SmartPointer< const Self > ConstPointer
Definition: otbExtractROI.h:50
void operator=(const Self &)=delete
OutputImageType::IndexType OutputImageIndexType
Definition: otbExtractROI.h:71
Superclass::InputImageType InputImageType
Definition: otbExtractROI.h:56
ExtractROI(const Self &)=delete
InputImageType::PixelType InputImagePixelType
Definition: otbExtractROI.h:68
OutputImageType::SizeType OutputImageSizeType
Definition: otbExtractROI.h:73
OutputImageType::RegionType OutputImageRegionType
Definition: otbExtractROI.h:63
Superclass::OutputImageType OutputImageType
Definition: otbExtractROI.h:60
Creation of an "otb" image which contains metadata.
Definition: otbImage.h:92
Superclass::PixelType PixelType
Definition: otbImage.h:107
Superclass::SizeType SizeType
Definition: otbImage.h:148
Superclass::RegionType RegionType
Definition: otbImage.h:154
Superclass::IndexType IndexType
Definition: otbImage.h:142
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.