OTB  9.0.0
Orfeo Toolbox
otbSensorTransformBase.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 otbSensorTransformBase_h
22 #define otbSensorTransformBase_h
23 
24 #include "otbMacro.h"
25 #include "otbImageMetadata.h"
26 
27 #include "otbTransform.h"
28 #include "itkSmartPointer.h"
29 
30 namespace otb
31 {
47 template <class TScalarType, unsigned int NInputDimensions = 2, unsigned int NOutputDimensions = 3>
48 class ITK_EXPORT SensorTransformBase : public Transform<TScalarType, NInputDimensions, NOutputDimensions>
49 {
50 
51 public:
56  using Pointer = itk::SmartPointer<Self>;
57  using ConstPointer = itk::SmartPointer<const Self> ;
58 
59  using InputPointType = itk::Point<TScalarType, NInputDimensions>;
60  using OutputPointType = itk::Point<TScalarType, NOutputDimensions>;
61  using TiePointsType = std::vector<std::pair<InputPointType,OutputPointType>>;
62  using PixelType =TScalarType;
64 
66  itkTypeMacro(Self, Superclass);
67 
68  itkStaticConstMacro(InputSpaceDimension, unsigned int, NInputDimensions);
69  itkStaticConstMacro(OutputSpaceDimension, unsigned int, NOutputDimensions);
70 
71  /*
72  * Provide the ImageMetadata in order to set the model.
73  * Return false if model not valid.
74  */
75  virtual bool SetMetadata(const ImageMetadata& imd) = 0;
76 
78  virtual bool IsValidSensorModel() const = 0;
79 
80  virtual void OptimizeParameters(ImageMetadata& imd, const TiePointsType& tiepoints, double& rmsError) = 0;
81 
83  return m_direction;
84  };
85 
86 protected:
87  SensorTransformBase(TransformDirection dir) : Superclass(0),m_direction(dir) {}
88  ~SensorTransformBase() = default;
89 
91 
92 private:
93  SensorTransformBase(const Self&) = delete;
94  void operator=(const Self&) = delete;
95 };
96 
97 } // namespace otb
98 
99 #endif
otb::TransformDirection
TransformDirection
Definition: otbTransform.h:30
otb::SensorTransformBase::m_direction
TransformDirection m_direction
Definition: otbSensorTransformBase.h:90
otb::SensorTransformBase< TScalarType, 3, 2 >::TiePointsType
std::vector< std::pair< InputPointType, OutputPointType > > TiePointsType
Definition: otbSensorTransformBase.h:61
otb::Transform::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbTransform.h:47
otb::SensorTransformBase< TScalarType, 3, 2 >::PixelType
TScalarType PixelType
Definition: otbSensorTransformBase.h:62
otb::SensorTransformBase::getDirection
TransformDirection getDirection() const
Definition: otbSensorTransformBase.h:82
otbTransform.h
otb::Transform::OutputPointType
itk::Point< TScalarType, NOutputDimensions > OutputPointType
Definition: otbTransform.h:95
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otbMacro.h
otb::Transform::InputPointType
itk::Point< TScalarType, NInputDimensions > InputPointType
Definition: otbTransform.h:94
otb::Transform::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbTransform.h:48
otb::SensorTransformBase::SensorTransformBase
SensorTransformBase(TransformDirection dir)
Definition: otbSensorTransformBase.h:87
otb::Transform::Superclass
itk::Transform< TScalarType, NInputDimensions, NOutputDimensions > Superclass
Definition: otbTransform.h:46
otb::Transform
Class to overload method passed to virtual pure in ITK V4.
Definition: otbTransform.h:39
otb::SensorTransformBase
Base class for the sensor model projection classes.
Definition: otbSensorTransformBase.h:48
otb::ImageMetadata
Generic class containing image metadata used in OTB.
Definition: otbImageMetadata.h:270
otbImageMetadata.h