Orfeo Toolbox  4.2
otbISRAUnmixingImageFilter.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 __otbISRAUnmixingImageFilter_h
19 #define __otbISRAUnmixingImageFilter_h
20 
21 #include "itkMacro.h"
22 #include "itkNumericTraits.h"
24 #include "vnl/algo/vnl_svd.h"
25 #include <boost/shared_ptr.hpp>
26 
27 namespace otb
28 {
29 
30 namespace Functor {
31 
37 template<class TInput, class TOutput, class TPrecision>
39 {
40 public:
42 
43  typedef TInput InputType;
44  typedef TOutput OutputType;
45  typedef TPrecision PrecisionType;
46 
47  typedef vnl_vector<PrecisionType> VectorType;
48  typedef vnl_matrix<PrecisionType> MatrixType;
49 
51  virtual ~ISRAUnmixingFunctor();
52 
53  unsigned int GetOutputSize() const;
54 
55  bool operator !=(const ISRAUnmixingFunctor& other) const;
56 
57  bool operator ==(const ISRAUnmixingFunctor& other) const;
58 
59  void SetEndmembersMatrix(const MatrixType& U);
60  const MatrixType& GetEndmembersMatrix(void) const;
61 
62  void SetMaxIteration(unsigned int val)
63  {
64  m_MaxIteration = val;
65  }
66 
67  unsigned int GetMaxIteration() const
68  {
69  return m_MaxIteration;
70  }
71 
72  OutputType operator ()(const InputType& in) const;
73 
74 private:
75 
76  static bool IsNonNegative(PrecisionType val)
77  {
78  return val >= 0;
79  }
80 
81  typedef vnl_svd<PrecisionType> SVDType;
82  typedef boost::shared_ptr<SVDType> SVDPointerType;
83 
85  SVDPointerType m_Svd; // SVD of U
86  unsigned int m_OutputSize;
87  unsigned int m_MaxIteration;
88 };
89 }
90 
115 template <class TInputImage, class TOutputImage, class TPrecision>
116 class ITK_EXPORT ISRAUnmixingImageFilter :
117  public otb::UnaryFunctorImageFilter<TInputImage, TOutputImage,
118  Functor::ISRAUnmixingFunctor<typename TInputImage::PixelType,
119  typename TOutputImage::PixelType, TPrecision> >
120 {
121 public:
125  <TInputImage,
126  TOutputImage,
128  typename TInputImage::PixelType,
129  typename TOutputImage::PixelType,
130  TPrecision>
134 
136  typename TInputImage::PixelType,
137  typename TOutputImage::PixelType,
138  TPrecision> FunctorType;
140 
142  itkNewMacro(Self);
143 
146 
148  typedef typename TInputImage::PixelType InputPixelType;
149  typedef typename TOutputImage::PixelType OutputPixelType;
150 
151  void SetEndmembersMatrix(const MatrixType& m);
152  const MatrixType& GetEndmembersMatrix() const;
153 
154  void SetMaxIteration( unsigned int val )
155  {
156  this->GetFunctor().SetMaxIteration(val);
157  this->Modified();
158  }
159 
160  unsigned int GetMaxIteration() const
161  {
162  return this->GetFunctor().GetMaxIteration();
163  }
164 
165 protected:
167 
168  virtual ~ISRAUnmixingImageFilter();
169 
170  void PrintSelf(std::ostream& os, itk::Indent indent) const;
171 
172 private:
173  ISRAUnmixingImageFilter(const Self &); //purposely not implemented
174  void operator =(const Self&); //purposely not implemented
175 
176 };
177 
178 } // end namespace otb
179 
180 #ifndef OTB_MANUAL_INSTANTIATION
182 #endif
183 
184 #endif
185 

Generated at Sat Aug 30 2014 16:08:53 for Orfeo Toolbox with doxygen 1.8.3.1