ManageNoData - 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 [#]_ presents a summary of these parameters and the parameters keys to be used in command-line and programming languages. Application key is *ManageNoData* . .. [#] Table: Parameters table for No Data management. +---------------------+----------------------------------+--------------------------+ |Parameter Key |Parameter Name |Parameter Type | +=====================+==================================+==========================+ |in |Input image |Input image | +---------------------+----------------------------------+--------------------------+ |out |Output Image |Output image | +---------------------+----------------------------------+--------------------------+ |usenan |Consider NaN as no-data |Boolean | +---------------------+----------------------------------+--------------------------+ |mode |No-data handling mode |Choices | +---------------------+----------------------------------+--------------------------+ |mode buildmask |Build a no-data Mask | *Choice* | +---------------------+----------------------------------+--------------------------+ |mode changevalue |Change the no-data value | *Choice* | +---------------------+----------------------------------+--------------------------+ |mode apply |Apply a mask as no-data | *Choice* | +---------------------+----------------------------------+--------------------------+ |mode.buildmask.inv |Inside Value |Float | +---------------------+----------------------------------+--------------------------+ |mode.buildmask.outv |Outside Value |Float | +---------------------+----------------------------------+--------------------------+ |mode.changevalue.newv|The new no-data value |Float | +---------------------+----------------------------------+--------------------------+ |mode.apply.mask |Mask image |Input image | +---------------------+----------------------------------+--------------------------+ |mode.apply.ndval |Nodata value used |Float | +---------------------+----------------------------------+--------------------------+ |ram |Available RAM (Mb) |Int | +---------------------+----------------------------------+--------------------------+ |inxml |Load otb application from xml file|XML input parameters file | +---------------------+----------------------------------+--------------------------+ |outxml |Save otb application to xml 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 resources can be useful for further information: | BandMath