OTB  6.7.0
Orfeo Toolbox
otbMultiToMonoChannelExtractROI.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 otbMultiToMonoChannelExtractROI_h
22 #define otbMultiToMonoChannelExtractROI_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 
45 template <class TInputPixelType, class TOutputPixelType>
46 class OTBImageBase_EXPORT_TEMPLATE MultiToMonoChannelExtractROI :
47 // public ExtractROIBase< itk::VectorImage<TInputPixelType, 2> , itk::Image<TOutputPixelType, 2> >
48  public ExtractROIBase<VectorImage<TInputPixelType, 2>, Image<TOutputPixelType, 2> >
49 {
50 public:
53 // typedef ExtractROIBase< itk::VectorImage<TInputPixelType, 2> , itk::Image<TOutputPixelType, 2> > Superclass;
57 
59  itkNewMacro(Self);
60 
63 
65  typedef typename Superclass::InputImageType InputImageType;
66  typedef typename Superclass::OutputImageType OutputImageType;
67 
69  typedef typename OutputImageType::ValueType OutputValueType;
70 
72  typedef typename OutputImageType::RegionType OutputImageRegionType;
73  typedef typename InputImageType::RegionType InputImageRegionType;
74 
76  typedef typename OutputImageType::PixelType OutputImagePixelType;
77  typedef typename InputImageType::PixelType InputImagePixelType;
78 
84 
86  itkSetMacro(Channel, unsigned int);
87  itkGetConstMacro(Channel, unsigned int);
89 
91  itkStaticConstMacro(InputImageDimension, unsigned int,
92  InputImageType::ImageDimension);
93  itkStaticConstMacro(OutputImageDimension, unsigned int,
94  OutputImageType::ImageDimension);
96 
97 protected:
100  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
101 
110  void GenerateOutputInformation() override;
111 
115  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
116  itk::ThreadIdType threadId) override;
117 
118 private:
119  MultiToMonoChannelExtractROI(const Self &) = delete;
120  void operator =(const Self&) = delete;
121 
123  unsigned int m_Channel;
124 };
125 
126 } // end namespace otb
127 
128 #ifndef OTB_MANUAL_INSTANTIATION
130 #endif
131 
132 #endif
itk::Size< Monteverdi_DIMENSION > SizeType
Definition: mvdTypes.h:137
ExtractROIBase< VectorImage< TInputPixelType, 2 >, Image< TOutputPixelType, 2 > > Superclass
itk::SmartPointer< const Self > ConstPointer
Extract a mono channel part of a multi-channel image.
itk::Index< Monteverdi_DIMENSION > IndexType
Definition: mvdTypes.h:133
unsigned int ThreadIdType
Base class to extract area of images.