OTB  10.0.0
Orfeo Toolbox
otbPerBandVectorImageFilter.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 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);
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 
119 
121  unsigned m_OutputIndex;
122 };
123 } // End namespace otb
124 #ifndef OTB_MANUAL_INSTANTIATION
126 #endif
127 
128 #endif
This filter applies the filter given as template to the input image list.
Converts an ImageList to a VectorImage.
This class represent a list of images.
Definition: otbImageList.h:40
Creation of an "otb" image which contains metadata.
Definition: otbImage.h:92
This filter is a helper class to apply per band a standard itk::ImageToImageFilter to a VectorImage.
ProcessingFilterType::Pointer ProcessingFilterPointerType
void GenerateData(void) override
RecompositionFilterType::Pointer RecompositionFilterPointerType
OutputVectorImageType::InternalPixelType OutputPixelType
void GenerateInputRequestedRegion(void) override
itkGetObjectMacro(Filter, FilterType)
Image< InputPixelType, InputVectorImageType::ImageDimension > InputImageType
FilterPointerType m_Filter
The processing filter.
ImageListToImageListApplyFilter< InputImageListType, OutputImageListType, FilterType > ProcessingFilterType
DecompositionFilterType::Pointer DecompositionFilterPointerType
InputVectorImageType::InternalPixelType InputPixelType
itk::SmartPointer< const Self > ConstPointer
ImageList< OutputImageType > OutputImageListType
OutputVectorImageType::Pointer OutputVectorImagePointerType
PerBandVectorImageFilter(const Self &)=delete
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
unsigned m_OutputIndex
The index of the output of the filter to gather.
Image< OutputPixelType, OutputVectorImageType::ImageDimension > OutputImageType
void operator=(const Self &)=delete
VectorImageToImageListFilter< InputVectorImageType, InputImageListType > DecompositionFilterType
ImageListToVectorImageFilter< OutputImageListType, OutputVectorImageType > RecompositionFilterType
void PrintSelf(std::ostream &os, itk::Indent indent) const override
void GenerateOutputInformation(void) override
ImageList< InputImageType > InputImageListType
InputVectorImageType::Pointer InputVectorImagePointerType
This class aims at converting a multi-band image to a list of scalar images.
static const std::string Filter
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.