OTB  10.0.0
Orfeo Toolbox
otbImageOfVectorsToMonoChannelExtractROI.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 otbImageOfVectorsToMonoChannelExtractROI_h
22 #define otbImageOfVectorsToMonoChannelExtractROI_h
23 
24 #include "otbExtractROIBase.h"
25 #include "otbImage.h"
26 #include "otbVectorImage.h"
27 #include "OTBImageBaseExport.h"
28 
29 #include "itkMacro.h"
30 
31 namespace otb
32 {
33 
40 template <class TInputImage, class TOutputImage>
41 class OTBImageBase_EXPORT_TEMPLATE ImageOfVectorsToMonoChannelExtractROI : public ExtractROIBase<TInputImage, TOutputImage>
42 {
43 public:
47  typedef itk::SmartPointer<Self> Pointer;
48  typedef itk::SmartPointer<const Self> ConstPointer;
49 
51  itkNewMacro(Self);
52 
55 
57  typedef typename Superclass::InputImageType InputImageType;
58  typedef typename Superclass::OutputImageType OutputImageType;
59 
61  typedef typename OutputImageType::ValueType OutputValueType;
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 
72  typedef typename OutputImageType::IndexType OutputImageIndexType;
73  typedef typename InputImageType::IndexType InputImageIndexType;
74  typedef typename OutputImageType::SizeType OutputImageSizeType;
75  typedef typename InputImageType::SizeType InputImageSizeType;
76 
78  itkSetMacro(Channel, unsigned int);
79  itkGetConstMacro(Channel, unsigned int);
81 
83  itkStaticConstMacro(InputImageDimension, unsigned int, InputImageType::ImageDimension);
84  itkStaticConstMacro(OutputImageDimension, unsigned int, OutputImageType::ImageDimension);
86 
87 protected:
90  {
91  }
92  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
93 
102  void GenerateOutputInformation() override;
103 
107  void DynamicThreadedGenerateData(const OutputImageRegionType& outputRegionForThread) override;
108 
109 private:
111  void operator=(const Self&) = delete;
112 
114  unsigned int m_Channel;
115 };
116 
117 } // end namespace otb
118 
119 #ifndef OTB_MANUAL_INSTANTIATION
121 #endif
122 
123 #endif
Base class to extract area of images.
ExtractROIBase< TInputImage, TOutputImage > Superclass
ImageOfVectorsToMonoChannelExtractROI(const Self &)=delete
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.