OTB  7.2.0
Orfeo Toolbox
otbPerBandVectorImageFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2020 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 otbPerBandVectorImageFilter_h
22 #define otbPerBandVectorImageFilter_h
23 
27 #include "otbImageList.h"
28 #include "otbImage.h"
29 #include "itkImageToImageFilter.h"
30 
31 namespace otb
32 {
48 template <class TInputImage, class TOutputImage, class TFilter>
49 class ITK_EXPORT PerBandVectorImageFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage>
50 {
51 public:
54  typedef itk::ImageToImageFilter<TInputImage, TOutputImage> Superclass;
55  typedef itk::SmartPointer<Self> Pointer;
56  typedef itk::SmartPointer<const Self> ConstPointer;
57 
59  itkNewMacro(Self);
60 
62  itkTypeMacro(PerBandVectorImageFilter, ImageToImageFilter);
63 
65  typedef TInputImage InputVectorImageType;
66  typedef typename InputVectorImageType::Pointer InputVectorImagePointerType;
67  typedef typename InputVectorImageType::InternalPixelType InputPixelType;
70 
71  typedef TOutputImage OutputVectorImageType;
72  typedef typename OutputVectorImageType::Pointer OutputVectorImagePointerType;
73  typedef typename OutputVectorImageType::InternalPixelType OutputPixelType;
76 
77  typedef TFilter FilterType;
78  typedef typename FilterType::Pointer FilterPointerType;
79 
80  // Internal filters definition
87 
89  itkSetObjectMacro(Filter, FilterType);
90  itkGetObjectMacro(Filter, FilterType);
91 
92  itkSetMacro(OutputIndex, unsigned int);
93  itkGetMacro(OutputIndex, unsigned int);
94 
95  void GenerateInputRequestedRegion(void) override;
96  void GenerateOutputInformation(void) override;
97 
98 protected:
100  void GenerateData(void) override;
101 
104 
107  {
108  }
109 
111  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
112 
113 private:
114  PerBandVectorImageFilter(const Self&) = delete;
115  void operator=(const Self&) = delete;
116 
118  FilterPointerType m_Filter;
119 
121  unsigned m_OutputIndex;
122 };
123 } // End namespace otb
124 #ifndef OTB_MANUAL_INSTANTIATION
126 #endif
127 
128 #endif
ImageListToVectorImageFilter< OutputImageListType, OutputVectorImageType > RecompositionFilterType
This filter is a helper class to apply per band a standard itk::ImageToImageFilter to a VectorImage...
InputVectorImageType::Pointer InputVectorImagePointerType
OutputVectorImageType::InternalPixelType OutputPixelType
Converts an ImageList to a VectorImage.
Image< InputPixelType, InputVectorImageType::ImageDimension > InputImageType
Image< OutputPixelType, OutputVectorImageType::ImageDimension > OutputImageType
ImageList< InputImageType > InputImageListType
RecompositionFilterType::Pointer RecompositionFilterPointerType
This class aims at converting a multi-band image to a list of scalar images.
itk::SmartPointer< const Self > ConstPointer
static const std::string Filter
unsigned m_OutputIndex
The index of the output of the filter to gather.
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
ImageList< OutputImageType > OutputImageListType
DecompositionFilterType::Pointer DecompositionFilterPointerType
ImageListToImageListApplyFilter< InputImageListType, OutputImageListType, FilterType > ProcessingFilterType
Creation of an "otb" image which contains metadata.
Definition: otbImage.h:89
This class represent a list of images.
Definition: otbImageList.h:39
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
OutputVectorImageType::Pointer OutputVectorImagePointerType
This filter applies the filter given as template to the input image list.
ProcessingFilterType::Pointer ProcessingFilterPointerType
FilterPointerType m_Filter
The processing filter.
InputVectorImageType::InternalPixelType InputPixelType
VectorImageToImageListFilter< InputVectorImageType, InputImageListType > DecompositionFilterType