Request for Changes-14: Improve no-data support in Orfeo ToolBox

From OTBWiki
Jump to: navigation, search

[Request for Changes - 14] Improve no-data support in Orfeo ToolBox



This work follows developments made in RFC-1. It extends the support of no-data flags in OTB and provides other tools to manage them.


In OTB, some filters produce outputs with no-data values. They need to export the no-data values in the output metadata to produce a consistent output. In other cases, the pipeline should alter the metadata information in the image (without changing the pixels), so a dedicated filter has been developed.

Implementation details

Classes and files


M       Modules/Core/Transform/include/otbStreamingWarpImageFilter.h
M       Modules/Core/Transform/include/otbStreamingWarpImageFilter.txx
M       Modules/Fusion/MajorityVoting/include/otbNeighborhoodMajorityVotingImageFilter.h
M       Modules/Fusion/MajorityVoting/include/otbNeighborhoodMajorityVotingImageFilter.txx
M       Modules/Fusion/MajorityVoting/otb-module.cmake
M       Modules/Learning/DempsterShafer/include/otbDSFusionOfClassifiersImageFilter.h
M       Modules/Learning/DempsterShafer/include/otbDSFusionOfClassifiersImageFilter.txx
M       Modules/Registration/DisparityMap/include/otbDisparityTranslateFilter.txx
M       Modules/Registration/Stereo/include/otbMulti3DMapToDEMFilter.txx
M       Modules/Segmentation/Conversion/include/otbOGRDataSourceToLabelImageFilter.txx

These filters now store the no-data value used in their output. No change to their behaviour on pixel values.


A       Modules/Filtering/ImageManipulation/include/otbChangeInformationImageFilter.h
A       Modules/Filtering/ImageManipulation/include/otbChangeInformationImageFilter.txx

In order to alter the metadata in a pipeline, OTB needed a filter similar to itk::ChangeInformationImageFilter. A new filter has been derived from the ITK one. It extends the functionality to metadata modifications (all the metadata in the MetaDataDictionary), but doesn't modify pixel values. The metadata are stored in a dictionary attached to each image object. It contains a set of key-value pairs. This filter can set the value of a given metadata key in the output dictionary (even if this key already has a value in the input image dictionary). Passing a null value for a given key will erase the pair in the output dictionary.



M       Modules/Applications/AppImageUtils/app/otbManageNoData.cxx

A new mode has been added to the application in order to apply a no-data value on the input image, given an input mask. The no-data value is chosen from the input image (if present in its metadata) or set to 0.



M       Modules/Filtering/ImageManipulation/test/CMakeLists.txt
A       Modules/Filtering/ImageManipulation/test/otbChangeInformationImageFilter.cxx
M       Modules/Filtering/ImageManipulation/test/otbImageManipulationTestDriver.cxx

New tests added for the fitler otb::ChangeInformationImageFilter. No baseline needed.



Additional notes