OTB  7.2.0
Orfeo Toolbox
otbConcatenateVectorImageFilter.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 otbConcatenateVectorImageFilter_h
22 #define otbConcatenateVectorImageFilter_h
23 
24 #include "itkImageToImageFilter.h"
25 #include "otbVectorImage.h"
26 
27 namespace otb
28 {
35 template <class TInputImage1, class TInputImage2, class TOutputImage>
36 class ITK_EXPORT ConcatenateVectorImageFilter : public itk::ImageToImageFilter<TInputImage1, TOutputImage>
37 {
38 public:
41  typedef itk::ImageToImageFilter<TInputImage1, TOutputImage> Superclass;
42  typedef itk::SmartPointer<Self> Pointer;
43  typedef itk::SmartPointer<const Self> ConstPointer;
44 
46  itkNewMacro(Self);
47 
49  itkTypeMacro(VectorImageToImagePixelAccessor, ImageToImageFilter);
50 
52  typedef TInputImage1 InputImage1Type;
53  typedef TInputImage2 InputImage2Type;
54  typedef TOutputImage OutputImageType;
55 
56  typedef typename InputImage1Type::Pointer InputImage1PointerType;
57  typedef typename InputImage2Type::Pointer InputImage2PointerType;
58  typedef typename OutputImageType::Pointer OutputImagePointerType;
59 
60  typedef typename InputImage1Type::PixelType InputPixel1Type;
61  typedef typename InputImage2Type::PixelType InputPixel2Type;
62 
63  typedef typename OutputImageType::PixelType OutputPixelType;
64  typedef typename OutputImageType::InternalPixelType OutputInternalPixelType;
65  typedef typename OutputImageType::RegionType OutputImageRegionType;
66 
71  void SetInput1(const TInputImage1* image);
72 
77  InputImage1Type* GetInput1(void);
78 
83  void SetInput2(const TInputImage2* image);
84 
89  InputImage2Type* GetInput2(void);
90 
92  itkStaticConstMacro(InputImage1Dimension, unsigned int, TInputImage1::ImageDimension);
93  itkStaticConstMacro(InputImage2Dimension, unsigned int, TInputImage2::ImageDimension);
94  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
96 
97 protected:
100 
102  ~ConcatenateVectorImageFilter() override;
103  void GenerateOutputInformation() override;
104  void BeforeThreadedGenerateData() override;
105 
107  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId) override;
108 
110  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
111 
112 private:
113  ConcatenateVectorImageFilter(const Self&) = delete;
114  void operator=(const Self&) = delete;
115 };
116 } // end namespace otb
117 #ifndef OTB_MANUAL_INSTANTIATION
119 #endif
120 #endif
OutputImageType::InternalPixelType OutputInternalPixelType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
itk::SmartPointer< const Self > ConstPointer
itk::ImageToImageFilter< TInputImage1, TOutputImage > Superclass
This filter concatenates the vector pixel of the first image with the vector pixel of the second imag...