No Data management

Manage No-Data

Detailed description

This application has two modes. The first allows building a mask of no-data pixels from the no-data flags read from the image file. The second allows updating the change the no-data value of an image (pixels value and metadata). This last mode also allows replacing NaN in images with a proper no-data value. To do so, one should activate the NaN is no-data option.

Parameters

This section describes in details the parameters available for this application. Table [1] presents a summary of these parameters and the parameters keys to be used in command-line and programming languages. Application key is ManageNoData .

[1]Table: Parameters table for No Data management.
Parameter Key Parameter Type Parameter Description
in Input image Input image
out Output image Output image
usenan Boolean Boolean
mode Choices Choices
mode buildmask Choice Build a no-data Mask
mode changevalue Choice Change the no-data value
mode apply Choice Apply a mask as no-data
mode.buildmask.inv Float Float
mode.buildmask.outv Float Float
mode.changevalue.newv Float Float
mode.apply.mask Input image Input image
mode.apply.ndval Float Float
ram Int Int
inxml XML input parameters file XML input parameters file
outxml XML output parameters file XML output parameters file

Input image Input image.

Output Image Output image.

Consider NaN as no-data If active, the application will consider NaN as no-data values as well.

No-data handling mode Allows choosing between different no-data handling options. Available choices are:

  • Build a no-data Mask
  • Inside Value : Value given in the output mask to pixels that are not no data pixels.
  • Outside Value : Value given in the output mask to pixels that are no data pixels.
  • Change the no-data value
  • The new no-data value : The new no-data value.
  • Apply a mask as no-data : Apply an external mask to an image using the no-data value of the input image
  • Mask image : Mask to be applied on input image (valid pixels have non null values).
  • Nodata value used : No Data value used according to the mask image.

Available RAM (Mb) Available memory for processing (in MB).

Load otb application from xml file Load otb application from xml file.

Save otb application to xml file Save otb application to xml file.

Example

To run this example in command-line, use the following:

otbcli_ManageNoData -in QB_Toulouse_Ortho_XS.tif -out QB_Toulouse_Ortho_XS_nodatamask.tif uint8 -mode.buildmask.inv 255 -mode.buildmask.outv 0

To run this example from Python, use the following code snippet:

#!/usr/bin/python

# Import the otb applications package
import otbApplication

# The following line creates an instance of the ManageNoData application
ManageNoData = otbApplication.Registry.CreateApplication("ManageNoData")

# The following lines set all the application parameters:
ManageNoData.SetParameterString("in", "QB_Toulouse_Ortho_XS.tif")

ManageNoData.SetParameterString("out", "QB_Toulouse_Ortho_XS_nodatamask.tif")
ManageNoData.SetParameterOutputImagePixelType("out", 1)

ManageNoData.SetParameterFloat("mode.buildmask.inv", 255)

ManageNoData.SetParameterFloat("mode.buildmask.outv", 0)

# The following line execute the application
ManageNoData.ExecuteAndWriteOutput()

Limitations

None

Authors

This application has been written by OTB-Team.

See Also

These additional ressources can be useful for further information:

BanMath