OTB  10.0.0
Orfeo Toolbox
otbVcaImageFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1999-2011 Insight Software Consortium
3  * Copyright (C) 2005-2024 Centre National d'Etudes Spatiales (CNES)
4  *
5  * This file is part of Orfeo Toolbox
6  *
7  * https://www.orfeo-toolbox.org/
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
22 #ifndef otbVCAImageFilter_h
23 #define otbVCAImageFilter_h
24 
25 #include "otbImage.h"
26 #include "itkAbsImageFilter.h"
32 #include "otbPCAImageFilter.h"
35 
36 #include "itkMersenneTwisterRandomVariateGenerator.h"
37 #include "vnl/algo/vnl_svd.h"
38 
39 namespace otb
40 {
41 
66 template <class TVectorImage>
67 class ITK_EXPORT VCAImageFilter : public itk::ImageToImageFilter<TVectorImage, TVectorImage>
68 {
69 public:
71  typedef itk::ImageToImageFilter<TVectorImage, TVectorImage> Superclass;
72  typedef itk::SmartPointer<Self> Pointer;
73  typedef itk::SmartPointer<const Self> ConstPointer;
74 
75  typedef TVectorImage VectorImageType;
76  typedef typename VectorImageType::IndexType IndexType;
77  typedef typename VectorImageType::SizeType SizeType;
78  typedef typename VectorImageType::RegionType RegionType;
79  typedef typename VectorImageType::PixelType PixelType;
80  typedef typename VectorImageType::InternalPixelType InternalPixelType;
82 
84 
85  typedef itk::AbsImageFilter<ImageType, ImageType> AbsImageFilterType;
93  typedef itk::Statistics::MersenneTwisterRandomVariateGenerator RandomVariateGeneratorType;
98 
99  // creation of SmartPointer
100  itkNewMacro(Self);
101  // runtime type information
102  itkTypeMacro(VCAImageFilter, itk::ImageToImageFilter);
103 
104  itkGetMacro(NumberOfEndmembers, unsigned int);
105  itkSetMacro(NumberOfEndmembers, unsigned int);
106 
107  void Update() override
108  {
109  this->GenerateData();
110  }
111 
112  void EnlargeOutputRequestedRegion(itk::DataObject* itkNotUsed(output)) override
113  {
114  this->GetOutput()->SetRequestedRegion(this->GetOutput()->GetLargestPossibleRegion());
115  }
116 
117 protected:
118  VCAImageFilter();
119 
120  ~VCAImageFilter() override;
121 
122  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
123 
124  void GenerateOutputInformation() override;
125 
126  void GenerateData() override;
127 
128 private:
129  VCAImageFilter(const Self&) = delete;
130  void operator=(const Self&) = delete;
131 
132  unsigned int m_NumberOfEndmembers;
133 };
134 
135 } // end namesapce otb
136 
137 #include "otbVcaImageFilter.hxx"
138 
139 #endif /* otbVCAImageFilter_h */
Applies a projective projection to each pixel of an image.
A generic functor filter templated by its functor.
Creation of an "otb" image which contains metadata.
Definition: otbImage.h:92
Apply a matrix multiplication over the channels of an image.
Performs a Principal Component Analysis.
This class streams the whole input image through the PersistentMinMaxImageFilter.
This class streams the whole input image through the PersistentStatisticsImageFilter.
This class streams the whole input image through the PersistentStatisticsImageFilter.
Estimates the endmembers present in a hyperspectral image.
otb::ProjectiveProjectionImageFilter< VectorImageType, VectorImageType, PrecisionType > ProjectiveProjectionImageFilterType
unsigned int m_NumberOfEndmembers
VectorImageType::IndexType IndexType
otb::StreamingStatisticsImageFilter< ImageType > StreamingStatisticsImageFilterType
void operator=(const Self &)=delete
otb::PCAImageFilter< VectorImageType, VectorImageType, otb::Transform::INVERSE > InversePCAImageFilterType
void Update() override
otb::ConcatenateScalarValueImageFilter< VectorImageType, VectorImageType > ConcatenateScalarValueImageFilterType
otb::DotProductImageFilter< VectorImageType, ImageType > DotProductImageFilterType
otb::MatrixImageFilter< VectorImageType, VectorImageType > MatrixImageFilterType
itk::ImageToImageFilter< TVectorImage, TVectorImage > Superclass
VCAImageFilter(const Self &)=delete
otb::VectorImageToMatrixImageFilter< VectorImageType > VectorImageToMatrixImageFilterType
itk::SmartPointer< Self > Pointer
void EnlargeOutputRequestedRegion(itk::DataObject *) override
otb::PCAImageFilter< VectorImageType, VectorImageType, otb::Transform::FORWARD > ForwardPCAImageFilterType
otb::Image< InternalPixelType > ImageType
otb::VectorImageToAmplitudeImageFilter< VectorImageType, ImageType > VectorImageToAmplitudeImageFilterType
VectorImageType::SizeType SizeType
TVectorImage VectorImageType
otb::StreamingMinMaxImageFilter< ImageType > StreamingMinMaxImageFilterType
itk::Statistics::MersenneTwisterRandomVariateGenerator RandomVariateGeneratorType
VectorImageType::PixelType PixelType
InternalPixelType PrecisionType
VectorImageType::RegionType RegionType
itk::AbsImageFilter< ImageType, ImageType > AbsImageFilterType
otb::StreamingStatisticsVectorImageFilter< VectorImageType, PrecisionType > StreamingStatisticsVectorImageFilterType
itk::SmartPointer< const Self > ConstPointer
VectorImageType::InternalPixelType InternalPixelType
This filter returns the the amplitude of the pixel vector.
This class streams the whole input image through the PersistentStatisticsImageFilter.
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.