OTB  9.0.0
Orfeo Toolbox
otbFastICAInternalOptimizerVectorImageFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 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 otbFastICAInternalOptimizerVectorImageFilter_h
22 #define otbFastICAInternalOptimizerVectorImageFilter_h
23 
24 #include "otbMacro.h"
25 #include "otbMatrixImageFilter.h"
28 #include <functional>
29 
30 namespace otb
31 {
45 template <class TInputImage, class TOutputImage>
46 class ITK_EXPORT FastICAInternalOptimizerVectorImageFilter : public PersistentImageFilter<TInputImage, TOutputImage>
47 {
48 public:
51  typedef itk::ImageToImageFilter<TInputImage, TOutputImage> Superclass;
52  typedef itk::SmartPointer<Self> Pointer;
53  typedef itk::SmartPointer<const Self> ConstPointer;
54 
56  itkNewMacro(Self);
57 
59  itkTypeMacro(FastICAInternalOptimizerVectorImageFilter, ImageToImageFilter);
60 
62  itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
63  itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
65 
67  typedef TInputImage InputImageType;
68  typedef typename InputImageType::RegionType InputRegionType;
69 
70  typedef TOutputImage OutputImageType;
71  typedef typename OutputImageType::RegionType OutputRegionType;
72 
76 
80  typedef typename MatrixObjectType::ComponentType MatrixType;
81  typedef typename MatrixType::InternalMatrixType InternalMatrixType;
82  typedef typename InternalMatrixType::element_type MatrixElementType;
83 
86 
87  typedef std::function<double(double)> NonLinearityType;
88 
89  itkSetMacro(CurrentBandForLoop, unsigned int);
90  itkGetMacro(CurrentBandForLoop, unsigned int);
91 
92  itkGetMacro(W, InternalMatrixType);
93  itkSetMacro(W, InternalMatrixType);
94 
95  void SetNonLinearity(NonLinearityType NonLinearity, NonLinearityType NonLinearityDerivative)
96  {
97  m_NonLinearity = NonLinearity;
98  m_NonLinearityDerivative = NonLinearityDerivative;
99  this->Modified();
100  }
101 
102  itkGetMacro(Beta, double);
103  itkGetMacro(Den, double);
104 
105  virtual void Reset() override;
106 
107  virtual void Synthetize() override;
108 
109 protected:
112  {
113  }
114 
115  void GenerateOutputInformation() override;
116  void ThreadedGenerateData(const OutputRegionType&, itk::ThreadIdType) override;
117 
118  unsigned int m_CurrentBandForLoop;
119 
120  std::vector<double> m_BetaVector;
121  std::vector<double> m_DenVector;
122  std::vector<double> m_NbSamples;
123 
124  double m_Beta;
125  double m_Den;
126 
131 
132 private:
133  FastICAInternalOptimizerVectorImageFilter(const Self&); // not implemented
134  void operator=(const Self&); // not implemented
135 }; // end of class
136 
137 } // end of namespace otb
138 
139 #ifndef OTB_MANUAL_INSTANTIATION
141 #endif
142 
143 
144 #endif
otb::FastICAInternalOptimizerVectorImageFilter::VectorType
CovarianceEstimatorFilterType::RealPixelType VectorType
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:78
otb::FastICAInternalOptimizerVectorImageFilter::InputImageType
TInputImage InputImageType
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:67
otb::FastICAInternalOptimizerVectorImageFilter::InputRegionType
InputImageType::RegionType InputRegionType
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:68
otb::FastICAInternalOptimizerVectorImageFilter::RealType
CovarianceEstimatorFilterType::RealType RealType
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:77
otb::FastICAInternalOptimizerVectorImageFilter::m_NonLinearity
NonLinearityType m_NonLinearity
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:128
otbPersistentImageFilter.h
otb::FastICAInternalOptimizerVectorImageFilter::MatrixObjectType
CovarianceEstimatorFilterType::MatrixObjectType MatrixObjectType
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:79
otbMatrixImageFilter.h
otbStreamingStatisticsVectorImageFilter.h
otbFastICAInternalOptimizerVectorImageFilter.hxx
otb::FastICAInternalOptimizerVectorImageFilter::m_DenVector
std::vector< double > m_DenVector
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:121
otb::PersistentImageFilter
This filter is the base class for all filter persisting data through multiple update....
Definition: otbPersistentImageFilter.h:47
otb::StreamingStatisticsVectorImageFilter::MatrixObjectType
StatFilterType::MatrixObjectType MatrixObjectType
Definition: otbStreamingStatisticsVectorImageFilter.h:323
otb::StreamingStatisticsVectorImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbStreamingStatisticsVectorImageFilter.h:304
otb::FastICAInternalOptimizerVectorImageFilter::m_BetaVector
std::vector< double > m_BetaVector
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:120
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::FastICAInternalOptimizerVectorImageFilter::Superclass
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:51
otbMacro.h
otb::FastICAInternalOptimizerVectorImageFilter::CovarianceEstimatorFilterType
StreamingStatisticsVectorImageFilter< InputImageType > CovarianceEstimatorFilterType
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:74
otb::StreamingStatisticsVectorImageFilter::RealPixelType
StatFilterType::RealPixelType RealPixelType
Definition: otbStreamingStatisticsVectorImageFilter.h:320
otb::FastICAInternalOptimizerVectorImageFilter::~FastICAInternalOptimizerVectorImageFilter
~FastICAInternalOptimizerVectorImageFilter() override
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:111
otb::FastICAInternalOptimizerVectorImageFilter::MatrixElementType
InternalMatrixType::element_type MatrixElementType
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:82
otb::FastICAInternalOptimizerVectorImageFilter::m_W
InternalMatrixType m_W
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:127
otb::FastICAInternalOptimizerVectorImageFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:53
otb::FastICAInternalOptimizerVectorImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:52
otb::StreamingStatisticsVectorImageFilter
This class streams the whole input image through the PersistentStatisticsImageFilter.
Definition: otbStreamingStatisticsVectorImageFilter.h:297
otb::MatrixImageFilter
Apply a matrix multiplication over the channels of an image.
Definition: otbMatrixImageFilter.h:50
otb::FastICAInternalOptimizerVectorImageFilter::Self
FastICAInternalOptimizerVectorImageFilter Self
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:50
otb::FastICAInternalOptimizerVectorImageFilter::NonLinearityType
std::function< double(double)> NonLinearityType
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:87
otb::FastICAInternalOptimizerVectorImageFilter::InternalMatrixType
MatrixType::InternalMatrixType InternalMatrixType
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:81
otb::FastICAInternalOptimizerVectorImageFilter::m_Beta
double m_Beta
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:124
otb::FastICAInternalOptimizerVectorImageFilter::CovarianceEstimatorFilterPointerType
CovarianceEstimatorFilterType::Pointer CovarianceEstimatorFilterPointerType
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:75
otb::FastICAInternalOptimizerVectorImageFilter
Internal optimisation of the FastICA unmixing filter.
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:46
otb::FastICAInternalOptimizerVectorImageFilter::m_CurrentBandForLoop
unsigned int m_CurrentBandForLoop
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:118
otb::FastICAInternalOptimizerVectorImageFilter::TransformFilterPointerType
TransformFilterType::Pointer TransformFilterPointerType
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:85
otb::FastICAInternalOptimizerVectorImageFilter::SetNonLinearity
void SetNonLinearity(NonLinearityType NonLinearity, NonLinearityType NonLinearityDerivative)
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:95
otb::FastICAInternalOptimizerVectorImageFilter::m_Den
double m_Den
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:125
otb::MatrixImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbMatrixImageFilter.h:67
otb::FastICAInternalOptimizerVectorImageFilter::OutputImageType
TOutputImage OutputImageType
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:70
otb::FastICAInternalOptimizerVectorImageFilter::OutputRegionType
OutputImageType::RegionType OutputRegionType
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:71
otb::FastICAInternalOptimizerVectorImageFilter::m_NonLinearityDerivative
NonLinearityType m_NonLinearityDerivative
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:129
otb::FastICAInternalOptimizerVectorImageFilter::m_TransformFilter
TransformFilterPointerType m_TransformFilter
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:130
otb::FastICAInternalOptimizerVectorImageFilter::MatrixType
MatrixObjectType::ComponentType MatrixType
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:80
otb::StreamingStatisticsVectorImageFilter::RealType
StatFilterType::RealType RealType
Definition: otbStreamingStatisticsVectorImageFilter.h:318
otb::FastICAInternalOptimizerVectorImageFilter::m_NbSamples
std::vector< double > m_NbSamples
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:122
otb::FastICAInternalOptimizerVectorImageFilter::TransformFilterType
MatrixImageFilter< TInputImage, TOutputImage > TransformFilterType
Definition: otbFastICAInternalOptimizerVectorImageFilter.h:84