Skip to content

Support of ITK 5.0 in OTB (wip)

Cédric Traizet requested to merge itk5_preperation into develop


ITK 5.0 has been released !

This merge request is based on the work done in !194 (closed), the original branch ( cs-si:itk5_preperation) has been rebased on top of develop, and additional changes have been made to make the branch compatible with the release.


See the ITK 5 migration guidelines

Prior to ITK 5.0, only a subset of C+11 functionality was used, when available, through backports and macros. ITK now requires a C+11 standard compiler. And this get rid of lot of macros. Move to C++11 does not affect OTB since it has already moved to a higher standard (C++14).

Another important API change in ITK is its threading model. This affects OTB , Remote Modules and projects depending on OTB (both official and unofficial) in large scale. This merge request approaches threading model issues between ITK 5.0 and OTB. We had observed a 99% of passing test with our changeset while not breaking compatibility with ITK 4.x.

This MR does not fully cover compatibility yet. There can be classes of filters that are not covered by testing and hence remain un-patched.

Until debian-testing, OpenSUSE, ubuntu and many others pick up the yet-to-release ITK 5.0, it is important to keep support of ITK 4.x. Even though binary packages and superbuild can use alpha version but still a compatibility layer is necessary.

There are several levels of compatibility:


For now the code compiles with the first level of compatibility, but there are still issues with classes using spatial objects (most tests are failing, and the SpatialObjectToImageDrawing test has been commented for now because it doesn't compile). According to the guidelines, I think we should aim for the second level of compatibility, but this implies some additional API changes.

Implementation Details



The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement.

Check before merging:

  • All discussions are resolved
  • At least 2 👍 votes from core developers, no 👎 vote.
  • The feature branch is (reasonably) up-to-date with the base branch
  • Dashboard is green
  • Copyright owner has signed the ORFEO ToolBox Contributor License Agreement
  • Optionally, run git diff develop... -U0 --no-color | -p1 -i on latest changes and commit
Edited by Cédric Traizet

Merge request reports