Request for changes-107: Refactor Convert application

From OTBWiki
Jump to: navigation, search

[Request for Changes - 107] Refactor Convert application



This is a refactoring of the Convert application.


Suggestion made during OTB of the brainstorming of Users meeting 2017 [1].

The purpose of this refactoring is an easy access to the choices of the output bands via parameters.

The output channels choice can be selected with the extended filename, but it's less easy to handle.

Implementation details

Classes and files

M       Modules/Applications/AppImageUtils/app/otbConvert.cxx
M       Modules/Applications/AppImageUtils/test/CMakeLists.txt


Add default pixelType at uint8.

Add a "channels" parameter, which allows to select the channels of the output image.

The default mode (standard mode) allows to maintain the application behavior before the refactoring.

There are 3 modes:

  • default ->all : all bands
  • mono ->grayscale : display single channel as standard color image
    • channel
  • rgb : allows to select 3 bands of the input image, by default {1,2,3} ->use the ImageMetadataInterface to set the Red/Green/Blue index by default
    • red
    • blue
    • green

The first index value is 1.


Two new baselines:

A       Input/apTvUtConvertMonoChannelOutput.tif
A       Input/apTvUtConvertSelectChannelsRgbOutput.tif

Add two new tests:

  • apTvUtConvertSelectChannels
  • apTvUtConvertMonoChannel