OTB  9.0.0
Orfeo Toolbox
otbStreamingWarpImageFilter.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 otbStreamingWarpImageFilter_h
22 #define otbStreamingWarpImageFilter_h
23 
24 #include "itkWarpImageFilter.h"
25 #include "otbStreamingTraits.h"
26 
27 namespace otb
28 {
29 
51 template <class TInputImage, class TOutputImage, class TDisplacementField>
52 class ITK_EXPORT StreamingWarpImageFilter : public itk::WarpImageFilter<TInputImage, TOutputImage, TDisplacementField>
53 {
54 public:
57  typedef itk::WarpImageFilter<TInputImage, TOutputImage, TDisplacementField> Superclass;
58  typedef itk::SmartPointer<Self> Pointer;
59  typedef itk::SmartPointer<const Self> ConstPointer;
60 
62  itkNewMacro(Self);
63 
65  itkTypeMacro(StreamingWarpImageFilter, itk::WarpImageFilter);
66 
68  typedef TInputImage InputImageType;
69  typedef typename InputImageType::Pointer InputImagePointerType;
70  typedef TOutputImage OutputImageType;
71  typedef typename OutputImageType::PointType PointType;
72  typedef typename OutputImageType::IndexType IndexType;
73  typedef typename OutputImageType::PixelType PixelType;
74  typedef typename OutputImageType::SpacingType SpacingType;
75  typedef typename OutputImageType::Pointer OutputImagePointerType;
76  typedef typename OutputImageType::RegionType OutputImageRegionType;
77  typedef TDisplacementField DisplacementFieldType;
78  typedef typename DisplacementFieldType::PixelType DisplacementValueType;
79  typedef typename DisplacementFieldType::Pointer DisplacementFieldPointerType;
80  typedef typename DisplacementFieldType::RegionType DisplacementFieldRegionType;
81 
83  itkSetMacro(MaximumDisplacement, DisplacementValueType);
84  itkGetConstReferenceMacro(MaximumDisplacement, DisplacementValueType);
86 
87  const SpacingType& GetOutputSpacing() const override
88  {
89  return m_OutputSignedSpacing;
90  };
91 
92  void SetOutputSpacing(const SpacingType OutputSpacing) override;
93  void SetOutputSpacing(const double* values) override;
94 
95 protected:
98 
101  {
102  }
103 
105  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
106 
111  void GenerateInputRequestedRegion() override;
112 
113  void GenerateOutputInformation() override;
114 
118  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId) override;
119 
120 private:
121  StreamingWarpImageFilter(const Self&) = delete;
122  void operator=(const Self&) = delete;
123 
124  // Because of itk positive spacing we need this member to be compliant with otb
125  // signed spacing
127 
128  // Assessment of the maximum displacement for streaming
130 };
131 
132 } // end namespace otb
133 
134 #ifndef OTB_MANUAL_INSTANTIATION
136 #endif
137 
138 #endif
otb::StreamingWarpImageFilter::PixelType
OutputImageType::PixelType PixelType
Definition: otbStreamingWarpImageFilter.h:73
otb::StreamingWarpImageFilter::m_MaximumDisplacement
DisplacementValueType m_MaximumDisplacement
Definition: otbStreamingWarpImageFilter.h:129
otb::StreamingWarpImageFilter::OutputImageType
TOutputImage OutputImageType
Definition: otbStreamingWarpImageFilter.h:70
otb::StreamingWarpImageFilter::InputImagePointerType
InputImageType::Pointer InputImagePointerType
Definition: otbStreamingWarpImageFilter.h:69
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::StreamingWarpImageFilter::IndexType
OutputImageType::IndexType IndexType
Definition: otbStreamingWarpImageFilter.h:72
otb::StreamingWarpImageFilter::InputImageType
TInputImage InputImageType
Definition: otbStreamingWarpImageFilter.h:65
otb::StreamingWarpImageFilter::~StreamingWarpImageFilter
~StreamingWarpImageFilter() override
Definition: otbStreamingWarpImageFilter.h:100
otb::StreamingWarpImageFilter::Self
StreamingWarpImageFilter Self
Definition: otbStreamingWarpImageFilter.h:56
otb::StreamingWarpImageFilter::m_OutputSignedSpacing
SpacingType m_OutputSignedSpacing
Definition: otbStreamingWarpImageFilter.h:126
otb::StreamingWarpImageFilter::DisplacementFieldRegionType
DisplacementFieldType::RegionType DisplacementFieldRegionType
Definition: otbStreamingWarpImageFilter.h:80
otb::StreamingWarpImageFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbStreamingWarpImageFilter.h:58
otb::StreamingWarpImageFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbStreamingWarpImageFilter.h:59
otbStreamingTraits.h
otb::StreamingWarpImageFilter::DisplacementFieldPointerType
DisplacementFieldType::Pointer DisplacementFieldPointerType
Definition: otbStreamingWarpImageFilter.h:79
otb::StreamingWarpImageFilter::OutputImageRegionType
OutputImageType::RegionType OutputImageRegionType
Definition: otbStreamingWarpImageFilter.h:76
otb::StreamingWarpImageFilter::Superclass
itk::WarpImageFilter< TInputImage, TOutputImage, TDisplacementField > Superclass
Definition: otbStreamingWarpImageFilter.h:57
otb::StreamingWarpImageFilter::SpacingType
OutputImageType::SpacingType SpacingType
Definition: otbStreamingWarpImageFilter.h:74
otb::StreamingWarpImageFilter::DisplacementValueType
DisplacementFieldType::PixelType DisplacementValueType
Definition: otbStreamingWarpImageFilter.h:78
otb::StreamingWarpImageFilter::GetOutputSpacing
const SpacingType & GetOutputSpacing() const override
Definition: otbStreamingWarpImageFilter.h:87
otbStreamingWarpImageFilter.hxx
otb::StreamingWarpImageFilter::PointType
OutputImageType::PointType PointType
Definition: otbStreamingWarpImageFilter.h:71
otb::StreamingWarpImageFilter::DisplacementFieldType
TDisplacementField DisplacementFieldType
Definition: otbStreamingWarpImageFilter.h:77
otb::StreamingWarpImageFilter
This class acts like the itk::WarpImageFilter, but it does not request the largest possible region of...
Definition: otbStreamingWarpImageFilter.h:52
otb::StreamingWarpImageFilter::OutputImagePointerType
OutputImageType::Pointer OutputImagePointerType
Definition: otbStreamingWarpImageFilter.h:75