OTB  6.7.0
Orfeo Toolbox
otbImageToGenericRSOutputParameters.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 otbImageToGenericRSOutputParameters_h
22 #define otbImageToGenericRSOutputParameters_h
23 
24 #include "itkObject.h"
25 #include "otbGenericRSTransform.h"
26 #include <string>
27 
28 namespace otb {
29 
54 template<class TImage>
56  public itk::Object
57 {
58 public:
64 
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  double minX;
87  double maxX;
88  double minY;
89  double maxY;
90  };
91 
93  itkSetConstObjectMacro(Input, ImageType);
94  itkGetConstObjectMacro(Input, ImageType);
96 
98  itkSetMacro(OutputOrigin, PointType);
99  itkGetMacro(OutputOrigin, PointType);
101 
103  itkSetMacro(OutputSpacing, SpacingType);
104  itkGetMacro(OutputSpacing, SpacingType);
106 
108  itkSetMacro(OutputSize, SizeType);
109  itkGetMacro(OutputSize, SizeType);
111 
113  itkSetMacro(EstimateIsotropicSpacing, bool);
114  itkGetMacro(EstimateIsotropicSpacing, bool);
115  itkBooleanMacro(EstimateIsotropicSpacing);
117 
122  void ForceSpacingTo(const SpacingType& spacing)
123  {
124  m_ForceSpacing = true;
125  this->SetOutputSpacing(spacing);
126  }
128 
133  void ForceSizeTo(const SizeType& size)
134  {
135  m_ForceSize = true;
136  this->SetOutputSize(size);
137  }
139 
146  void SetOutputProjectionRef(const std::string& ref)
147  {
148  m_Transform->SetInputProjectionRef(ref);
149  this->Modified();
150  }
152 
153  std::string GetInputProjectionRef() const
154  {
155  return m_Transform->GetOutputProjectionRef();
156  }
157 
160  {
161  m_Transform->SetOutputKeywordList(kwl);
162  this->Modified();
163  }
165 
167  {
168  return m_Transform->GetOutputKeywordList();
169  }
170 
172  void Compute();
173 
174 protected:
177 
178 private:
179  ImageToGenericRSOutputParameters(const Self&) = delete;
180  void operator=(const Self&) = delete;
181 
182  void UpdateTransform();
184  void EstimateOutputSpacing();
185  void EstimateOutputSize();
186  void EstimateOutputOrigin();
187 
188  typename ImageType::ConstPointer m_Input;
193 
195 
199 
200 }; // end of class ImageToGenericRSOutputParameters
201 
202 } // end of namespace otb
203 
204 #ifndef OTB_MANUAL_INSTANTIATION
206 #endif
207 
208 #endif
itk::Size< Monteverdi_DIMENSION > SizeType
Definition: mvdTypes.h:137
Storage and conversion for OSSIM metadata.
virtual void SetOutputSpacing(SpacingType _arg)
GenericRSTransformType::Pointer GenericRSTransformPointerType
itk::Index< Monteverdi_DIMENSION > IndexType
Definition: mvdTypes.h:133
virtual void SetOutputSize(SizeType _arg)
virtual void Modified() const
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:181
void operator=(const Self &)=delete
VectorImageType::PointType PointType
Definition: mvdTypes.h:189