OTB  7.2.0
Orfeo Toolbox
otbMultivariateAlterationDetectorImageFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2020 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 otbMultivariateAlterationDetectorImageFilter_h
22 #define otbMultivariateAlterationDetectorImageFilter_h
23 
24 
27 
28 #include "vnl/vnl_vector.h"
29 #include "vnl/vnl_matrix.h"
30 
31 namespace otb
32 {
33 
80 template <class TInputImage, class TOutputImage>
81 class ITK_EXPORT MultivariateAlterationDetectorImageFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage>
82 {
83 public:
86  typedef itk::ImageToImageFilter<TInputImage, TOutputImage> Superclass;
87  typedef itk::SmartPointer<Self> Pointer;
88  typedef itk::SmartPointer<const Self> ConstPointer;
89 
91  itkNewMacro(Self);
92 
94  itkTypeMacro(MultivariateAlterationDetectorImageFilter, ImageToImageFilter);
95 
97  typedef TInputImage InputImageType;
98  typedef typename InputImageType::Pointer InputImagePointer;
99  typedef typename InputImageType::ConstPointer InputImageConstPointer;
100  typedef typename InputImageType::RegionType InputImageRegionType;
101  typedef typename InputImageType::PixelType InputImagePixelType;
102  typedef TOutputImage OutputImageType;
103  typedef typename OutputImageType::Pointer OutputImagePointer;
104  typedef typename OutputImageType::RegionType OutputImageRegionType;
105  typedef typename OutputImageType::PixelType OutputImagePixelType;
106 
112 
115  typedef typename MatrixType::InternalMatrixType InternalMatrixType;
117 
118  typedef typename VectorType::ValueType RealType;
119 
120  typedef vnl_vector<RealType> VnlVectorType;
121  typedef vnl_matrix<RealType> VnlMatrixType;
122 
124  itkGetMacro(Mean1, VnlVectorType);
125 
127  itkGetMacro(Mean2, VnlVectorType);
128 
132  itkGetMacro(V1, VnlMatrixType);
133 
137  itkGetMacro(V2, VnlMatrixType);
138 
140  itkGetMacro(Rho, VnlVectorType);
141 
143  itkGetObjectMacro(CovarianceEstimator, CovarianceEstimatorType);
144 
146  void SetInput1(const TInputImage* image1);
147 
149  void SetInput2(const TInputImage* image2);
150 
152  const TInputImage* GetInput1();
153  const TInputImage* GetInput2();
155 
156 protected:
159  {
160  }
161 
162  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId) override;
163 
164  void GenerateOutputInformation() override;
165 
166 private:
167  MultivariateAlterationDetectorImageFilter(const Self&) = delete;
168  void operator=(const Self&) = delete;
169 
170  CovarianceEstimatorPointer m_CovarianceEstimator;
171  MatrixType m_CovarianceMatrix;
172  VectorType m_MeanValues;
173 
174  VnlMatrixType m_V1;
175  VnlMatrixType m_V2;
176  VnlVectorType m_Mean1;
177  VnlVectorType m_Mean2;
178  VnlVectorType m_Rho;
179 };
180 
181 } // end namespace otb
182 
183 #ifndef OTB_MANUAL_INSTANTIATION
185 #endif
186 
187 #endif
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
StreamingStatisticsVectorImageFilter< InputImageType > CovarianceEstimatorType
This filter implements the Multivariate Alteration Detector.
otb::ConcatenateVectorImageFilter< InputImageType, InputImageType, InputImageType > ConcatenateImageFilterType
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
RealType ComponentType
Definition: mvdTypes.h:88
This filter concatenates the vector pixel of the first image with the vector pixel of the second imag...
This class streams the whole input image through the PersistentStatisticsImageFilter.