4.1.7 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 4.14, page 439 presents a summary of these parameters and the parameters keys to be used in command-line and programming languages. Application key is ManageNoData.





Parameter key

Parameter type

Parameter description




in

Input image

Input image

out

Output image

Output Image

usenan

Boolean

Consider NaN as no-data

mode

Choices

No-data handling mode

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

Inside Value

mode.buildmask.outv

Float

Outside Value

mode.changevalue.newv

Float

The new no-data value

mode.apply.mask

Input image

Mask image

mode.apply.ndval

Float

Nodata value used

ram

Int

Available RAM (Mb)

inxml

XML input parameters file

Load otb application from xml file

outxml

XML output parameters file

Save otb application to xml file











Table 4.14: Parameters table for No Data management.

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:

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: