4.10.1 Example

This application opens an image and save it. Pay attention, it includes Latex snippets in order to generate software guide documentation

Detailed description

The purpose of this application is to present parameters types, and Application class framework. It is used to generate Software guide documentation for Application chapter example.

Parameters

This section describes in details the parameters available for this application. Table 4.154, page 802 presents a summary of these parameters and the parameters keys to be used in command-line and programming languages. Application key is Example.





Parameter key

Parameter type

Parameter description




in

Input image

Input Image

out

Output image

Output Image

boolean

Boolean

Boolean

int

Int

Integer

float

Float

Float

string

String

String

filename

Input File name

File name

directory

Directory

Directory name

choice

Choices

Choice

choice choice1

Choice

Choice 1

choice choice2

Choice

Choice 2

choice choice3

Choice

Choice 3

choice.choice1.floatchoice1

Float

Float of choice1

choice.choice3.floatchoice3

Float

Float of choice3

ingroup

Group

Input Group

ingroup.integer

Int

Integer of Group

ingroup.images

Group

Input Images Group

ingroup.images.inputimage

Input image

Input Image

outgroup

Group

Output Group

outgroup.outputimage

Output image

Output Image

il

Input image list

Input image list

cl

List

Output Image channels

ram

Int

Available RAM

cin

Input image

Input Complex Image

cout

Output image

Output Complex Image

inxml

XML input parameters file

Load otb application from xml file

outxml

XML output parameters file

Save otb application to xml file











Table 4.154: Parameters table for Example.

Input Image

Output Image

Boolean

Integer

Float

String

File name

Directory name

Choice Available choices are:

Input Group

Output Group

Input image list

Output Image channels

Available RAM Set the maximum of available memory for the pipeline execution in mega bytes (optional, 256 by default).

Input Complex Image

Output Complex Image

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_Example -boolean true -in QB_Suburb.png -out Application_Example.png

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 Example application 
Example = otbApplication.Registry.CreateApplication("Example") 
 
# The following lines set all the application parameters: 
Example.SetParameterString("boolean","1") 
 
Example.SetParameterString("in", "QB_Suburb.png") 
 
Example.SetParameterString("out", "Application_Example.png") 
 
# The following line execute the application 
Example.ExecuteAndWriteOutput()

Limitations

None

Authors

This application has been written by OTB-Team.