OTB  7.2.0
Orfeo Toolbox
otbImageToGenericRSOutputParameters.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2020 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 otbImageToGenericRSOutputParameters_h
22 #define otbImageToGenericRSOutputParameters_h
23 
24 #include "itkObject.h"
25 #include "otbGenericRSTransform.h"
26 #include <string>
27 
28 namespace otb
29 {
30 
55 template <class TImage>
56 class ImageToGenericRSOutputParameters : public itk::Object
57 {
58 public:
61  typedef itk::Object Superclass;
62  typedef itk::SmartPointer<Self> Pointer;
63  typedef itk::SmartPointer<const Self> ConstPointer;
64 
66  itkTypeMacro(ImageToGenericRSOutputParameters, itk::Object);
67 
69  itkNewMacro(Self);
70 
72  typedef TImage ImageType;
73  typedef typename ImageType::SizeType SizeType;
74  typedef typename ImageType::IndexType IndexType;
76  typedef typename ImageType::PointType PointType;
77 
81 
86  {
87  double minX;
88  double maxX;
89  double minY;
90  double maxY;
91  };
92 
94  itkSetConstObjectMacro(Input, ImageType);
95  itkGetConstObjectMacro(Input, ImageType);
97 
99  itkSetMacro(OutputOrigin, PointType);
100  itkGetMacro(OutputOrigin, PointType);
102 
104  itkSetMacro(OutputSpacing, SpacingType);
105  itkGetMacro(OutputSpacing, SpacingType);
107 
109  itkSetMacro(OutputSize, SizeType);
110  itkGetMacro(OutputSize, SizeType);
112 
114  itkSetMacro(EstimateIsotropicSpacing, bool);
115  itkGetMacro(EstimateIsotropicSpacing, bool);
116  itkBooleanMacro(EstimateIsotropicSpacing);
118 
123  void ForceSpacingTo(const SpacingType& spacing)
124  {
125  m_ForceSpacing = true;
126  this->SetOutputSpacing(spacing);
127  }
129 
134  void ForceSizeTo(const SizeType& size)
135  {
136  m_ForceSize = true;
137  this->SetOutputSize(size);
138  }
140 
147  void SetOutputProjectionRef(const std::string& ref)
148  {
149  m_Transform->SetInputProjectionRef(ref);
150  this->Modified();
151  }
153 
154  std::string GetInputProjectionRef() const
155  {
156  return m_Transform->GetOutputProjectionRef();
157  }
158 
163  {
164  m_Transform->SetOutputKeywordList(kwl);
165  this->Modified();
166  }
168 
170  {
171  return m_Transform->GetOutputKeywordList();
172  }
173 
175  void Compute();
176 
177 protected:
180  {
181  }
182 
183 private:
184  ImageToGenericRSOutputParameters(const Self&) = delete;
185  void operator=(const Self&) = delete;
186 
187  void UpdateTransform();
189  void EstimateOutputSpacing();
190  void EstimateOutputSize();
191  void EstimateOutputOrigin();
192 
193  typename ImageType::ConstPointer m_Input;
194  PointType m_OutputOrigin{0.0};
195  SpacingType m_OutputSpacing{0.0};
196  SizeType m_OutputSize{0,0};
198 
199  GenericRSTransformPointerType m_Transform;
200 
204 
205 }; // end of class ImageToGenericRSOutputParameters
206 
207 } // end of namespace otb
208 
209 #ifndef OTB_MANUAL_INSTANTIATION
211 #endif
212 
213 #endif
itk::Size< Monteverdi_DIMENSION > SizeType
Definition: mvdTypes.h:137
itk::Index< Monteverdi_DIMENSION > IndexType
Definition: mvdTypes.h:133
Storage and conversion for OSSIM metadata.
itk::SmartPointer< Self > Pointer
virtual void SetOutputSpacing(SpacingType _arg)
GenericRSTransformType::Pointer GenericRSTransformPointerType
virtual void SetOutputSize(SizeType _arg)
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
This is the class to handle generic remote sensing transform.
This class is a helper class to estimate the output parameters of an image after projection in a targ...
VectorImageType::SpacingType SpacingType
Definition: mvdTypes.h:175
void operator=(const Self &)=delete
VectorImageType::PointType PointType
Definition: mvdTypes.h:183