OTB  9.0.0
Orfeo Toolbox
otbDisparityTranslateFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 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>, class TSensorImage = otb::Image<unsigned short, 2>,
47  class TMaskImage = otb::Image<unsigned char, 2>>
48 class ITK_EXPORT DisparityTranslateFilter : public itk::ImageToImageFilter<TDisparityImage, TDisparityImage>
49 {
50 public:
53  typedef itk::ImageToImageFilter<TDisparityImage, TDisparityImage> Superclass;
54  typedef itk::SmartPointer<Self> Pointer;
55  typedef itk::SmartPointer<const Self> ConstPointer;
56 
58  itkNewMacro(Self);
59 
61  itkTypeMacro(DisparityTranslateFilter, ImageToImageFilter);
62 
64  typedef TDisparityImage DispMapType;
65  typedef TGridImage GridType;
66  typedef TMaskImage MaskType;
67  typedef TSensorImage SensorType;
68 
69  typedef typename DispMapType::PixelType PixelType;
70  typedef typename DispMapType::RegionType RegionType;
71  typedef typename DispMapType::SizeType SizeType;
72  typedef typename DispMapType::IndexType IndexType;
73  typedef typename DispMapType::SpacingType SpacingType;
74  typedef typename DispMapType::PointType PointType;
75  typedef typename DispMapType::IndexValueType IndexValueType;
76 
77  typedef typename GridType::RegionType GridRegionType;
78 
80  itkSetMacro(NoDataValue, PixelType);
81  itkGetConstReferenceMacro(NoDataValue, PixelType);
83 
85  void SetHorizontalDisparityMapInput(const TDisparityImage* hmap);
86 
88  void SetVerticalDisparityMapInput(const TDisparityImage* vmap);
89 
91  void SetInverseEpipolarLeftGrid(const TGridImage* lgrid);
92 
94  void SetDirectEpipolarRightGrid(const TGridImage* rgrid);
95 
97  void SetDisparityMaskInput(const TMaskImage* mask);
98 
102  void SetLeftSensorImageInput(const TSensorImage* left);
103 
105  const TDisparityImage* GetHorizontalDisparityMapInput() const;
106  const TDisparityImage* GetVerticalDisparityMapInput() const;
107  const TGridImage* GetInverseEpipolarLeftGrid() const;
108  const TGridImage* GetDirectEpipolarRightGrid() const;
109  const TMaskImage* GetDisparityMaskInput() const;
110  const TSensorImage* GetLeftSensorImageInput() const;
112 
114  TDisparityImage* GetHorizontalDisparityMapOutput();
115  TDisparityImage* GetVerticalDisparityMapOutput();
117 
118 protected:
121 
124 
126  void GenerateOutputInformation() override;
127 
129  void GenerateInputRequestedRegion() override;
130 
132  void ThreadedGenerateData(const RegionType& outputRegionForThread, itk::ThreadIdType threadId) override;
133 
139  void VerifyInputInformation() override
140  {
141  }
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
otb::DisparityTranslateFilter::Self
DisparityTranslateFilter Self
Definition: otbDisparityTranslateFilter.h:52
otb::DisparityTranslateFilter::SpacingType
DispMapType::SpacingType SpacingType
Definition: otbDisparityTranslateFilter.h:73
otb::DisparityTranslateFilter::GridRegionType
GridType::RegionType GridRegionType
Definition: otbDisparityTranslateFilter.h:77
otb::DisparityTranslateFilter::m_NoDataValue
PixelType m_NoDataValue
Definition: otbDisparityTranslateFilter.h:148
otb::DisparityTranslateFilter::MaskType
TMaskImage MaskType
Definition: otbDisparityTranslateFilter.h:66
otb::DisparityTranslateFilter::RegionType
DispMapType::RegionType RegionType
Definition: otbDisparityTranslateFilter.h:70
otbVectorImage.h
otb::DisparityTranslateFilter::~DisparityTranslateFilter
~DisparityTranslateFilter() override
Definition: otbDisparityTranslateFilter.h:123
otb::DisparityTranslateFilter::IndexValueType
DispMapType::IndexValueType IndexValueType
Definition: otbDisparityTranslateFilter.h:75
otbImage.h
otb::DisparityTranslateFilter::GridType
TGridImage GridType
Definition: otbDisparityTranslateFilter.h:65
otb::DisparityTranslateFilter::SensorType
TSensorImage SensorType
Definition: otbDisparityTranslateFilter.h:67
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::DisparityTranslateFilter::IndexType
DispMapType::IndexType IndexType
Definition: otbDisparityTranslateFilter.h:72
otb::DisparityTranslateFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbDisparityTranslateFilter.h:54
otb::DisparityTranslateFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbDisparityTranslateFilter.h:55
otb::DisparityTranslateFilter::SizeType
DispMapType::SizeType SizeType
Definition: otbDisparityTranslateFilter.h:71
otb::MetaDataKey::NoDataValue
OTBMetadata_EXPORT char const * NoDataValue
otb::DisparityTranslateFilter::VerifyInputInformation
void VerifyInputInformation() override
Definition: otbDisparityTranslateFilter.h:139
otb::DisparityTranslateFilter
Translate epipolar disparities into sensor disparities.
Definition: otbDisparityTranslateFilter.h:48
otbDisparityTranslateFilter.hxx
otb::DisparityTranslateFilter::PixelType
DispMapType::PixelType PixelType
Definition: otbDisparityTranslateFilter.h:69
otb::DisparityTranslateFilter::Superclass
itk::ImageToImageFilter< TDisparityImage, TDisparityImage > Superclass
Definition: otbDisparityTranslateFilter.h:53
otb::DisparityTranslateFilter::DispMapType
TDisparityImage DispMapType
Definition: otbDisparityTranslateFilter.h:61
otb::DisparityTranslateFilter::PointType
DispMapType::PointType PointType
Definition: otbDisparityTranslateFilter.h:74