OTB  9.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-2022 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 */
otb::VCAImageFilter::StreamingStatisticsImageFilterType
otb::StreamingStatisticsImageFilter< ImageType > StreamingStatisticsImageFilterType
Definition: otbVcaImageFilter.h:92
otb::VCAImageFilter::Superclass
itk::ImageToImageFilter< TVectorImage, TVectorImage > Superclass
Definition: otbVcaImageFilter.h:71
otb::VCAImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbVcaImageFilter.h:72
otb::ConcatenateScalarValueImageFilter
Applies a projective projection to each pixel of an image.
Definition: otbConcatenateScalarValueImageFilter.h:102
otb::VCAImageFilter::PrecisionType
InternalPixelType PrecisionType
Definition: otbVcaImageFilter.h:81
otb::VCAImageFilter::InversePCAImageFilterType
otb::PCAImageFilter< VectorImageType, VectorImageType, otb::Transform::INVERSE > InversePCAImageFilterType
Definition: otbVcaImageFilter.h:95
otbStreamingStatisticsImageFilter.h
otbImage.h
otbStreamingMinMaxImageFilter.h
otb::FunctorImageFilter
A generic functor filter templated by its functor.
Definition: otbFunctorImageFilter.h:322
otb::VCAImageFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbVcaImageFilter.h:73
otb::VCAImageFilter::IndexType
VectorImageType::IndexType IndexType
Definition: otbVcaImageFilter.h:76
otb::PCAImageFilter
Performs a Principal Component Analysis.
Definition: otbPCAImageFilter.h:53
otbVectorImageToAmplitudeImageFilter.h
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::Image
Creation of an "otb" image which contains metadata.
Definition: otbImage.h:89
otb::VCAImageFilter::InternalPixelType
VectorImageType::InternalPixelType InternalPixelType
Definition: otbVcaImageFilter.h:80
otb::VCAImageFilter::ForwardPCAImageFilterType
otb::PCAImageFilter< VectorImageType, VectorImageType, otb::Transform::FORWARD > ForwardPCAImageFilterType
Definition: otbVcaImageFilter.h:94
otb::VCAImageFilter::m_NumberOfEndmembers
unsigned int m_NumberOfEndmembers
Definition: otbVcaImageFilter.h:132
otb::VCAImageFilter::EnlargeOutputRequestedRegion
void EnlargeOutputRequestedRegion(itk::DataObject *) override
Definition: otbVcaImageFilter.h:112
otbVcaImageFilter.hxx
otb::VCAImageFilter::SizeType
VectorImageType::SizeType SizeType
Definition: otbVcaImageFilter.h:77
otb::VCAImageFilter::RandomVariateGeneratorType
itk::Statistics::MersenneTwisterRandomVariateGenerator RandomVariateGeneratorType
Definition: otbVcaImageFilter.h:93
otbProjectiveProjectionImageFilter.h
otb::VCAImageFilter::VectorImageType
TVectorImage VectorImageType
Definition: otbVcaImageFilter.h:75
otb::VectorImageToAmplitudeImageFilter
This filter returns the the amplitude of the pixel vector.
Definition: otbVectorImageToAmplitudeImageFilter.h:63
otb::VCAImageFilter::ImageType
otb::Image< InternalPixelType > ImageType
Definition: otbVcaImageFilter.h:83
otb::VCAImageFilter
Estimates the endmembers present in a hyperspectral image.
Definition: otbVcaImageFilter.h:67
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::VCAImageFilter::MatrixImageFilterType
otb::MatrixImageFilter< VectorImageType, VectorImageType > MatrixImageFilterType
Definition: otbVcaImageFilter.h:88
otb::VCAImageFilter::VectorImageToAmplitudeImageFilterType
otb::VectorImageToAmplitudeImageFilter< VectorImageType, ImageType > VectorImageToAmplitudeImageFilterType
Definition: otbVcaImageFilter.h:96
otb::StreamingStatisticsImageFilter
This class streams the whole input image through the PersistentStatisticsImageFilter.
Definition: otbStreamingStatisticsImageFilter.h:234
otbConcatenateScalarValueImageFilter.h
otbDotProductImageFilter.h
otb::StreamingMinMaxImageFilter
This class streams the whole input image through the PersistentMinMaxImageFilter.
Definition: otbStreamingMinMaxImageFilter.h:194
otb::VCAImageFilter::Update
void Update() override
Definition: otbVcaImageFilter.h:107
otb::VCAImageFilter::StreamingStatisticsVectorImageFilterType
otb::StreamingStatisticsVectorImageFilter< VectorImageType, PrecisionType > StreamingStatisticsVectorImageFilterType
Definition: otbVcaImageFilter.h:91
otb::VCAImageFilter::StreamingMinMaxImageFilterType
otb::StreamingMinMaxImageFilter< ImageType > StreamingMinMaxImageFilterType
Definition: otbVcaImageFilter.h:90
otb::VCAImageFilter::RegionType
VectorImageType::RegionType RegionType
Definition: otbVcaImageFilter.h:78
otbVectorImageToMatrixImageFilter.h
otb::VectorImageToMatrixImageFilter
This class streams the whole input image through the PersistentStatisticsImageFilter.
Definition: otbVectorImageToMatrixImageFilter.h:152
otb::VCAImageFilter::ProjectiveProjectionImageFilterType
otb::ProjectiveProjectionImageFilter< VectorImageType, VectorImageType, PrecisionType > ProjectiveProjectionImageFilterType
Definition: otbVcaImageFilter.h:86
otb::VCAImageFilter::DotProductImageFilterType
otb::DotProductImageFilter< VectorImageType, ImageType > DotProductImageFilterType
Definition: otbVcaImageFilter.h:87
otb::VCAImageFilter::ConcatenateScalarValueImageFilterType
otb::ConcatenateScalarValueImageFilter< VectorImageType, VectorImageType > ConcatenateScalarValueImageFilterType
Definition: otbVcaImageFilter.h:97
otbPCAImageFilter.h
otb::VCAImageFilter::AbsImageFilterType
itk::AbsImageFilter< ImageType, ImageType > AbsImageFilterType
Definition: otbVcaImageFilter.h:85
otb::VCAImageFilter::VectorImageToMatrixImageFilterType
otb::VectorImageToMatrixImageFilter< VectorImageType > VectorImageToMatrixImageFilterType
Definition: otbVcaImageFilter.h:89
otb::VCAImageFilter::Self
VCAImageFilter Self
Definition: otbVcaImageFilter.h:70
otb::VCAImageFilter::PixelType
VectorImageType::PixelType PixelType
Definition: otbVcaImageFilter.h:79