Request for Changes-1: Read, Write and manage no-data flags in Orfeo ToolBox

From OTBWiki
Revision as of 15:45, 17 September 2015 by Julien (Talk | contribs) (Created page with "== [Request for Changes - 1] Read, write and manage no-data flags in Orfeo ToolBox == === Status === * Author: Julien Michel * Additional Contributors: Guillaume Pasero * S...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

[Request for Changes - 1] Read, write and manage no-data flags in Orfeo ToolBox

Status

Summary

This Request for Changes implements reading no data flags to the Image MetaDataDictionary and write them back if the driver supports it. Some low-level helper functions are provided to manipulate those flags, as well as filters to build a no-data mask and update the no-data value. An application allows to perform both operations.

Rationale

This will improve OTB support of no-data flags, which was very poor until now. See Request for Comments xxx.


Implementation details

Note that gdal no-data flags consist in, for each channel:

  • A boolean flag to tell if a no-data value exists for this channel
  • A value to be used as no-data

Implementation proposed in this Request for Changes reflects this (support setup for each channel separately). Internally, flags are managed through a std::vector<bool> and values through a std::vector<double>.

Note that filters and applications also have an option to consider NaN values as no-data as well.

Classes and files

  • Module Adapaters/OSSIMAdapters:
    • otb::MetaDataKey: Add key for no-data available and no-data values MetaData
  • Module IO/IOGDAL:
    • GdalImageIO: Read/Write no-data values and flags from/to MetaDataDictionary.
  • Module Core/ImageBase:
    • Adding NoDataHelper.cxx and .h files containing functions to help no-data flag manipulation (import/export flags from/to MetaDataDictionary, test a pixel for no-data, update no-data in a pixel)
  • Module Core/Metadata:
    • Add a method ot ImageMetadataInterfaceBase to get the no-data flags
  • Filtering/ImageManipulation:
    • Add a ImageToNoDataMaskFilter, which outputs a mask of pixel containg no-data
    • Add a ChangeNoDataValueFilter, which allows to change the no-data value in an image (update MetaDataDictionary and Image content)


Applications

  • In Applications/AppImageUtils, the ReadImageInfo application has been modified to output no-data flags and values
  • In Applications/AppImageUtils, the ManageNoData application has been created. It allows to :
    • Create a mask of pixels containing no-data values using the ImageToNoDataMaskFilter
    • Update the no-data value (only a single value is supported for all channels) using the ChangeNoDataValueFilter

Tests

Branch is tested on the dashboard

The following tests have been added:

  • ImageManipulation/test/otbImageToNoDataMaskFilter.cxx:
  • Filtering/ImageManipulation/test/otbChangeNoDataValueFilter.cxx

Documentation

List documentation modification that were made (doxygen, example, software guide, application documentation, cookbook).

Additional notes

List remaining open issues if any, and additional notes.