OTB  9.0.0
Orfeo Toolbox
otbStreamingMosaicFilterWithBlendingBase.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  * Copyright (C) 2016-2019 IRSTEA
5  *
6  * This file is part of Orfeo Toolbox
7  *
8  * https://www.orfeo-toolbox.org/
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  */
22 #ifndef __StreamingMosaicFilterWithBlendingBase_H
23 #define __StreamingMosaicFilterWithBlendingBase_H
24 
26 #include "itkNearestNeighborInterpolateImageFunction.h"
27 #include "otbStreamingTraits.h"
28 
29 namespace otb
30 {
48 template <class TInputImage, class TOutputImage, class TDistanceImage, class TInternalValueType = double>
49 class ITK_EXPORT StreamingMosaicFilterWithBlendingBase : public otb::StreamingMosaicFilterBase<TInputImage, TOutputImage, TInternalValueType>
50 {
51 public:
55  typedef itk::SmartPointer<Self> Pointer;
56  typedef itk::SmartPointer<const Self> ConstPointer;
57 
60 
62  typedef TDistanceImage DistanceImageType;
63  typedef typename DistanceImageType::Pointer DistanceImagePointer;
64  typedef typename DistanceImageType::ConstPointer DistanceImageConstPointer;
65  typedef typename DistanceImageType::PointType DistanceImagePointType;
66  typedef typename DistanceImageType::PixelType DistanceImagePixelType;
67  typedef typename DistanceImageType::InternalPixelType DistanceImageInternalPixelType;
68  typedef typename itk::InterpolateImageFunction<DistanceImageType> DistanceImageInterpolatorType;
69  typedef typename itk::LinearInterpolateImageFunction<DistanceImageType> DistanceImageDefaultInterpolatorType;
70  typedef typename DistanceImageInterpolatorType::Pointer DistanceImageInterpolatorPointer;
71  typedef typename DistanceImageType::RegionType DistanceImageRegionType;
72 
74  itkSetMacro(DistanceOffset, DistanceImageInternalPixelType);
75  itkGetMacro(DistanceOffset, DistanceImageInternalPixelType);
77 
79  itkSetObjectMacro(DistanceInterpolator, DistanceImageInterpolatorType);
80  itkGetObjectMacro(DistanceInterpolator, DistanceImageInterpolatorType);
82 
88  void PushBackInputs(const TInputImage* image, const TDistanceImage* distance)
89  {
90  this->PushBackInput(const_cast<TInputImage*>(image));
91  this->PushBackInput(const_cast<TDistanceImage*>(distance));
92  }
94 
96  virtual void PrepareDistanceImageAccessors(typename std::vector<DistanceImageType*>& currentDistanceImage,
97  typename std::vector<DistanceImageInterpolatorPointer>& distanceInterpolator);
98 
99 protected:
102  {
103  }
104 
105  /* Overridden methods */
106  void AddUsedInputImageIndex(unsigned int inputImageIndex) override;
107 
108  unsigned int GetNumberOfInputImages() override;
109 
110  unsigned int GetUsedInputImageIndice(unsigned int i) override
111  {
112  return 0.5 * Superclass::GetUsedInputImageIndice(i);
113  }
114 
115 private:
116  StreamingMosaicFilterWithBlendingBase(const Self&); // purposely not
117  // implemented
118  void operator=(const Self&); // purposely not
119  // implemented
120 
123  // interpolator
124 
125 }; // end of class
126 
127 } // end namespace itk
128 
129 #ifndef OTB_MANUAL_INSTANTIATION
131 #endif
132 
133 #endif
otb::StreamingMosaicFilterWithBlendingBase::PushBackInputs
void PushBackInputs(const TInputImage *image, const TDistanceImage *distance)
Definition: otbStreamingMosaicFilterWithBlendingBase.h:88
otb::StreamingMosaicFilterWithBlendingBase::Superclass
otb::StreamingMosaicFilterBase< TInputImage, TOutputImage, TInternalValueType > Superclass
Definition: otbStreamingMosaicFilterWithBlendingBase.h:54
otb::StreamingMosaicFilterWithBlendingBase::~StreamingMosaicFilterWithBlendingBase
~StreamingMosaicFilterWithBlendingBase()
Definition: otbStreamingMosaicFilterWithBlendingBase.h:101
otb::StreamingMosaicFilterWithBlendingBase::m_DistanceInterpolator
DistanceImageInterpolatorPointer m_DistanceInterpolator
Definition: otbStreamingMosaicFilterWithBlendingBase.h:122
otb::StreamingMosaicFilterWithBlendingBase
Base class for mosaic filters with blending.
Definition: otbStreamingMosaicFilterWithBlendingBase.h:49
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::StreamingMosaicFilterWithBlendingBase::DistanceImageInterpolatorType
itk::InterpolateImageFunction< DistanceImageType > DistanceImageInterpolatorType
Definition: otbStreamingMosaicFilterWithBlendingBase.h:68
otb::StreamingMosaicFilterWithBlendingBase::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbStreamingMosaicFilterWithBlendingBase.h:55
otb::StreamingMosaicFilterWithBlendingBase::DistanceImageConstPointer
DistanceImageType::ConstPointer DistanceImageConstPointer
Definition: otbStreamingMosaicFilterWithBlendingBase.h:64
otbStreamingMosaicFilterWithBlendingBase.hxx
otbStreamingMosaicFilterBase.h
otb::StreamingMosaicFilterWithBlendingBase::DistanceImageInterpolatorPointer
DistanceImageInterpolatorType::Pointer DistanceImageInterpolatorPointer
Definition: otbStreamingMosaicFilterWithBlendingBase.h:70
otb::StreamingMosaicFilterWithBlendingBase::DistanceImagePixelType
DistanceImageType::PixelType DistanceImagePixelType
Definition: otbStreamingMosaicFilterWithBlendingBase.h:66
otb::StreamingMosaicFilterWithBlendingBase::GetUsedInputImageIndice
unsigned int GetUsedInputImageIndice(unsigned int i) override
Definition: otbStreamingMosaicFilterWithBlendingBase.h:110
otb::StreamingMosaicFilterWithBlendingBase::Self
StreamingMosaicFilterWithBlendingBase Self
Definition: otbStreamingMosaicFilterWithBlendingBase.h:53
otb::StreamingMosaicFilterWithBlendingBase::DistanceImageRegionType
DistanceImageType::RegionType DistanceImageRegionType
Definition: otbStreamingMosaicFilterWithBlendingBase.h:71
otb::StreamingMosaicFilterWithBlendingBase::DistanceImagePointType
DistanceImageType::PointType DistanceImagePointType
Definition: otbStreamingMosaicFilterWithBlendingBase.h:65
otb::StreamingMosaicFilterWithBlendingBase::DistanceImagePointer
DistanceImageType::Pointer DistanceImagePointer
Definition: otbStreamingMosaicFilterWithBlendingBase.h:63
otbStreamingTraits.h
otb::StreamingMosaicFilterWithBlendingBase::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbStreamingMosaicFilterWithBlendingBase.h:56
otb::StreamingMosaicFilterBase
Base class for mosaic filters. Computes the total extent of multiple inputs, and provide routines to ...
Definition: otbStreamingMosaicFilterBase.h:54
otb::StreamingMosaicFilterWithBlendingBase::DistanceImageDefaultInterpolatorType
itk::LinearInterpolateImageFunction< DistanceImageType > DistanceImageDefaultInterpolatorType
Definition: otbStreamingMosaicFilterWithBlendingBase.h:69
otb::StreamingMosaicFilterWithBlendingBase::DistanceImageType
TDistanceImage DistanceImageType
Definition: otbStreamingMosaicFilterWithBlendingBase.h:59
otb::StreamingMosaicFilterWithBlendingBase::DistanceImageInternalPixelType
DistanceImageType::InternalPixelType DistanceImageInternalPixelType
Definition: otbStreamingMosaicFilterWithBlendingBase.h:67
otb::StreamingMosaicFilterWithBlendingBase::m_DistanceOffset
DistanceImageInternalPixelType m_DistanceOffset
Definition: otbStreamingMosaicFilterWithBlendingBase.h:121