Implement a factory for sensor transforms
This issue is part of the SAR sensor models refactoring story (#2142 (closed))
Rationale
RPCForwardTransform
and RPCInverseTransform
are the only implementations of SensorTransformBase
currently implemented, but other transforms will be implemented in the future, including SARForwardTransform
and SARInverseTransform
. A factory should be implemented to automatically instantiate a valid SensorTransform from image metadata. The factory will be used in GenericRSTransform
and its applications (e.g. Orthorectification).
Analysis
There are other examples of factory in OTB, including the MachineLearningModelFactory
and the ImageMetadataInterfaceFactory
, and SensorTransformFactory
can be implemented in the same fashion.
In this issue we propose to implement this factory and use it when creating RPC transform in GenericRSTransform
, following these steps:
- Implements
RPCForwardTransformFactory
andRPCInverseTransformFactory
, deriving fromitk::ObjectFactory
to instantiateRPCForwardTransform
andRPCInverseTransform
respectively. - Implements
SensorTransformFactory
usingRPCForwardTransformFactory
andRPCInverseTransformFactory
to instantiate transform objects in client code - Use SensorTransformFactory in GenericTransform, instead of using RPCTransform.
classDiagram
Object <|.. SensorTransformBase : skipping classes in the dependency tree for clarity
SensorTransformBase <|.. RPCTransformBase
RPCTransformBase <|.. RPCForwardTransform
RPCTransformBase <|.. RPCInverseTransform
ObjectFactoryBase <|.. RPCForwardTransformFactory
ObjectFactoryBase <|.. RPCInverseTransformFactory
RPCForwardTransformFactory ..> RPCForwardTransform : CreateInstance
RPCInverseTransformFactory ..> RPCInverseTransform : CreateInstance
SensorTransformFactory ..> RPCForwardTransformFactory : RegisterFactory
SensorTransformFactory ..> RPCInverseTransformFactory : RegisterFactory
GenericRSTransform ..> SensorTransformFactory
SensorTransformBase : +IsValidSensorModel() = 0
SensorTransformBase : +TransformPoint() = 0
RPCTransformBase : -GDALRPCTransformer transformer
RPCTransformBase : +IsValidSensorModel()
RPCForwardTransform : +TransformPoint()
RPCInverseTransform : +TransformPoint()
SensorTransformFactory : +DirectionType direction {Forward,Inverse}
SensorTransformFactory : +CreateMachineLearningModel
SensorTransformFactory : +CleanFactories
SensorTransformFactory : -RegisterBuiltInFactories()
SensorTransformFactory : -RegisterFactory()
ObjectFactoryBase : +CreateObject()
Acceptance criterions
-
There is no additional test to implement in this issue, as the GenericRSTransform tests can be sue to validate the changes. If the GenericRSTransform is still able to use the RPC models after the changes, the work is validated. -
The documentation is up to date.
Risk management
Risk | Likelihood | Impact | Action |
---|