OTB  10.0.0
Orfeo Toolbox
otbSensorTransformBase.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 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
Generic class containing image metadata used in OTB.
Base class for the sensor model projection classes.
std::vector< std::pair< InputPointType, OutputPointType > > TiePointsType
SensorTransformBase(const Self &)=delete
SensorTransformBase(TransformDirection dir)
itk::SmartPointer< const Self > ConstPointer
virtual bool SetMetadata(const ImageMetadata &imd)=0
virtual void OptimizeParameters(ImageMetadata &imd, const TiePointsType &tiepoints, double &rmsError)=0
itk::Point< TScalarType, NInputDimensions > InputPointType
TransformDirection getDirection() const
virtual bool IsValidSensorModel() const =0
itk::Point< TScalarType, NOutputDimensions > OutputPointType
void operator=(const Self &)=delete
itk::SmartPointer< Self > Pointer
Class to overload method passed to virtual pure in ITK V4.
Definition: otbTransform.h:42
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
TransformDirection
Definition: otbTransform.h:30