OTB  9.0.0
Orfeo Toolbox
otbKullbackLeiblerSupervizedDistanceImageFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 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:
149  KullbackLeiblerSupervizedDistanceImageFilter(const Self&) = delete;
150  void operator=(const Self&) = delete;
151 };
152 
153 } // namespace otb
154 
155 #ifndef OTB_MANUAL_INSTANTIATION
157 #endif
158 
159 #endif
otb::BinaryFunctorNeighborhoodImageFilter
Implements neighborhood-wise generic operation of two images.
Definition: otbBinaryFunctorNeighborhoodImageFilter.h:47
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::Functor::KullbackLeiblerSupervizedDistance::ROIConversionType1
ROIdataConversion< typename TInput1::ImageType, TInputROIImage > ROIConversionType1
Definition: otbKullbackLeiblerSupervizedDistanceImageFilter.h:88
otbKullbackLeiblerDistanceImageFilter.h
otb::Functor::KullbackLeiblerSupervizedDistance::operator()
TOutput operator()(const TInput1 &it1, const TInput2 &it2)
Definition: otbKullbackLeiblerSupervizedDistanceImageFilter.hxx:88
otb::KullbackLeiblerSupervizedDistanceImageFilter::TrainingMeasureType1
std::vector< MeasurementType1 > TrainingMeasureType1
Definition: otbKullbackLeiblerSupervizedDistanceImageFilter.h:127
otb::CumulantsForEdgeworth< ROIInputType1 >
otb::Functor::KullbackLeiblerSupervizedDistance::KullbackLeiblerSupervizedDistance
KullbackLeiblerSupervizedDistance()
Definition: otbKullbackLeiblerSupervizedDistanceImageFilter.hxx:35
otb::KullbackLeiblerSupervizedDistanceImageFilter::~KullbackLeiblerSupervizedDistanceImageFilter
~KullbackLeiblerSupervizedDistanceImageFilter() override
Definition: otbKullbackLeiblerSupervizedDistanceImageFilter.h:144
otb::Functor::KullbackLeiblerSupervizedDistance::ROIInputType2
itk::ConstNeighborhoodIterator< typename ROIConversionType2::OutputImageType > ROIInputType2
Definition: otbKullbackLeiblerSupervizedDistanceImageFilter.h:94
otb::KullbackLeiblerSupervizedDistanceImageFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbKullbackLeiblerSupervizedDistanceImageFilter.h:121
otb::KullbackLeiblerSupervizedDistanceImageFilter::MeasurementType2
TInputImage2::PixelType MeasurementType2
Definition: otbKullbackLeiblerSupervizedDistanceImageFilter.h:125
otb::KullbackLeiblerSupervizedDistanceImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbKullbackLeiblerSupervizedDistanceImageFilter.h:120
otb::KullbackLeiblerSupervizedDistanceImageFilter
Implements KullbackLeibler distance over Edgeworth approximation, between a Neighborhood and a predef...
Definition: otbKullbackLeiblerSupervizedDistanceImageFilter.h:106
otb::KullbackLeiblerSupervizedDistanceImageFilter::Self
KullbackLeiblerSupervizedDistanceImageFilter Self
Definition: otbKullbackLeiblerSupervizedDistanceImageFilter.h:114
otb::Functor::KullbackLeiblerSupervizedDistance::Evaluate
void Evaluate(const typename TInput1::ImageType *img1, const typename TInput2::ImageType *img2, const TInputROIImage *imgROI)
Definition: otbKullbackLeiblerSupervizedDistanceImageFilter.hxx:52
otb::ROIdataConversion
image data to vector conversion.
Definition: otbROIdataConversion.h:41
otb::Functor::KullbackLeiblerSupervizedDistance::ROIConversionType2
ROIdataConversion< typename TInput2::ImageType, TInputROIImage > ROIConversionType2
Definition: otbKullbackLeiblerSupervizedDistanceImageFilter.h:92
otb::Functor::KullbackLeiblerSupervizedDistance::m_CumROI1
CumulantsForEdgeworth< ROIInputType1 > * m_CumROI1
Definition: otbKullbackLeiblerSupervizedDistanceImageFilter.h:96
otb::Functor::KullbackLeiblerSupervizedDistance::~KullbackLeiblerSupervizedDistance
virtual ~KullbackLeiblerSupervizedDistance()
Definition: otbKullbackLeiblerSupervizedDistanceImageFilter.hxx:42
otb::Functor::KullbackLeiblerSupervizedDistance::ROIInputType1
itk::ConstNeighborhoodIterator< typename ROIConversionType1::OutputImageType > ROIInputType1
Definition: otbKullbackLeiblerSupervizedDistanceImageFilter.h:90
otb::KullbackLeiblerSupervizedDistanceImageFilter::Superclass
otb::BinaryFunctorNeighborhoodImageFilter< TInputImage1, TInputImage2, TOutputImage, Functor::KullbackLeiblerSupervizedDistance< typename itk::ConstNeighborhoodIterator< TInputImage1 >, typename itk::ConstNeighborhoodIterator< TInputImage2 >, TInputROIImage, typename TOutputImage::PixelType > > Superclass
Definition: otbKullbackLeiblerSupervizedDistanceImageFilter.h:119
otb::KullbackLeiblerSupervizedDistanceImageFilter::TrainingMeasureType2
std::vector< MeasurementType2 > TrainingMeasureType2
Definition: otbKullbackLeiblerSupervizedDistanceImageFilter.h:128
otb::KullbackLeiblerSupervizedDistanceImageFilter::KullbackLeiblerSupervizedDistanceImageFilter
KullbackLeiblerSupervizedDistanceImageFilter()
Definition: otbKullbackLeiblerSupervizedDistanceImageFilter.h:140
otb::Functor::KullbackLeiblerSupervizedDistance
Functor for KullbackLeiblerSupervizedDistanceImageFilter. Please refer to KullbackLeiblerSupervizedDi...
Definition: otbKullbackLeiblerSupervizedDistanceImageFilter.h:75
otbROIdataConversion.h
otb::Functor::KullbackLeiblerSupervizedDistance::m_CumROI2
CumulantsForEdgeworth< ROIInputType2 > * m_CumROI2
Definition: otbKullbackLeiblerSupervizedDistanceImageFilter.h:97
otb::KullbackLeiblerSupervizedDistanceImageFilter::MeasurementType1
TInputImage1::PixelType MeasurementType1
Definition: otbKullbackLeiblerSupervizedDistanceImageFilter.h:124
otbKullbackLeiblerSupervizedDistanceImageFilter.hxx