OTB  10.0.0
Orfeo Toolbox
otbKullbackLeiblerSupervizedDistanceImageFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 Centre National d'Etudes Spatiales (CNES)
3  * Copyright (C) 2007-2012 Institut Mines Telecom / Telecom Bretagne
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 
23 #ifndef otbKullbackLeiblerSupervizedDistanceImageFilter_h
24 #define otbKullbackLeiblerSupervizedDistanceImageFilter_h
25 
27 
28 #include "otbROIdataConversion.h"
29 
30 namespace otb
31 {
32 
66 namespace Functor
67 {
74 template <class TInput1, class TInput2, class TInputROIImage, class TOutput>
76 {
77 public:
80 
82  void Evaluate(const typename TInput1::ImageType* img1, const typename TInput2::ImageType* img2, const TInputROIImage* imgROI);
83 
85  TOutput operator()(const TInput1& it1, const TInput2& it2);
86 
87 protected:
89 
90  typedef itk::ConstNeighborhoodIterator<typename ROIConversionType1::OutputImageType> ROIInputType1;
91 
93 
94  typedef itk::ConstNeighborhoodIterator<typename ROIConversionType2::OutputImageType> ROIInputType2;
95 
98 
99 private:
101 };
102 
103 } // Functor
104 
105 template <class TInputImage1, class TInputImage2, class TInputROIImage, class TOutputImage>
108  TInputImage1, TInputImage2, TOutputImage,
109  Functor::KullbackLeiblerSupervizedDistance<typename itk::ConstNeighborhoodIterator<TInputImage1>,
110  typename itk::ConstNeighborhoodIterator<TInputImage2>, TInputROIImage, typename TOutputImage::PixelType>>
111 {
112 public:
116  TInputImage1, TInputImage2, TOutputImage,
118  TInputROIImage, typename TOutputImage::PixelType>>
120  typedef itk::SmartPointer<Self> Pointer;
121  typedef itk::SmartPointer<const Self> ConstPointer;
122 
124  typedef typename TInputImage1::PixelType MeasurementType1;
125  typedef typename TInputImage2::PixelType MeasurementType2;
126 
127  typedef std::vector<MeasurementType1> TrainingMeasureType1;
128  typedef std::vector<MeasurementType2> TrainingMeasureType2;
129 
131  itkNewMacro(Self);
132 
135  void SetTrainingArea(const TInputROIImage* trainingImage);
136 
137 protected:
138  void BeforeThreadedGenerateData(void) override;
139 
141  {
142  this->SetNumberOfRequiredInputs(3);
143  }
145  {
146  }
147 
148 private:
150  void operator=(const Self&) = delete;
151 };
152 
153 } // namespace otb
154 
155 #ifndef OTB_MANUAL_INSTANTIATION
157 #endif
158 
159 #endif
Implements neighborhood-wise generic operation of two images.
Functor for KullbackLeiblerSupervizedDistanceImageFilter. Please refer to KullbackLeiblerSupervizedDi...
itk::ConstNeighborhoodIterator< typename ROIConversionType1::OutputImageType > ROIInputType1
itk::ConstNeighborhoodIterator< typename ROIConversionType2::OutputImageType > ROIInputType2
KullbackLeiblerSupervizedDistance(const KullbackLeiblerSupervizedDistance &)
ROIdataConversion< typename TInput2::ImageType, TInputROIImage > ROIConversionType2
ROIdataConversion< typename TInput1::ImageType, TInputROIImage > ROIConversionType1
void Evaluate(const typename TInput1::ImageType *img1, const typename TInput2::ImageType *img2, const TInputROIImage *imgROI)
Implements KullbackLeibler distance over Edgeworth approximation, between a Neighborhood and a predef...
KullbackLeiblerSupervizedDistanceImageFilter(const Self &)=delete
otb::BinaryFunctorNeighborhoodImageFilter< TInputImage1, TInputImage2, TOutputImage, Functor::KullbackLeiblerSupervizedDistance< typename itk::ConstNeighborhoodIterator< TInputImage1 >, typename itk::ConstNeighborhoodIterator< TInputImage2 >, TInputROIImage, typename TOutputImage::PixelType > > Superclass
image data to vector conversion.
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.