Orfeo Toolbox  4.0
otbFusionImageBase.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ORFEO Toolbox
4  Language: C++
5  Date: $Date$
6  Version: $Revision$
7 
8 
9  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10  See OTBCopyright.txt for details.
11 
12 
13  This software is distributed WITHOUT ANY WARRANTY; without even
14  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  PURPOSE. See the above copyright notices for more information.
16 
17 =========================================================================*/
18 #ifndef __otbFusionImageBase_h
19 #define __otbFusionImageBase_h
20 
22 #include "itkNumericTraits.h"
23 
24 namespace otb
25 {
30 template <class TInputMultiSpectralImage, class TInputMultiSpectralInterpImage, class TInputPanchroImage,
31  class TOutputImage, class TFunctor>
32 class ITK_EXPORT FusionImageBase : public itk::TernaryFunctorImageFilter<TInputMultiSpectralImage,
33  TInputMultiSpectralInterpImage,
34  TInputPanchroImage, TOutputImage, TFunctor>
35 {
36 public:
38  itkStaticConstMacro(InputImageDimension, unsigned int, TInputMultiSpectralImage::ImageDimension);
39  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
40 
42  typedef TInputMultiSpectralImage InputMultiSpectralImageType;
43  typedef TInputMultiSpectralInterpImage InputMultiSpectralInterpImageType;
44  typedef TInputPanchroImage InputPanchroImageType;
45  typedef TOutputImage OutputImageType;
46  typedef TFunctor FunctorType;
47 
57 
59  itkNewMacro(Self);
60 
62  itkTypeMacro(FusionImageBase, TernaryFunctorImageFilter);
63 
65  typedef typename InputMultiSpectralImageType::PixelType InputMultiSpectralPixelType;
66  typedef typename InputMultiSpectralInterpImageType::PixelType InputMultiSpectralInterpPixelType;
67  typedef typename InputPanchroImageType::PixelType InputPanchroPixelType;
68  typedef typename OutputImageType::PixelType OutputPixelType;
73  typedef typename InputMultiSpectralImageType::RegionType InputMultiSpectralImageRegionType;
74  typedef typename InputMultiSpectralInterpImageType::RegionType
76  typedef typename InputPanchroImageType::RegionType InputPanchroImageRegionType;
77  typedef typename OutputImageType::RegionType OutputImageRegionType;
78 
80  typedef typename InputMultiSpectralImageType::SizeType SizeType;
81 
82  void SetMultiSpect(const InputMultiSpectralImageType *multiSpect)
83  {
84  this->SetInput1(multiSpect);
85  }
86  void SetMultiSpectInterp(const InputMultiSpectralInterpImageType *multiSpectInterp)
87  {
88  this->SetInput2(multiSpectInterp);
89  }
90  void SetPanchro(const InputPanchroImageType *panchro)
91  {
92  this->SetInput3(panchro);
93  }
94 
95  const InputMultiSpectralImageType* GetMultiSpect()
96  {
97  if (this->GetNumberOfInputs() < 1)
98  {
99  return 0;
100  }
101  else return (static_cast<const InputMultiSpectralImageType *>(this->itk::ProcessObject::GetInput(0)));
102  }
103 
104  const InputMultiSpectralInterpImageType* GetMultiSpectInterp()
105  {
106  if (this->GetNumberOfInputs() < 2)
107  {
108  return 0;
109  }
110  else return (static_cast<const InputMultiSpectralInterpImageType *>(this->itk::ProcessObject::GetInput(1)));
111  }
112 
113  const InputPanchroImageType* GetPanchro()
114  {
115  if (this->GetNumberOfInputs() < 3)
116  {
117  return 0;
118  }
119  else return (static_cast<const InputPanchroImageType *>(this->itk::ProcessObject::GetInput(2)));
120  }
121 
122 };
123 
124 } // end namespace otb
125 
126 #endif

Generated at Sat Mar 8 2014 15:56:36 for Orfeo Toolbox with doxygen 1.8.3.1