Orfeo Toolbox  3.16
otbSparseUnmixingImageFilter.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 __otbSparseUnmixingImageFilter_h
19 #define __otbSparseUnmixingImageFilter_h
20 
21 #include "otbMacro.h"
22 #include "otbObjectList.h"
23 #include "otbWaveletOperator.h"
24 #include "otbWaveletFilterBank.h"
25 #include "otbWaveletTransform.h"
28 
29 #include "itkListSample.h"
30 #include "itkFixedArray.h"
31 #include "itkHistogram.h"
32 
33 namespace otb {
34 
49 template < class TInputImage, class TOutputImage,
50  unsigned int VNbInputImage,
51  class TPrecision = double,
52  Wavelet::Wavelet TMotherWaveletOperator = Wavelet::SYMLET8 >
54  : public ImageToImageListFilter<TInputImage, TOutputImage>
55 {
56 public:
62 
64  itkNewMacro(Self);
65 
68 
70  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
71  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
72  itkStaticConstMacro(NumberOfInputImages, unsigned int, VNbInputImage);
73 
75  typedef TInputImage InputImageType;
76  typedef TOutputImage OutputImageType;
77  typedef TPrecision PrecisionType;
78  static const Wavelet::Wavelet MotherWaveletOperatorID = TMotherWaveletOperator;
79 
82 
87  typedef typename WvltFilterType::OutputImageListType InternalImageListType;
90 
91  typedef itk::FixedArray< PrecisionType, NumberOfInputImages-1 > AngleType;
97 
98  typedef typename itk::Statistics::Histogram< PrecisionType, NumberOfInputImages-1 > HistogramType;
104 
110 
111  void SetInput ( unsigned int i, const InputImageType * );
112  const InputImageType * GetInput( unsigned int i ) const;
113 
114  void SetNumberOfDecomposition ( unsigned int nb )
115  {
116  for ( unsigned int i = 0; i < NumberOfInputImages; ++i )
117  {
118  m_WvltFilterList->GetNthElement(i)->SetNumberOfDecomposition( nb );
119  }
120  this->Modified();
121  }
122  unsigned int GetNumberOfDecomposition () const
123  {
124  return m_WvltFilterList->GetNthElement(0)->GetNumberOfDecomposition();
125  }
126 
127  void SetThresholdValue( PrecisionType th )
128  {
129  m_AngleListFilter->SetThresholdValue( th );
130  this->Modified();
131  }
132  PrecisionType GetThresholdValue () const
133  {
134  return m_AngleListFilter->GetThresholdValue();
135  }
136 
140  unsigned int GetNumberOfComponentsRequired () const
141  {
142  if ( m_NumberOfComponentsRequired == 0 )
143  GenerateNumberOfComponentsRequired();
144  return m_NumberOfComponentsRequired;
145  }
146  itkSetMacro(NumberOfComponentsRequired, unsigned int);
147 
148  itkSetMacro(NumberOfHistogramBins, unsigned int);
149  itkGetMacro(NumberOfHistogramBins, unsigned int);
150 
151  itkGetConstMacro(AngleList, AngleListType*);
152  itkGetConstMacro(WvltFilterList, WvltFilterListType*);
153  itkGetConstMacro(AngleListFilter, AngleListFilterType*);
154  itkGetConstMacro(Histogram, HistogramType*);
155  itkGetConstMacro(Transformer, TransformFilterType*);
156 
157 protected:
160 
161  virtual void GenerateData();
162  virtual void GenerateNumberOfComponentsRequired ();
163 private:
164  SparseUnmixingImageFilter(const Self &); //purposely not implemented
165  void operator=(const Self &); //purposely not implemented
166 
170 
175 }; // end of class
176 
177 } // end of namespace otb
178 
179 #ifndef OTB_MANUAL_INSTANTIATION
181 #endif
182 
183 #endif
184 
185 

Generated at Sun May 19 2013 00:50:03 for Orfeo Toolbox with doxygen 1.8.3.1