.. _ManageNoData: ManageNoData ============ Manage No-Data 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 ---------- .. contents:: :local: .. |br| raw:: html
.. |em| raw:: html   **Input image** :code:`-in image` *Mandatory* |br| Input image **Output Image** :code:`-out image [dtype]` *Mandatory* |br| Output image **Consider NaN as no-data** :code:`-usenan bool` *Default value: false* |br| If active, the application will consider NaN as no-data values as well **No-data handling mode** :code:`-mode [buildmask|changevalue|apply]` *Default value: buildmask* |br| Allows choosing between different no-data handling options * **Build a no-data Mask** |br| * **Change the no-data value** |br| * **Apply a mask as no-data** |br| Apply an external mask to an image using the no-data value of the input image Build a no-data Mask options ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ **Inside Value** :code:`-mode.buildmask.inv float` *Default value: 1* |br| Value given in the output mask to pixels that are not no data pixels **Outside Value** :code:`-mode.buildmask.outv float` *Default value: 0* |br| Value given in the output mask to pixels that are no data pixels Change the no-data value options ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ **The new no-data value** :code:`-mode.changevalue.newv float` *Default value: 0* |br| The new no-data value Apply a mask as no-data options ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ **Mask image** :code:`-mode.apply.mask image` *Mandatory* |br| Mask to be applied on input image (valid pixels have non null values) **Nodata value used** :code:`-mode.apply.ndval float` *Default value: 0* |br| No Data value used according to the mask image ------------ **Available RAM (MB)** :code:`-ram int` *Default value: 256* |br| Available memory for processing (in MB). Examples -------- From the command-line: .. code-block:: bash otbcli_ManageNoData -in QB_Toulouse_Ortho_XS.tif -out QB_Toulouse_Ortho_XS_nodatamask.tif uint8 -mode.buildmask.inv 255 -mode.buildmask.outv 0 From Python: .. code-block:: python import otbApplication app = otbApplication.Registry.CreateApplication("ManageNoData") app.SetParameterString("in", "QB_Toulouse_Ortho_XS.tif") app.SetParameterString("out", "QB_Toulouse_Ortho_XS_nodatamask.tif") app.SetParameterOutputImagePixelType("out", 1) app.SetParameterFloat("mode.buildmask.inv", 255) app.SetParameterFloat("mode.buildmask.outv", 0) app.ExecuteAndWriteOutput() See also -------- | :ref:`BandMath`