Difference between revisions of "Request for Changes-1: Read, Write and manage no-data flags in Orfeo ToolBox"

From OTBWiki
Jump to: navigation, search
(Classes and files)
(Tests)
Line 53: Line 53:
  
 
The following tests have been added:
 
The following tests have been added:
 +
* Core/Metadata/test/otbNoDataHelperTest.cxx:
 +
** Tests the funcions in otbNoDataHelper.h
 +
** Does not require any input or baseline data
 +
** [http://dash.orfeo-toolbox.org/testSummary.php?project=3&name=coreMetaDataNoDataHelperTest&date=2015-09-17 Test passes as of today]
 
* ImageManipulation/test/otbImageToNoDataMaskFilter.cxx:  
 
* ImageManipulation/test/otbImageToNoDataMaskFilter.cxx:  
 
** Tests the ImageToNoDataMaskFilter class
 
** Tests the ImageToNoDataMaskFilter class
Line 61: Line 65:
 
** Does not require any input or baseline data
 
** Does not require any input or baseline data
 
** [http://dash.orfeo-toolbox.org/testSummary.php?project=3&name=filteringImageManipulationChangeNoDataValueFilter&date=2015-09-17 Test passes as of today]
 
** [http://dash.orfeo-toolbox.org/testSummary.php?project=3&name=filteringImageManipulationChangeNoDataValueFilter&date=2015-09-17 Test passes as of today]
*
+
 
 
==== Documentation ====
 
==== Documentation ====
  

Revision as of 15:48, 17 September 2015

[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/Metadata:
    • 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)
    • 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:

  • Core/Metadata/test/otbNoDataHelperTest.cxx:
  • 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.