Request for Comments-28: Remove ITK from OTB
Contents
Status
- Author: Rashad Kanavath, Guillaume Pasero
- Submitted on 01/04/2016
- Open for comments
What changes will be made and why would they make a better Orfeo ToolBox?
Introduction
ITK is an integral part of OTB since its creation. Insight Segmentation and Registration Toolkit (ITK) is an open-source, cross-platform system that provides developers with an extensive suite of software tools for image analysis. Developed through extreme programming methodologies, ITK employs leading-edge algorithms for registering and segmenting multidimensional data. ITK's multi-threaded processing framework becomes the heart of OTB processing chain. It is well suited for processing large scale images which is of highest priority and one of design goals of OTB library.
So why to remove ITK now?
- ITK is not designed for remote sensing. Even though remote sensing can be put under image processing domain history of OTB itself contradicts this statement.
- OTB uses a small set of modules from ITK which could be replaced by one of its other dependency!!
- We don't benefit much from the currently template programming used in ITK ( productive code vs production cost)
- ITK leans towards readability, maintainability, and program-ability over performance.
- ITK pipeline is not "perfect" : diamond problem is not handled so well ( i.e. A plugged into B and C, B plugged into D, C plugged into D)
Do we need to reinvent the wheels?
Not at all...
OTB already uses OSSIM library and OSSIM provides all what we need to replace ITK!.
Infact, OTB could not remove OSSIM as dependency unless we reinvent the wheels. It is used in sensor modelling, geometric correction and metadata handling. Currently metadata read from ossim and or GDAL is copied to make an ITK metadata dictionary only beause we use ITK. This is due to the fact that ITK cannot handle metadata seamelessly like OSSIM. GDAL also handles metadata but OSSIM way of handling via GEOM file is much appealing to OTB.
Unlike ITK, OSSIM is designed from ground up for the idea of remote sensing library. OSSIM handles transparently image geometry (can be projected or sensor), ITK doesn't even know about it.
So to sump, replacing ITK by OSSIM we don't need to worry about much stuff and make the code less complex.
Below is a list of somes classes in OSSIM that could easily replace the one we use in ITK. But I guess it makes the point clear enough to get pass this RFC.
ITK | OSSIM |
---|---|
itkSmartPointer | ossimRefPtr |
itkObject | ossimObject |
itkProcessObect | ossimImageSource |
itkImageToImageFilter | ossimImageSourceFilter |
itkImageIO | ossimImageHandler |
itkImageFileReader/Writer | ossimImageFileReader/Writer |
(itk object observer and friends) | ossimConnectableObjectListener |
itkLogger | ossimTrace |
But we can't have a template based image reader in OSSIM?
Well, OSSIM does not restrict usage of templates. The plus point that ITK has template based ImageFilter is not that important in OTB. For example, the case of otbImageFileReader and ImageFileWriter.
Also it is worth to note that in OTB the filters are templated, but in reality, OTB-Applications simply use FloatVectorImages in 90% of cases.
API Changes
API change is a big thing and we understand the risk. This will be detailed in the corresponding Request for changes. We assume to have a one time cost of moving away ITK will be equal or less than that of moving from ITKv3 to ITKv4. ITKv3 and ITKv4 has different API removed, renamed, deprecated classes.
When will those changes be available (target release or date)?
Target release 6.0
Who will be developing the proposed changes?
Rashad, Guillaume, (others interested?, please add your name here..)