OTB  6.7.0
Orfeo Toolbox
otbGenericRSTransform.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 otbGenericRSTransform_h
22 #define otbGenericRSTransform_h
23 
24 #include "otbCompositeTransform.h"
25 #include <string>
26 
27 namespace otb
28 {
29 namespace Projection
30 {
32 }
48 template <class TScalarType = double,
49  unsigned int NInputDimensions = 2,
50  unsigned int NOutputDimensions = 2>
51 class ITK_EXPORT GenericRSTransform : public otb::Transform<TScalarType, // Data type for scalars
52  NInputDimensions, // Number of dimensions in the input space
53  NOutputDimensions> // Number of dimensions in the output space
54 {
55 public:
58  typedef otb::Transform<TScalarType,
59  NInputDimensions,
60  NOutputDimensions> Superclass;
65 
66  typedef typename Superclass::ScalarType ScalarType;
67  typedef typename Superclass::JacobianType JacobianType;
70 
73 
78 
79  typedef typename Superclass::InverseTransformBasePointer InverseTransformBasePointer;
80 
82  itkNewMacro(Self);
83 
85  itkTypeMacro(GenericRSTransform, Transform);
86 
88 
89  itkStaticConstMacro(InputSpaceDimension, unsigned int, NInputDimensions);
90  itkStaticConstMacro(OutputSpaceDimension, unsigned int, NOutputDimensions);
91  itkStaticConstMacro(SpaceDimension, unsigned int, NInputDimensions);
92  itkStaticConstMacro(ParametersDimension, unsigned int, NInputDimensions * (NInputDimensions + 1));
93 
95  itkSetStringMacro(InputProjectionRef);
96  itkGetStringMacro(InputProjectionRef);
98 
99  itkSetStringMacro(OutputProjectionRef);
100  itkGetStringMacro(OutputProjectionRef);
101 
104  {
105  return m_InputDictionary;
106  }
107 
109  {
110  m_InputDictionary = dictionary;
111  this->Modified();
112  }
113 
115  {
116  return m_OutputDictionary;
117  }
118 
120  {
121  m_OutputDictionary = dictionary;
122  this->Modified();
123  }
124 
127  itkGetMacro(InputKeywordList, ImageKeywordlist);
129  {
130  this->m_InputKeywordList = kwl;
131  this->Modified();
132  }
133 
134  itkGetMacro(OutputKeywordList, ImageKeywordlist);
136  {
137  this->m_OutputKeywordList = kwl;
138  this->Modified();
139  }
140 
143  itkSetMacro(InputOrigin, OriginType);
144  itkGetConstReferenceMacro(InputOrigin, OriginType);
146 
149  itkSetMacro(InputSpacing, SpacingType);
150  itkGetConstReferenceMacro(InputSpacing, SpacingType);
152 
155  itkSetMacro(OutputOrigin, OriginType);
156  itkGetConstReferenceMacro(OutputOrigin, OriginType);
158 
161  itkSetMacro(OutputSpacing, SpacingType);
162  itkGetConstReferenceMacro(OutputSpacing, SpacingType);
164 
166  virtual bool IsUpToDate()
167  {
168  return m_TransformUpToDate;
169  }
170 
173 
175  virtual const TransformType * GetTransform() const;
176 
177  OutputPointType TransformPoint(const InputPointType& point) const override;
178 
179  virtual void InstantiateTransform();
180 
181  // Get inverse methods
182  bool GetInverse(Self * inverseTransform) const;
183  InverseTransformBasePointer GetInverseTransform() const override;
184 
185  // Dummy set parameter method
186  void SetParameters(const typename Superclass::ParametersType &) override {}
187 
188  // Dummy ComputeJacobianWithRespectToParameters method
190 
191 protected:
193  ~GenericRSTransform() override {}
194 
195  void Modified() const override
196  {
197  this->Superclass::Modified();
198  m_TransformUpToDate = false;
199  }
200 
201  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
202 
203 private:
204  GenericRSTransform(const Self &) = delete;
205  void operator =(const Self&) = delete;
206 
209 
212 
213  std::string m_InputProjectionRef;
215 
220 
222 
225  mutable bool m_TransformUpToDate;
227 };
228 
229 } // namespace otb
230 
231 #ifndef OTB_MANUAL_INSTANTIATION
232 #include "otbGenericRSTransform.hxx"
233 #endif
234 
235 #endif
itk::Transform< double, NInputDimensions, NOutputDimensions > GenericTransformType
Storage and conversion for OSSIM metadata.
itk::SmartPointer< Self > Pointer
TransformDirection::TransformationDirection DirectionOfMappingEnumType
void SetInputDictionary(const itk::MetaDataDictionary &dictionary)
void SetInputKeywordList(const ImageKeywordlist &kwl)
itk::MetaDataDictionary m_InputDictionary
ImageKeywordlist m_OutputKeywordList
TransformType::Pointer TransformPointerType
void SetOutputKeywordList(const ImageKeywordlist &kwl)
itk::MetaDataDictionary m_OutputDictionary
void SetOutputDictionary(const itk::MetaDataDictionary &dictionary)
const itk::MetaDataDictionary & GetOutputDictionary() const
const itk::MetaDataDictionary & GetInputDictionary() const
TransformPointerType m_Transform
GenericTransformPointerType m_InputTransform
Superclass::InverseTransformBasePointer InverseTransformBasePointer
void ComputeJacobianWithRespectToParameters(const InputPointType &, JacobianType &) const override
void SetParameters(const typename Superclass::ParametersType &) override
itk::Point< ScalarType, NOutputDimensions > OutputPointType
itk::Array< double > ParametersType
Definition: mvdTypes.h:122
itk::SmartPointer< const Self > ConstPointer
itk::Vector< double, 2 > SpacingType
otb::CompositeTransform< GenericTransformType, GenericTransformType > TransformType
GenericTransformPointerType m_OutputTransform
GenericTransformType::Pointer GenericTransformPointerType
otb::Transform< TScalarType, NInputDimensions, NOutputDimensions > Superclass
This is the class to handle generic remote sensing transform.
void Modified() const override
Superclass::ScalarType ScalarType
itk::Point< double, 2 > OriginType
Superclass::JacobianType JacobianType
itk::Point< ScalarType, NInputDimensions > InputPointType
VectorImageType::SpacingType SpacingType
Definition: mvdTypes.h:181
ImageKeywordlist m_InputKeywordList
Projection::TransformAccuracy m_TransformAccuracy
Class which compose two itk::Transform to obtain one itk::Transform T1 T2 T3 (x, y) -> (x'...
Class to overload method passed to virtual pure in ITK V4.
Definition: otbTransform.h:40