OTB  9.0.0
Orfeo Toolbox
otbImageToGenericRSOutputParameters.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 otbImageToGenericRSOutputParameters_h
22 #define otbImageToGenericRSOutputParameters_h
23 
24 #include "itkObject.h"
25 #include "otbGenericRSTransform.h"
26 #include "otbImageMetadata.h"
27 #include <string>
28 
29 namespace otb
30 {
31 
56 template <class TImage>
57 class ImageToGenericRSOutputParameters : public itk::Object
58 {
59 public:
62  typedef itk::Object Superclass;
63  typedef itk::SmartPointer<Self> Pointer;
64  typedef itk::SmartPointer<const Self> ConstPointer;
65 
67  itkTypeMacro(ImageToGenericRSOutputParameters, itk::Object);
68 
70  itkNewMacro(Self);
71 
73  typedef TImage ImageType;
74  typedef typename ImageType::SizeType SizeType;
75  typedef typename ImageType::IndexType IndexType;
76  typedef typename ImageType::SpacingType SpacingType;
77  typedef typename ImageType::PointType PointType;
78 
82 
87  {
88  double minX;
89  double maxX;
90  double minY;
91  double maxY;
92  };
93 
95  itkSetConstObjectMacro(Input, ImageType);
96  itkGetConstObjectMacro(Input, ImageType);
98 
100  itkSetMacro(OutputOrigin, PointType);
101  itkGetMacro(OutputOrigin, PointType);
103 
105  itkSetMacro(OutputSpacing, SpacingType);
106  itkGetMacro(OutputSpacing, SpacingType);
108 
110  itkSetMacro(OutputSize, SizeType);
111  itkGetMacro(OutputSize, SizeType);
113 
115  itkSetMacro(EstimateIsotropicSpacing, bool);
116  itkGetMacro(EstimateIsotropicSpacing, bool);
117  itkBooleanMacro(EstimateIsotropicSpacing);
119 
124  void ForceSpacingTo(const SpacingType& spacing)
125  {
126  m_ForceSpacing = true;
127  this->SetOutputSpacing(spacing);
128  }
130 
135  void ForceSizeTo(const SizeType& size)
136  {
137  m_ForceSize = true;
138  this->SetOutputSize(size);
139  }
141 
148  void SetOutputProjectionRef(const std::string& ref)
149  {
150  m_Transform->SetInputProjectionRef(ref);
151  this->Modified();
152  }
154 
155  std::string GetInputProjectionRef() const
156  {
157  return m_Transform->GetOutputProjectionRef();
158  }
159 
163  {
164  m_Transform->SetOutputImageMetadata(imd);
165  this->Modified();
166  }
168 
170  {
171  return m_Transform->GetOutputImageMetadata();
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;
198 
200 
204 
205 }; // end of class ImageToGenericRSOutputParameters
206 
207 } // end of namespace otb
208 
209 #ifndef OTB_MANUAL_INSTANTIATION
211 #endif
212 
213 #endif
otb::ImageToGenericRSOutputParameters::UpdateTransform
void UpdateTransform()
Definition: otbImageToGenericRSOutputParameters.hxx:74
otb::ImageToGenericRSOutputParameters::GetInputImageMetadata
const ImageMetadata * GetInputImageMetadata()
Definition: otbImageToGenericRSOutputParameters.h:169
otb::ImageToGenericRSOutputParameters::ImageType
TImage ImageType
Definition: otbImageToGenericRSOutputParameters.h:70
otb::GenericRSTransform::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbGenericRSTransform.h:66
otb::ImageToGenericRSOutputParameters::m_OutputSize
SizeType m_OutputSize
Definition: otbImageToGenericRSOutputParameters.h:196
otb::ImageToGenericRSOutputParameters::SizeType
ImageType::SizeType SizeType
Definition: otbImageToGenericRSOutputParameters.h:74
otb::ImageToGenericRSOutputParameters::OutputImageExtentType
Definition: otbImageToGenericRSOutputParameters.h:86
otb::ImageToGenericRSOutputParameters::Superclass
itk::Object Superclass
Definition: otbImageToGenericRSOutputParameters.h:62
otb::ImageToGenericRSOutputParameters::SetInputImageMetadata
void SetInputImageMetadata(ImageMetadata *imd)
Definition: otbImageToGenericRSOutputParameters.h:162
otb::ImageToGenericRSOutputParameters::SetOutputSpacing
virtual void SetOutputSpacing(SpacingType _arg)
otb::ImageToGenericRSOutputParameters::m_EstimateIsotropicSpacing
bool m_EstimateIsotropicSpacing
Definition: otbImageToGenericRSOutputParameters.h:203
otb::ImageToGenericRSOutputParameters::m_ForceSpacing
bool m_ForceSpacing
Definition: otbImageToGenericRSOutputParameters.h:201
otb::ImageToGenericRSOutputParameters::SetOutputSize
virtual void SetOutputSize(SizeType _arg)
otb::ImageToGenericRSOutputParameters::m_OutputOrigin
PointType m_OutputOrigin
Definition: otbImageToGenericRSOutputParameters.h:194
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::ImageToGenericRSOutputParameters::GenericRSTransformPointerType
GenericRSTransformType::Pointer GenericRSTransformPointerType
Definition: otbImageToGenericRSOutputParameters.h:81
otb::ImageToGenericRSOutputParameters
This class is a helper class to estimate the output parameters of an image after projection in a targ...
Definition: otbImageToGenericRSOutputParameters.h:57
otb::ImageToGenericRSOutputParameters::EstimateOutputImageExtent
void EstimateOutputImageExtent()
Definition: otbImageToGenericRSOutputParameters.hxx:87
otb::ImageToGenericRSOutputParameters::ImageToGenericRSOutputParameters
ImageToGenericRSOutputParameters()
Definition: otbImageToGenericRSOutputParameters.hxx:33
otb::ImageToGenericRSOutputParameters::~ImageToGenericRSOutputParameters
~ImageToGenericRSOutputParameters() override
Definition: otbImageToGenericRSOutputParameters.h:179
otb::ImageToGenericRSOutputParameters::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbImageToGenericRSOutputParameters.h:63
otb::ImageToGenericRSOutputParameters::m_Transform
GenericRSTransformPointerType m_Transform
Definition: otbImageToGenericRSOutputParameters.h:199
otb::ImageToGenericRSOutputParameters::m_ForceSize
bool m_ForceSize
Definition: otbImageToGenericRSOutputParameters.h:202
otb::ImageToGenericRSOutputParameters::SpacingType
ImageType::SpacingType SpacingType
Definition: otbImageToGenericRSOutputParameters.h:76
otb::ImageToGenericRSOutputParameters::m_Input
ImageType::ConstPointer m_Input
Definition: otbImageToGenericRSOutputParameters.h:193
otb::ImageToGenericRSOutputParameters::ForceSizeTo
void ForceSizeTo(const SizeType &size)
Definition: otbImageToGenericRSOutputParameters.h:135
otbImageToGenericRSOutputParameters.hxx
otb::ImageToGenericRSOutputParameters::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbImageToGenericRSOutputParameters.h:64
otb::ImageToGenericRSOutputParameters::m_OutputExtent
OutputImageExtentType m_OutputExtent
Definition: otbImageToGenericRSOutputParameters.h:197
otb::ImageToGenericRSOutputParameters::Self
ImageToGenericRSOutputParameters Self
Definition: otbImageToGenericRSOutputParameters.h:61
otb::ImageToGenericRSOutputParameters::OutputImageExtentType::minY
double minY
Definition: otbImageToGenericRSOutputParameters.h:90
otb::GenericRSTransform
This is the class to handle generic remote sensing transform.
Definition: otbGenericRSTransform.h:57
otb::ImageToGenericRSOutputParameters::SetOutputProjectionRef
void SetOutputProjectionRef(const std::string &ref)
Definition: otbImageToGenericRSOutputParameters.h:148
otb::ImageToGenericRSOutputParameters::EstimateOutputSize
void EstimateOutputSize()
Definition: otbImageToGenericRSOutputParameters.hxx:236
otb::ImageToGenericRSOutputParameters::EstimateOutputSpacing
void EstimateOutputSpacing()
Definition: otbImageToGenericRSOutputParameters.hxx:177
otbGenericRSTransform.h
otb::ImageToGenericRSOutputParameters::OutputImageExtentType::maxX
double maxX
Definition: otbImageToGenericRSOutputParameters.h:89
otb::ImageToGenericRSOutputParameters::operator=
void operator=(const Self &)=delete
otb::ImageToGenericRSOutputParameters::GenericRSTransformType
GenericRSTransform GenericRSTransformType
Definition: otbImageToGenericRSOutputParameters.h:80
otb::ImageToGenericRSOutputParameters::GetInputProjectionRef
std::string GetInputProjectionRef() const
Definition: otbImageToGenericRSOutputParameters.h:155
otb::ImageToGenericRSOutputParameters::Compute
void Compute()
Definition: otbImageToGenericRSOutputParameters.hxx:45
otb::ImageToGenericRSOutputParameters::EstimateOutputOrigin
void EstimateOutputOrigin()
Definition: otbImageToGenericRSOutputParameters.hxx:161
otb::ImageToGenericRSOutputParameters::OutputImageExtentType::minX
double minX
Definition: otbImageToGenericRSOutputParameters.h:88
otb::ImageMetadata
Generic class containing image metadata used in OTB.
Definition: otbImageMetadata.h:270
otb::ImageToGenericRSOutputParameters::ForceSpacingTo
void ForceSpacingTo(const SpacingType &spacing)
Definition: otbImageToGenericRSOutputParameters.h:124
otb::ImageToGenericRSOutputParameters::IndexType
ImageType::IndexType IndexType
Definition: otbImageToGenericRSOutputParameters.h:75
otbImageMetadata.h
otb::ImageToGenericRSOutputParameters::PointType
ImageType::PointType PointType
Definition: otbImageToGenericRSOutputParameters.h:77
otb::ImageToGenericRSOutputParameters::m_OutputSpacing
SpacingType m_OutputSpacing
Definition: otbImageToGenericRSOutputParameters.h:195
otb::ImageToGenericRSOutputParameters::OutputImageExtentType::maxY
double maxY
Definition: otbImageToGenericRSOutputParameters.h:91