OTB  6.7.0
Orfeo Toolbox
otbStreamingWarpImageFilter.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 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
53  : public itk::WarpImageFilter<TInputImage, TOutputImage, TDisplacementField>
54 {
55 public:
61 
63  itkNewMacro(Self);
64 
67 
69  typedef TInputImage InputImageType;
70  typedef typename InputImageType::Pointer InputImagePointerType;
71  typedef TOutputImage OutputImageType;
74  typedef typename OutputImageType::PixelType PixelType;
76  typedef typename OutputImageType::Pointer OutputImagePointerType;
77  typedef typename OutputImageType::RegionType OutputImageRegionType;
78  typedef TDisplacementField DisplacementFieldType;
79  typedef typename DisplacementFieldType::PixelType DisplacementValueType;
80  typedef typename DisplacementFieldType::Pointer DisplacementFieldPointerType;
81  typedef typename DisplacementFieldType::RegionType DisplacementFieldRegionType;
82 
84  itkSetMacro(MaximumDisplacement, DisplacementValueType);
85  itkGetConstReferenceMacro(MaximumDisplacement, DisplacementValueType);
87 
88  const SpacingType & GetOutputSpacing() const override
89  {
90  return m_OutputSignedSpacing;
91  };
92 
93  void SetOutputSpacing( const SpacingType OutputSpacing ) override ;
94  void SetOutputSpacing( const double *values ) override ;
95 
96 protected:
99 
102 
104  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
105 
110  void GenerateInputRequestedRegion() override;
111 
112  void GenerateOutputInformation() override;
113 
117  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
118  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
const SpacingType & GetOutputSpacing() const override
itk::SmartPointer< const Self > ConstPointer
DisplacementFieldType::RegionType DisplacementFieldRegionType
OutputImageType::SpacingType SpacingType
OutputImageType::Pointer OutputImagePointerType
itk::Index< Monteverdi_DIMENSION > IndexType
Definition: mvdTypes.h:133
unsigned int ThreadIdType
itk::WarpImageFilter< TInputImage, TOutputImage, TDisplacementField > Superclass
DisplacementFieldType::Pointer DisplacementFieldPointerType
DisplacementFieldType::PixelType DisplacementValueType
OutputImageType::PixelType PixelType
OutputImageType::RegionType OutputImageRegionType
VectorImageType::SpacingType SpacingType
Definition: mvdTypes.h:181
OutputImageType::IndexType IndexType
This class acts like the itk::WarpImageFilter, but it does not request the largest possible region of...
VectorImageType::PointType PointType
Definition: mvdTypes.h:189
OutputImageType::PointType PointType
InputImageType::Pointer InputImagePointerType