OTB  6.7.0
Orfeo Toolbox
otbDisparityTranslateFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 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 otbDisparityTranslateFilter_h
22 #define otbDisparityTranslateFilter_h
23 
24 #include "itkImageToImageFilter.h"
25 #include "otbVectorImage.h"
26 #include "otbImage.h"
27 
28 namespace otb
29 {
30 
46 template <class TDisparityImage, class TGridImage = otb::VectorImage<float,2> ,
47  class TSensorImage = otb::Image<unsigned short,2> , class TMaskImage = otb::Image<unsigned char,2> >
48 class ITK_EXPORT DisparityTranslateFilter :
49  public itk::ImageToImageFilter<TDisparityImage,TDisparityImage>
50 {
51 public:
54  typedef itk::ImageToImageFilter<TDisparityImage,
55  TDisparityImage> Superclass;
58 
60  itkNewMacro(Self);
61 
63  itkTypeMacro(DisparityTranslateFilter, ImageToImageFilter);
64 
66  typedef TDisparityImage DispMapType;
67  typedef TGridImage GridType;
68  typedef TMaskImage MaskType;
69  typedef TSensorImage SensorType;
70 
71  typedef typename DispMapType::PixelType PixelType;
72  typedef typename DispMapType::RegionType RegionType;
73  typedef typename DispMapType::SizeType SizeType;
77  typedef typename DispMapType::IndexValueType IndexValueType;
78 
79  typedef typename GridType::RegionType GridRegionType;
80 
82  itkSetMacro(NoDataValue, PixelType);
83  itkGetConstReferenceMacro(NoDataValue, PixelType);
85 
87  void SetHorizontalDisparityMapInput( const TDisparityImage * hmap );
88 
90  void SetVerticalDisparityMapInput( const TDisparityImage * vmap );
91 
93  void SetInverseEpipolarLeftGrid( const TGridImage * lgrid );
94 
96  void SetDirectEpipolarRightGrid( const TGridImage * rgrid );
97 
99  void SetDisparityMaskInput(const TMaskImage * mask);
100 
104  void SetLeftSensorImageInput( const TSensorImage * left);
105 
107  const TDisparityImage * GetHorizontalDisparityMapInput() const;
108  const TDisparityImage * GetVerticalDisparityMapInput() const;
109  const TGridImage * GetInverseEpipolarLeftGrid() const;
110  const TGridImage * GetDirectEpipolarRightGrid() const;
111  const TMaskImage * GetDisparityMaskInput() const;
112  const TSensorImage * GetLeftSensorImageInput() const;
114 
116  TDisparityImage * GetHorizontalDisparityMapOutput();
117  TDisparityImage * GetVerticalDisparityMapOutput();
119 
120 protected:
123 
126 
128  void GenerateOutputInformation() override;
129 
131  void GenerateInputRequestedRegion() override;
132 
134  void ThreadedGenerateData(const RegionType & outputRegionForThread, itk::ThreadIdType threadId) override;
135 
141  void VerifyInputInformation() override {}
142 
143 
144 private:
145  DisparityTranslateFilter(const Self&) = delete;
146  void operator=(const Self&) = delete;
147 
149 };
150 
151 } // end namespace otb
152 
153 #ifndef OTB_MANUAL_INSTANTIATION
155 #endif
156 
157 #endif
itk::Size< Monteverdi_DIMENSION > SizeType
Definition: mvdTypes.h:137
Translate epipolar disparities into sensor disparities.
OTBOSSIMAdapters_EXPORT char const * NoDataValue
itk::Index< Monteverdi_DIMENSION > IndexType
Definition: mvdTypes.h:133
itk::ImageToImageFilter< TDisparityImage, TDisparityImage > Superclass
unsigned int ThreadIdType
itk::SmartPointer< const Self > ConstPointer
VectorImageType::SpacingType SpacingType
Definition: mvdTypes.h:181
DispMapType::IndexValueType IndexValueType
VectorImageType::PointType PointType
Definition: mvdTypes.h:189