OTB  7.0.0
Orfeo Toolbox
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
otb::Wrapper::Application Class Referenceabstract

#include <otbWrapperApplication.h>

+ Inheritance diagram for otb::Wrapper::Application:
+ Collaboration diagram for otb::Wrapper::Application:

Public Types

typedef itk::SmartPointer< const SelfConstPointer
 
typedef itk::SmartPointer< SelfPointer
 
typedef Application Self
 
typedef itk::Object Superclass
 

Public Member Functions

void AddDocTag (const std::string &)
 
unsigned int AddExample (const std::string &comm="")
 
void AddImageToParameterInputImageList (std::string const &parameter, ImageBaseType *img)
 
void AddParameterStringList (std::string const &parameter, const std::string &str)
 
void ClearParameterInputImageList (std::string const &parameter)
 
void ClearValue (std::string const &paramKey)
 
bool ConnectImage (std::string in, Application *app, std::string out)
 
void DisableParameter (std::string const &paramKey)
 
void EnableParameter (std::string const &paramKey)
 
int Execute ()
 
int ExecuteAndWriteOutput ()
 
void FreeRessources ()
 
std::vector< std::string > GetChoiceKeys (std::string const &paramKey)
 
std::vector< std::string > GetChoiceNames (std::string const &paramKey)
 
std::string GetCLExample ()
 
float GetDefaultParameterFloat (std::string const &parameter)
 
int GetDefaultParameterInt (std::string const &parameter)
 
virtual const char * GetDescription () const
 
virtual const char * GetDocAuthors () const
 
DocExampleStructure::Pointer GetDocExample ()
 
virtual const char * GetDocLimitations () const
 
virtual const std::string & GetDocLink () const
 
virtual const char * GetDocLongDescription () const
 
virtual const char * GetDocSeeAlso () const
 
virtual std::vector< std::string > GetDocTags () const
 
std::string GetExampleComment (unsigned int id)
 
unsigned int GetExampleNumberOfParameters (unsigned int id)
 
std::string GetExampleParameterKey (unsigned int exId, unsigned int paramId)
 
std::string GetExampleParameterValue (unsigned int exId, unsigned int paramId)
 
std::string GetHtmlExample ()
 
ImagePixelType GetImageBasePixelType (const std::string &key, unsigned int idx=0)
 
otb::ImageKeywordlist GetImageKeywordlist (const std::string &key, unsigned int idx=0)
 
itk::MetaDataDictionary GetImageMetaData (const std::string &key, unsigned int idx=0)
 
unsigned int GetImageNbBands (const std::string &key, unsigned int idx=0)
 
ImageBaseType::PointType GetImageOrigin (const std::string &key, unsigned int idx=0)
 
std::string GetImageProjection (const std::string &key, unsigned int idx=0)
 
ImageBaseType::RegionType GetImageRequestedRegion (const std::string &key, unsigned int idx=0)
 
ImageBaseType::SizeType GetImageSize (const std::string &key, unsigned int idx=0)
 
ImageBaseType::SpacingType GetImageSpacing (const std::string &key, unsigned int idx=0)
 
double GetLastExecutionTiming () const
 
bool GetListViewSingleSelectionMode (const std::string &parameter)
 
otb::LoggerGetLogger () const
 
virtual const char * GetName () const
 
virtual const char * GetNameOfClass () const
 
unsigned int GetNumberOfElementsInParameterInputImageList (std::string const &parameter)
 
unsigned int GetNumberOfExamples ()
 
std::vector< std::pair< std::string, std::string > > GetOutputParametersSumUp ()
 
std::string GetParameterAsString (std::string const &paramKey)
 
ParameterGetParameterByKey (std::string const &parameter, bool follow=true)
 
const ParameterGetParameterByKey (std::string const &parameter, bool follow=true) const
 
ComplexDoubleImageTypeGetParameterComplexDoubleImage (std::string const &)
 
ComplexDoubleVectorImageTypeGetParameterComplexDoubleVectorImage (std::string const &)
 
ComplexFloatImageTypeGetParameterComplexFloatImage (std::string const &)
 
ComplexFloatVectorImageTypeGetParameterComplexFloatVectorImage (std::string const &)
 
ComplexInt16ImageTypeGetParameterComplexInt16Image (std::string const &)
 
ComplexInt16VectorImageTypeGetParameterComplexInt16VectorImage (std::string const &)
 
ComplexInt32ImageTypeGetParameterComplexInt32Image (std::string const &)
 
ComplexInt32VectorImageTypeGetParameterComplexInt32VectorImage (std::string const &)
 
std::string GetParameterDescription (std::string const &paramKey)
 
DoubleImageTypeGetParameterDoubleImage (std::string const &)
 
DoubleVectorImageTypeGetParameterDoubleVectorImage (std::string const &)
 
float GetParameterFloat (std::string const &parameter) const
 
FloatImageTypeGetParameterFloatImage (std::string const &)
 
FloatVectorImageTypeGetParameterFloatVectorImage (std::string const &)
 
FloatVectorImageTypeGetParameterImage (std::string const &parameter)
 
ImageBaseTypeGetParameterImageBase (const std::string &key, unsigned int idx=0)
 
FloatVectorImageListTypeGetParameterImageList (std::string const &parameter)
 
int GetParameterInt (std::string const &parameter) const
 
Int16ImageTypeGetParameterInt16Image (std::string const &)
 
Int16VectorImageTypeGetParameterInt16VectorImage (std::string const &)
 
Int32ImageTypeGetParameterInt32Image (std::string const &)
 
Int32VectorImageTypeGetParameterInt32VectorImage (std::string const &)
 
ParameterGroupGetParameterList ()
 
std::string GetParameterName (std::string const &paramKey)
 
ImageBaseTypeGetParameterOutputImage (std::string const &parameter)
 
ImagePixelType GetParameterOutputImagePixelType (std::string const &parameter)
 
Role GetParameterRole (std::string const &paramKey) const
 
std::vector< std::string > GetParametersKeys (bool recursive=true)
 
std::string GetParameterString (std::string const &parameter) const
 
std::vector< std::string > GetParameterStringList (const std::string &parameter)
 
ParameterType GetParameterType (std::string const &paramKey) const
 
UInt16ImageTypeGetParameterUInt16Image (std::string const &)
 
UInt16VectorImageTypeGetParameterUInt16VectorImage (std::string const &)
 
UInt32ImageTypeGetParameterUInt32Image (std::string const &)
 
UInt32VectorImageTypeGetParameterUInt32VectorImage (std::string const &)
 
UInt8ImageTypeGetParameterUInt8Image (std::string const &)
 
UInt8RGBAImageTypeGetParameterUInt8RGBAImage (std::string const &)
 
UInt8RGBImageTypeGetParameterUInt8RGBImage (std::string const &)
 
UInt8VectorImageTypeGetParameterUInt8VectorImage (std::string const &)
 
UserLevel GetParameterUserLevel (std::string const &paramKey) const
 
VectorDataTypeGetParameterVectorData (std::string const &parameter)
 
VectorDataListTypeGetParameterVectorDataList (std::string const &parameter)
 
std::string GetProgressDescription () const
 
itk::ProcessObject * GetProgressSource () const
 
bool HasAutomaticValue (std::string const &paramKey) const
 
bool HasUserValue (std::string const &paramKey) const
 
bool HasValue (std::string const &paramKey) const
 
void Init ()
 
bool IsApplicationReady ()
 
bool IsDeprecated ()
 
bool IsExecuteDone ()
 
bool IsInitialized () const
 
bool IsMandatory (std::string const &paramKey) const
 
bool IsParameterEnabled (std::string const &paramKey, bool recurseParents=false) const
 
bool IsParameterMissing (const std::string &key) const
 
void LoadParametersFromXML (const std::string &filename)
 
void PropagateConnectMode (bool isMem)
 
unsigned long PropagateRequestedRegion (const std::string &key, ImageBaseType::RegionType region, unsigned int idx=0)
 
void RegisterPipeline ()
 
void SaveParametersToXML (const std::string &filename)
 
void SetDefaultOutputComplexPixelType (std::string const &parameter, ComplexImagePixelType type)
 
void SetDefaultOutputPixelType (std::string const &parameter, ImagePixelType type)
 
void SetDefaultParameterFloat (std::string const &parameter, float value)
 
void SetDefaultParameterInt (std::string const &parameter, int value)
 
void SetDescription (const std::string &)
 
virtual void SetDocAuthors (const std::string &)
 
void SetDocExampleParameterValue (const std::string key, const std::string value, unsigned int exId=0)
 
virtual void SetDocLimitations (const std::string &)
 
virtual void SetDocLink (const std::string &link)
 
virtual void SetDocLongDescription (const std::string &)
 
virtual void SetDocSeeAlso (const std::string &)
 
virtual void SetDocTags (std::vector< std::string >)
 
void SetExampleComment (const std::string &comm, unsigned int i)
 
void SetListViewSingleSelectionMode (std::string const &parameter, bool status)
 
void SetLogger (otb::Logger *logger)
 
void SetMaximumParameterFloatValue (std::string const &parameter, float value)
 
void SetMaximumParameterIntValue (std::string const &parameter, int value)
 
void SetMinimumParameterFloatValue (std::string const &parameter, float value)
 
void SetMinimumParameterIntValue (std::string const &parameter, int value)
 
virtual void SetName (const std::string &)
 
void SetNthParameterInputImageList (std::string const &parameter, const unsigned int &id, ImageBaseType *img)
 
void SetNthParameterStringList (std::string const &parameter, const unsigned int &id, const std::string &str)
 
void SetOfficialDocLink ()
 
void SetParameterDescription (std::string const &paramKey, std::string dec)
 
void SetParameterFloat (std::string const &parameter, float value, bool hasUserValueFlag=true)
 
void SetParameterImageBase (const std::string &key, ImageBaseType *img, unsigned int idx=0)
 
void SetParameterInputImage (std::string const &parameter, ImageBaseType *inputImage)
 
void SetParameterInt (std::string const &parameter, int value, bool hasUserValueFlag=true)
 
void SetParameterList (ParameterGroup::Pointer paramGroup)
 
void SetParameterOutputImage (std::string const &parameter, FloatVectorImageType *value)
 
void SetParameterOutputImagePixelType (std::string const &parameter, ImagePixelType pixelType)
 
void SetParameterOutputVectorData (std::string const &parameter, VectorDataType *value)
 
void SetParameterString (std::string const &parameter, std::string value, bool hasUserValueFlag=true)
 
void SetParameterStringList (std::string const &parameter, std::vector< std::string > values, bool hasUserValueFlag=true)
 
void SetParameterUserValue (std::string const &paramKey, bool value)
 
void Stop ()
 
void UpdateParameters ()
 
void WriteOutput ()
 

Protected Member Functions

void AddChoice (std::string const &paramKey, std::string const &paramName)
 
void AddParameter (ParameterType type, std::string const &paramKey, std::string const &paramName)
 
void AddProcess (itk::ProcessObject *object, std::string description)
 
void AddRAMParameter (std::string const &paramKey="ram")
 
void AddRAMParameter (std::string const &paramKey, std::string const &paramName, unsigned int defaultValue)
 
void AddRANDParameter (std::string const &paramKey="rand")
 
void AddRANDParameter (std::string const &paramKey, std::string const &paramName, unsigned int defaultValue)
 
 Application ()
 
void AutomaticValueOff (std::string const &paramKey)
 
void AutomaticValueOn (std::string const &paramKey)
 
void ClearChoices (std::string const &key)
 
template<class TImageType >
TImageType * GetParameterImage (std::string const &parameter)
 
std::vector< int > GetSelectedItems (std::string const &paramKey)
 
void MandatoryOff (std::string const &paramKey)
 
void MandatoryOn (std::string const &paramKey)
 
template<class TImageType >
void SetParameterOutputImage (std::string const &parameter, TImageType *value)
 
void SetParameterRole (std::string const &paramKey, Role role)
 
void SetParameterUserLevel (std::string const &paramKey, UserLevel level)
 
 ~Application () override
 

Private Member Functions

virtual void AfterExecuteAndWriteOutputs ()
 
 Application (const Application &)=delete
 
virtual void DoExecute ()=0
 
virtual void DoFreeRessources ()
 
virtual void DoInit ()=0
 
virtual void DoUpdateParameters ()=0
 
void operator= (const Application &)=delete
 

Private Attributes

otb::Stopwatch m_Chrono
 
std::string m_Description
 
std::string m_DocAuthors
 
DocExampleStructure::Pointer m_DocExample
 
std::string m_DocLimitations
 
std::string m_Doclink
 
std::string m_DocLongDescription
 
std::string m_DocSeeAlso
 
std::vector< std::string > m_DocTags
 
bool m_ExecuteDone
 
std::set< itk::ProcessObject::Pointer > m_Filters
 
bool m_IsInPrivateDo
 
otb::Logger::Pointer m_Logger
 
std::string m_Name
 
ParameterGroup::Pointer m_ParameterList
 
itk::ProcessObject::Pointer m_ProgressSource
 
std::string m_ProgressSourceDescription
 

Friends

class ElevationParametersHandler
 
class MapProjectionParametersHandler
 

Detailed Description

This class represent an application TODO.

This class is a the Parameter key representation.

The constructor accepts a string key constructed as follow : parent.me.child. It implements some key manipulation as described in the code.

Definition at line 75 of file otbWrapperApplication.h.

Member Typedef Documentation

◆ ConstPointer

typedef itk::SmartPointer<const Self> otb::Wrapper::Application::ConstPointer

Definition at line 82 of file otbWrapperApplication.h.

◆ Pointer

typedef itk::SmartPointer<Self> otb::Wrapper::Application::Pointer

Definition at line 81 of file otbWrapperApplication.h.

◆ Self

Standard class typedefs.

Definition at line 79 of file otbWrapperApplication.h.

◆ Superclass

Definition at line 80 of file otbWrapperApplication.h.

Constructor & Destructor Documentation

◆ Application() [1/2]

otb::Wrapper::Application::Application ( )
protected

Constructor

◆ ~Application()

otb::Wrapper::Application::~Application ( )
overrideprotected

Destructor

◆ Application() [2/2]

otb::Wrapper::Application::Application ( const Application )
privatedelete

Member Function Documentation

◆ AddChoice()

void otb::Wrapper::Application::AddChoice ( std::string const &  paramKey,
std::string const &  paramName 
)
protected

Add a new choice value to an existing choice parameter

◆ AddDocTag()

void otb::Wrapper::Application::AddDocTag ( const std::string &  )

◆ AddExample()

unsigned int otb::Wrapper::Application::AddExample ( const std::string &  comm = "")

◆ AddImageToParameterInputImageList()

void otb::Wrapper::Application::AddImageToParameterInputImageList ( std::string const &  parameter,
ImageBaseType img 
)

Add an image to an InputImageList parameter as an ImageBase pointer instead of reading from file. Useful to connect pipelines between different application instances. parameter The parameter key img The ImageBase * of the image to add

Exceptions
itk::Exceptionif parameter is not found or not an InputImageList parameter

◆ AddParameter()

void otb::Wrapper::Application::AddParameter ( ParameterType  type,
std::string const &  paramKey,
std::string const &  paramName 
)
protected

Add a new parameter to the parameter group the parent key of paramKey can be the path to a parameter group or the path to a choice value

Referenced by otb::Wrapper::LearningApplicationBase< TInputValue, TOutputValue >::DoInit(), otb::Wrapper::TrainImagesBase::InitClassification(), otb::Wrapper::TrainImagesBase::InitIO(), and otb::Wrapper::TrainImagesBase::InitSampling().

◆ AddParameterStringList()

void otb::Wrapper::Application::AddParameterStringList ( std::string const &  parameter,
const std::string &  str 
)

Add a value to a parameter list as a string

Can be called for parameter types:

  • ParameterType_InputImageList

parameter The parameter key str The string

Exceptions
itk::Exceptionif parameter is not found or not an InputImageList parameter

◆ AddProcess()

void otb::Wrapper::Application::AddProcess ( itk::ProcessObject *  object,
std::string  description 
)
protected

◆ AddRAMParameter() [1/2]

void otb::Wrapper::Application::AddRAMParameter ( std::string const &  paramKey = "ram")
protected

Add a parameterRAM method with no parameter

◆ AddRAMParameter() [2/2]

void otb::Wrapper::Application::AddRAMParameter ( std::string const &  paramKey,
std::string const &  paramName,
unsigned int  defaultValue 
)
protected

Add a parameterRAM method with parameter

◆ AddRANDParameter() [1/2]

void otb::Wrapper::Application::AddRANDParameter ( std::string const &  paramKey = "rand")
protected

Add a parameterRAND method with no parameter

◆ AddRANDParameter() [2/2]

void otb::Wrapper::Application::AddRANDParameter ( std::string const &  paramKey,
std::string const &  paramName,
unsigned int  defaultValue 
)
protected

Add a parameterRAND method with parameter by default seed initialization is based on time value

◆ AfterExecuteAndWriteOutputs()

virtual void otb::Wrapper::Application::AfterExecuteAndWriteOutputs ( )
privatevirtual

◆ AutomaticValueOff()

void otb::Wrapper::Application::AutomaticValueOff ( std::string const &  paramKey)
protected

Declare a parameter as NOT having an automatic value

◆ AutomaticValueOn()

void otb::Wrapper::Application::AutomaticValueOn ( std::string const &  paramKey)
protected

Declare a parameter as having an automatic value

◆ ClearChoices()

void otb::Wrapper::Application::ClearChoices ( std::string const &  key)
protected

Remove the items added to the ListWidget

◆ ClearParameterInputImageList()

void otb::Wrapper::Application::ClearParameterInputImageList ( std::string const &  parameter)

Clear all images from an InputImageList parameter.

parameter The parameter key

Exceptions
itk::Exceptionif parameter is not found or not an InputImageList parameter

◆ ClearValue()

void otb::Wrapper::Application::ClearValue ( std::string const &  paramKey)

◆ ConnectImage()

bool otb::Wrapper::Application::ConnectImage ( std::string  in,
Application app,
std::string  out 
)

Connect input image to an output image in app

◆ DisableParameter()

void otb::Wrapper::Application::DisableParameter ( std::string const &  paramKey)

◆ DoExecute()

virtual void otb::Wrapper::Application::DoExecute ( )
privatepure virtual

◆ DoFreeRessources()

virtual void otb::Wrapper::Application::DoFreeRessources ( )
inlineprivatevirtual

Definition at line 868 of file otbWrapperApplication.h.

◆ DoInit()

virtual void otb::Wrapper::Application::DoInit ( )
privatepure virtual

◆ DoUpdateParameters()

virtual void otb::Wrapper::Application::DoUpdateParameters ( )
privatepure virtual

◆ EnableParameter()

void otb::Wrapper::Application::EnableParameter ( std::string const &  paramKey)

◆ Execute()

int otb::Wrapper::Application::Execute ( )

Run the application.

For pipeline ready application, this only wires and configures the pipeline, and provides the output image or vector data parameters as pointers.

In other cases, the application must handle the I/O (intermediary results for example)

Returns 0 on success, or a non-null integer on error

◆ ExecuteAndWriteOutput()

int otb::Wrapper::Application::ExecuteAndWriteOutput ( )

Run the application, then write all of the output to disk if they have an associated filename. This is a helper function for wrappers without pipeline support.

Returns 0 on success, or a non-null integer on error

◆ FreeRessources()

void otb::Wrapper::Application::FreeRessources ( )

Register all DataObject that are reachable from :

  • ParameterType_OutputImage
  • ParameterType_OutputVectorData

Once registered, the methode ReleaseData is called on each one of them.

◆ GetChoiceKeys()

std::vector<std::string> otb::Wrapper::Application::GetChoiceKeys ( std::string const &  paramKey)

◆ GetChoiceNames()

std::vector<std::string> otb::Wrapper::Application::GetChoiceNames ( std::string const &  paramKey)

◆ GetCLExample()

std::string otb::Wrapper::Application::GetCLExample ( )

◆ GetDefaultParameterFloat()

float otb::Wrapper::Application::GetDefaultParameterFloat ( std::string const &  parameter)

◆ GetDefaultParameterInt()

int otb::Wrapper::Application::GetDefaultParameterInt ( std::string const &  parameter)

◆ GetDescription()

virtual const char* otb::Wrapper::Application::GetDescription ( ) const
virtual

◆ GetDocAuthors()

virtual const char* otb::Wrapper::Application::GetDocAuthors ( ) const
virtual

◆ GetDocExample()

DocExampleStructure::Pointer otb::Wrapper::Application::GetDocExample ( )

◆ GetDocLimitations()

virtual const char* otb::Wrapper::Application::GetDocLimitations ( ) const
virtual

◆ GetDocLink()

virtual const std::string& otb::Wrapper::Application::GetDocLink ( ) const
virtual

◆ GetDocLongDescription()

virtual const char* otb::Wrapper::Application::GetDocLongDescription ( ) const
virtual

◆ GetDocSeeAlso()

virtual const char* otb::Wrapper::Application::GetDocSeeAlso ( ) const
virtual

◆ GetDocTags()

virtual std::vector<std::string> otb::Wrapper::Application::GetDocTags ( ) const
virtual

◆ GetExampleComment()

std::string otb::Wrapper::Application::GetExampleComment ( unsigned int  id)

◆ GetExampleNumberOfParameters()

unsigned int otb::Wrapper::Application::GetExampleNumberOfParameters ( unsigned int  id)

◆ GetExampleParameterKey()

std::string otb::Wrapper::Application::GetExampleParameterKey ( unsigned int  exId,
unsigned int  paramId 
)

◆ GetExampleParameterValue()

std::string otb::Wrapper::Application::GetExampleParameterValue ( unsigned int  exId,
unsigned int  paramId 
)

◆ GetHtmlExample()

std::string otb::Wrapper::Application::GetHtmlExample ( )

◆ GetImageBasePixelType()

ImagePixelType otb::Wrapper::Application::GetImageBasePixelType ( const std::string &  key,
unsigned int  idx = 0 
)

Find out what is the pixel type from an image parameter This function assumes that the underlying object is either an otb::Image or an otb::VectorImage. The optional 'idx' allows accessing InputImageList.

◆ GetImageKeywordlist()

otb::ImageKeywordlist otb::Wrapper::Application::GetImageKeywordlist ( const std::string &  key,
unsigned int  idx = 0 
)

Get the keywordlist of the image parameter 'key'. The optional 'idx' allows selecting the image in an InputImageList.

◆ GetImageMetaData()

itk::MetaDataDictionary otb::Wrapper::Application::GetImageMetaData ( const std::string &  key,
unsigned int  idx = 0 
)

Returns a copy of the metadata dictionary of the image

◆ GetImageNbBands()

unsigned int otb::Wrapper::Application::GetImageNbBands ( const std::string &  key,
unsigned int  idx = 0 
)

Get the number of bands in the image parameter 'key'. The optional 'idx' allows selecting the image in an InputImageList.

◆ GetImageOrigin()

ImageBaseType::PointType otb::Wrapper::Application::GetImageOrigin ( const std::string &  key,
unsigned int  idx = 0 
)

Get the origin of the image parameter 'key'. The optional 'idx' allows to select the image in an InputImageList.

◆ GetImageProjection()

std::string otb::Wrapper::Application::GetImageProjection ( const std::string &  key,
unsigned int  idx = 0 
)

Get the projection of the image parameter 'key'. The optional 'idx' allows to select the image in an InputImageList.

◆ GetImageRequestedRegion()

ImageBaseType::RegionType otb::Wrapper::Application::GetImageRequestedRegion ( const std::string &  key,
unsigned int  idx = 0 
)

Get the requested region of the image parameter 'key'. The optional 'idx' allows selecting the image in an InputImageList. It should be assumed that the index of the largest possible region starts at (0,0).

◆ GetImageSize()

ImageBaseType::SizeType otb::Wrapper::Application::GetImageSize ( const std::string &  key,
unsigned int  idx = 0 
)

Get the size of the image parameter 'key'. The optional 'idx' allows selecting the image in an InputImageList. It corresponds to the size of LargestPossibleRegion

◆ GetImageSpacing()

ImageBaseType::SpacingType otb::Wrapper::Application::GetImageSpacing ( const std::string &  key,
unsigned int  idx = 0 
)

Get the spacing of the image parameter 'key'. The optional 'idx' allows selecting the image in an InputImageList. We use the signed spacing convention.

◆ GetLastExecutionTiming()

double otb::Wrapper::Application::GetLastExecutionTiming ( ) const

◆ GetListViewSingleSelectionMode()

bool otb::Wrapper::Application::GetListViewSingleSelectionMode ( const std::string &  parameter)

True if the parameter is a list view and is in single selection mode

Can be called for types:

  • ParameterType_ListView

◆ GetLogger()

otb::Logger* otb::Wrapper::Application::GetLogger ( ) const

◆ GetName()

virtual const char* otb::Wrapper::Application::GetName ( ) const
virtual

◆ GetNameOfClass()

virtual const char* otb::Wrapper::Application::GetNameOfClass ( ) const
virtual

◆ GetNumberOfElementsInParameterInputImageList()

unsigned int otb::Wrapper::Application::GetNumberOfElementsInParameterInputImageList ( std::string const &  parameter)

Get the number of images in an InputImageList parameter. parameter The parameter key

Returns
The number of images
Exceptions
itk::Exceptionif parameter is not found or not an InputImageList parameter

◆ GetNumberOfExamples()

unsigned int otb::Wrapper::Application::GetNumberOfExamples ( )

◆ GetOutputParametersSumUp()

std::vector<std::pair<std::string, std::string> > otb::Wrapper::Application::GetOutputParametersSumUp ( )

Return all parameters which role is Role_Output in a vector of pairs that contains the parameter key and its value.

◆ GetParameterAsString()

std::string otb::Wrapper::Application::GetParameterAsString ( std::string const &  paramKey)

◆ GetParameterByKey() [1/2]

Parameter* otb::Wrapper::Application::GetParameterByKey ( std::string const &  parameter,
bool  follow = true 
)

◆ GetParameterByKey() [2/2]

const Parameter* otb::Wrapper::Application::GetParameterByKey ( std::string const &  parameter,
bool  follow = true 
) const

◆ GetParameterComplexDoubleImage()

ComplexDoubleImageType* otb::Wrapper::Application::GetParameterComplexDoubleImage ( std::string const &  )

◆ GetParameterComplexDoubleVectorImage()

ComplexDoubleVectorImageType* otb::Wrapper::Application::GetParameterComplexDoubleVectorImage ( std::string const &  )

◆ GetParameterComplexFloatImage()

ComplexFloatImageType* otb::Wrapper::Application::GetParameterComplexFloatImage ( std::string const &  )

◆ GetParameterComplexFloatVectorImage()

ComplexFloatVectorImageType* otb::Wrapper::Application::GetParameterComplexFloatVectorImage ( std::string const &  )

◆ GetParameterComplexInt16Image()

ComplexInt16ImageType* otb::Wrapper::Application::GetParameterComplexInt16Image ( std::string const &  )

◆ GetParameterComplexInt16VectorImage()

ComplexInt16VectorImageType* otb::Wrapper::Application::GetParameterComplexInt16VectorImage ( std::string const &  )

◆ GetParameterComplexInt32Image()

ComplexInt32ImageType* otb::Wrapper::Application::GetParameterComplexInt32Image ( std::string const &  )

◆ GetParameterComplexInt32VectorImage()

ComplexInt32VectorImageType* otb::Wrapper::Application::GetParameterComplexInt32VectorImage ( std::string const &  )

◆ GetParameterDescription()

std::string otb::Wrapper::Application::GetParameterDescription ( std::string const &  paramKey)

◆ GetParameterDoubleImage()

DoubleImageType* otb::Wrapper::Application::GetParameterDoubleImage ( std::string const &  )

◆ GetParameterDoubleVectorImage()

DoubleVectorImageType* otb::Wrapper::Application::GetParameterDoubleVectorImage ( std::string const &  )

◆ GetParameterFloat()

float otb::Wrapper::Application::GetParameterFloat ( std::string const &  parameter) const

◆ GetParameterFloatImage()

FloatImageType* otb::Wrapper::Application::GetParameterFloatImage ( std::string const &  )

◆ GetParameterFloatVectorImage()

FloatVectorImageType* otb::Wrapper::Application::GetParameterFloatVectorImage ( std::string const &  )

◆ GetParameterImage() [1/2]

template OTBApplicationEngine_EXPORT_TEMPLATE ComplexDoubleImageType * otb::Wrapper::Application::GetParameterImage< ComplexDoubleImageType > ( std::string const &  parameter)

◆ GetParameterImage() [2/2]

template<class TImageType >
TImageType * otb::Wrapper::Application::GetParameterImage ( std::string const &  parameter)
protected

◆ GetParameterImageBase()

ImageBaseType* otb::Wrapper::Application::GetParameterImageBase ( const std::string &  key,
unsigned int  idx = 0 
)

Return the image from parameter 'key' as a base type. The optional 'idx' allows accessing InputImageList.

Works on parameters:

  • ParameterType_InputImage
  • ParameterType_InputImageList
  • ParameterType_OutputImage

◆ GetParameterImageList()

FloatVectorImageListType* otb::Wrapper::Application::GetParameterImageList ( std::string const &  parameter)

◆ GetParameterInt()

int otb::Wrapper::Application::GetParameterInt ( std::string const &  parameter) const

◆ GetParameterInt16Image()

Int16ImageType* otb::Wrapper::Application::GetParameterInt16Image ( std::string const &  )

◆ GetParameterInt16VectorImage()

Int16VectorImageType* otb::Wrapper::Application::GetParameterInt16VectorImage ( std::string const &  )

◆ GetParameterInt32Image()

Int32ImageType* otb::Wrapper::Application::GetParameterInt32Image ( std::string const &  )

◆ GetParameterInt32VectorImage()

Int32VectorImageType* otb::Wrapper::Application::GetParameterInt32VectorImage ( std::string const &  )

◆ GetParameterList()

ParameterGroup* otb::Wrapper::Application::GetParameterList ( )

◆ GetParameterName()

std::string otb::Wrapper::Application::GetParameterName ( std::string const &  paramKey)

◆ GetParameterOutputImage()

ImageBaseType* otb::Wrapper::Application::GetParameterOutputImage ( std::string const &  parameter)

Get the output image parameter as an ImageBase * instead of writing to disk. Useful to connect pipelines between different application instances. parameter The parameter key

Returns
The ImageBase * to the output image
Exceptions
itk::Exceptionif parameter is not found or not an OutputImageParameter

◆ GetParameterOutputImagePixelType()

ImagePixelType otb::Wrapper::Application::GetParameterOutputImagePixelType ( std::string const &  parameter)

◆ GetParameterRole()

Role otb::Wrapper::Application::GetParameterRole ( std::string const &  paramKey) const

Get the role of the parameter

◆ GetParametersKeys()

std::vector<std::string> otb::Wrapper::Application::GetParametersKeys ( bool  recursive = true)

◆ GetParameterString()

std::string otb::Wrapper::Application::GetParameterString ( std::string const &  parameter) const

◆ GetParameterStringList()

std::vector<std::string> otb::Wrapper::Application::GetParameterStringList ( const std::string &  parameter)

◆ GetParameterType()

ParameterType otb::Wrapper::Application::GetParameterType ( std::string const &  paramKey) const

◆ GetParameterUInt16Image()

UInt16ImageType* otb::Wrapper::Application::GetParameterUInt16Image ( std::string const &  )

◆ GetParameterUInt16VectorImage()

UInt16VectorImageType* otb::Wrapper::Application::GetParameterUInt16VectorImage ( std::string const &  )

◆ GetParameterUInt32Image()

UInt32ImageType* otb::Wrapper::Application::GetParameterUInt32Image ( std::string const &  )

◆ GetParameterUInt32VectorImage()

UInt32VectorImageType* otb::Wrapper::Application::GetParameterUInt32VectorImage ( std::string const &  )

◆ GetParameterUInt8Image()

UInt8ImageType* otb::Wrapper::Application::GetParameterUInt8Image ( std::string const &  )

◆ GetParameterUInt8RGBAImage()

UInt8RGBAImageType* otb::Wrapper::Application::GetParameterUInt8RGBAImage ( std::string const &  )

◆ GetParameterUInt8RGBImage()

UInt8RGBImageType* otb::Wrapper::Application::GetParameterUInt8RGBImage ( std::string const &  )

◆ GetParameterUInt8VectorImage()

UInt8VectorImageType* otb::Wrapper::Application::GetParameterUInt8VectorImage ( std::string const &  )

◆ GetParameterUserLevel()

UserLevel otb::Wrapper::Application::GetParameterUserLevel ( std::string const &  paramKey) const

◆ GetParameterVectorData()

VectorDataType* otb::Wrapper::Application::GetParameterVectorData ( std::string const &  parameter)

◆ GetParameterVectorDataList()

VectorDataListType* otb::Wrapper::Application::GetParameterVectorDataList ( std::string const &  parameter)

◆ GetProgressDescription()

std::string otb::Wrapper::Application::GetProgressDescription ( ) const

◆ GetProgressSource()

itk::ProcessObject* otb::Wrapper::Application::GetProgressSource ( ) const

◆ GetSelectedItems()

std::vector<int> otb::Wrapper::Application::GetSelectedItems ( std::string const &  paramKey)
protected

Get Items selected in the ListView Parameter

◆ HasAutomaticValue()

bool otb::Wrapper::Application::HasAutomaticValue ( std::string const &  paramKey) const

◆ HasUserValue()

bool otb::Wrapper::Application::HasUserValue ( std::string const &  paramKey) const

◆ HasValue()

bool otb::Wrapper::Application::HasValue ( std::string const &  paramKey) const

◆ Init()

void otb::Wrapper::Application::Init ( )

Initialize the application, instantiating the parameter list

◆ IsApplicationReady()

bool otb::Wrapper::Application::IsApplicationReady ( )

Checks if the application is ready to be executed. It checks that there is no missing parameter

◆ IsDeprecated()

bool otb::Wrapper::Application::IsDeprecated ( )

return wether the application has the "deprecated tag or not

◆ IsExecuteDone()

bool otb::Wrapper::Application::IsExecuteDone ( )

◆ IsInitialized()

bool otb::Wrapper::Application::IsInitialized ( ) const

Check if the application has been initialized

◆ IsMandatory()

bool otb::Wrapper::Application::IsMandatory ( std::string const &  paramKey) const

◆ IsParameterEnabled()

bool otb::Wrapper::Application::IsParameterEnabled ( std::string const &  paramKey,
bool  recurseParents = false 
) const

◆ IsParameterMissing()

bool otb::Wrapper::Application::IsParameterMissing ( const std::string &  key) const

Checks if a parameter 'key' is missing.

A parameter is missing when all the following conditions are true :

  • the parameter is mandatory
  • the parameter has Role_Input
  • the parameter is not a group
  • the parameter has no value
  • the parameter ancestors are mandatory or enabled.

◆ LoadParametersFromXML()

void otb::Wrapper::Application::LoadParametersFromXML ( const std::string &  filename)

◆ MandatoryOff()

void otb::Wrapper::Application::MandatoryOff ( std::string const &  paramKey)
protected

Declare a parameter as NOT mandatory (default state)

Referenced by otb::Wrapper::TrainImagesBase::InitClassification().

◆ MandatoryOn()

void otb::Wrapper::Application::MandatoryOn ( std::string const &  paramKey)
protected

Declare a parameter as mandatory

Referenced by otb::Wrapper::TrainImagesBase::InitIO().

◆ operator=()

void otb::Wrapper::Application::operator= ( const Application )
privatedelete

◆ PropagateConnectMode()

void otb::Wrapper::Application::PropagateConnectMode ( bool  isMem)

Propagate the connection mode :

◆ PropagateRequestedRegion()

unsigned long otb::Wrapper::Application::PropagateRequestedRegion ( const std::string &  key,
ImageBaseType::RegionType  region,
unsigned int  idx = 0 
)

Set the requested region on the image parameter 'key' and propagate it. The returned value is an estimate of the RAM usage (in Bytes) to process this region. It should be assumed that the index of the largest possible region starts at (0,0). The optional 'idx' allows selecting the image in an InputImageList

◆ RegisterPipeline()

void otb::Wrapper::Application::RegisterPipeline ( )

Register all ProcessObject that are linked to parameters :

  • ParameterType_OutputImage
  • ParameterType_OutputVectorData

Those ProcessObjects are stored in the m_Filters set and are deleted at the end of ExecuteAndWriteOutput (if there are only held by the set) This method can be called just before the end of a DoExecute in a derived class of Application.

◆ SaveParametersToXML()

void otb::Wrapper::Application::SaveParametersToXML ( const std::string &  filename)

◆ SetDefaultOutputComplexPixelType()

void otb::Wrapper::Application::SetDefaultOutputComplexPixelType ( std::string const &  parameter,
ComplexImagePixelType  type 
)

Set a default complex pixel type for an output complex image parameter

Parameters
[in]parameterName of the output complex image parameter
[in]typeDefault complex pixel type

◆ SetDefaultOutputPixelType()

void otb::Wrapper::Application::SetDefaultOutputPixelType ( std::string const &  parameter,
ImagePixelType  type 
)

Set a default pixel type for an output image parameter

Parameters
[in]parameterName of the output image parameter
[in]typeDefault pixel type

◆ SetDefaultParameterFloat()

void otb::Wrapper::Application::SetDefaultParameterFloat ( std::string const &  parameter,
float  value 
)

◆ SetDefaultParameterInt()

void otb::Wrapper::Application::SetDefaultParameterInt ( std::string const &  parameter,
int  value 
)

◆ SetDescription()

void otb::Wrapper::Application::SetDescription ( const std::string &  )

◆ SetDocAuthors()

virtual void otb::Wrapper::Application::SetDocAuthors ( const std::string &  )
virtual

◆ SetDocExampleParameterValue()

void otb::Wrapper::Application::SetDocExampleParameterValue ( const std::string  key,
const std::string  value,
unsigned int  exId = 0 
)

◆ SetDocLimitations()

virtual void otb::Wrapper::Application::SetDocLimitations ( const std::string &  )
virtual

◆ SetDocLink()

virtual void otb::Wrapper::Application::SetDocLink ( const std::string &  link)
virtual

◆ SetDocLongDescription()

virtual void otb::Wrapper::Application::SetDocLongDescription ( const std::string &  )
virtual

◆ SetDocSeeAlso()

virtual void otb::Wrapper::Application::SetDocSeeAlso ( const std::string &  )
virtual

◆ SetDocTags()

virtual void otb::Wrapper::Application::SetDocTags ( std::vector< std::string >  )
virtual

◆ SetExampleComment()

void otb::Wrapper::Application::SetExampleComment ( const std::string &  comm,
unsigned int  i 
)

◆ SetListViewSingleSelectionMode()

void otb::Wrapper::Application::SetListViewSingleSelectionMode ( std::string const &  parameter,
bool  status 
)

Enable single selection mode for list view if status is true (default is false).

Can be called for types:

  • ParameterType_ListView

◆ SetLogger()

void otb::Wrapper::Application::SetLogger ( otb::Logger logger)

Sets the logger instance of the application (use with caution)

◆ SetMaximumParameterFloatValue()

void otb::Wrapper::Application::SetMaximumParameterFloatValue ( std::string const &  parameter,
float  value 
)

◆ SetMaximumParameterIntValue()

void otb::Wrapper::Application::SetMaximumParameterIntValue ( std::string const &  parameter,
int  value 
)

◆ SetMinimumParameterFloatValue()

void otb::Wrapper::Application::SetMinimumParameterFloatValue ( std::string const &  parameter,
float  value 
)

◆ SetMinimumParameterIntValue()

void otb::Wrapper::Application::SetMinimumParameterIntValue ( std::string const &  parameter,
int  value 
)

◆ SetName()

virtual void otb::Wrapper::Application::SetName ( const std::string &  )
virtual

◆ SetNthParameterInputImageList()

void otb::Wrapper::Application::SetNthParameterInputImageList ( std::string const &  parameter,
const unsigned int &  id,
ImageBaseType img 
)

Set the nth image of an InputImageList parameter as an ImageBase pointer instead of reading from file. Useful to connect pipelines between different application instances. parameter The parameter key id Position at which to set the ImageBase pointer img The ImageBase * of the image to add

Exceptions
itk::Exceptionif parameter is not found or not an InputImageList parameter or if id is out of bounds

◆ SetNthParameterStringList()

void otb::Wrapper::Application::SetNthParameterStringList ( std::string const &  parameter,
const unsigned int &  id,
const std::string &  str 
)

Set the nth value of a parameter list as a string.

Can be called for parameter types:

  • ParameterType_InputImageList

parameter The parameter key id Position at which to set the ImageBase pointer str The string

Exceptions
itk::Exceptionif parameter is not found or not an InputImageList parameter or if id is out of bounds

◆ SetOfficialDocLink()

void otb::Wrapper::Application::SetOfficialDocLink ( )

◆ SetParameterDescription()

void otb::Wrapper::Application::SetParameterDescription ( std::string const &  paramKey,
std::string  dec 
)

◆ SetParameterFloat()

void otb::Wrapper::Application::SetParameterFloat ( std::string const &  parameter,
float  value,
bool  hasUserValueFlag = true 
)

◆ SetParameterImageBase()

void otb::Wrapper::Application::SetParameterImageBase ( const std::string &  key,
ImageBaseType img,
unsigned int  idx = 0 
)

Set the image in parameter 'key' as a base type. The optional 'idx' allows accessing InputImageList.

Works on parameters:

  • ParameterType_InputImage
  • ParameterType_InputImageList

◆ SetParameterInputImage()

void otb::Wrapper::Application::SetParameterInputImage ( std::string const &  parameter,
ImageBaseType inputImage 
)

Set the input image parameter as an ImageBase * instead of filename. Useful to connect pipelines between different application instances. parameter The parameter key inputImage ImageBase pointer to use as input

Exceptions
itk::Exceptionif parameter is not found or not an InputImageParameter

Referenced by otb::Wrapper::TrainImagesBase::ComputePolygonStatistics(), and otb::Wrapper::TrainImagesBase::SelectAndExtractSamples().

◆ SetParameterInt()

void otb::Wrapper::Application::SetParameterInt ( std::string const &  parameter,
int  value,
bool  hasUserValueFlag = true 
)

◆ SetParameterList()

void otb::Wrapper::Application::SetParameterList ( ParameterGroup::Pointer  paramGroup)
inline

Definition at line 637 of file otbWrapperApplication.h.

References value().

◆ SetParameterOutputImage() [1/2]

template OTBApplicationEngine_EXPORT_TEMPLATE void otb::Wrapper::Application::SetParameterOutputImage< FloatVectorImageType > ( std::string const &  parameter,
FloatVectorImageType value 
)

◆ SetParameterOutputImage() [2/2]

template<class TImageType >
void otb::Wrapper::Application::SetParameterOutputImage ( std::string const &  parameter,
TImageType *  value 
)
protected

◆ SetParameterOutputImagePixelType()

void otb::Wrapper::Application::SetParameterOutputImagePixelType ( std::string const &  parameter,
ImagePixelType  pixelType 
)

◆ SetParameterOutputVectorData()

void otb::Wrapper::Application::SetParameterOutputVectorData ( std::string const &  parameter,
VectorDataType value 
)

◆ SetParameterRole()

void otb::Wrapper::Application::SetParameterRole ( std::string const &  paramKey,
Role  role 
)
protected

◆ SetParameterString()

void otb::Wrapper::Application::SetParameterString ( std::string const &  parameter,
std::string  value,
bool  hasUserValueFlag = true 
)

◆ SetParameterStringList()

void otb::Wrapper::Application::SetParameterStringList ( std::string const &  parameter,
std::vector< std::string >  values,
bool  hasUserValueFlag = true 
)

◆ SetParameterUserLevel()

void otb::Wrapper::Application::SetParameterUserLevel ( std::string const &  paramKey,
UserLevel  level 
)
protected

◆ SetParameterUserValue()

void otb::Wrapper::Application::SetParameterUserValue ( std::string const &  paramKey,
bool  value 
)

Set HasUserValue flag of parameter with key paramKey Note that when this function is called from DoInit, DoUpdateParameters or DoExecute, it will always set this flag to false, because this is the core behavior of the application.

◆ Stop()

void otb::Wrapper::Application::Stop ( )

Request the application to stop its processing

◆ UpdateParameters()

void otb::Wrapper::Application::UpdateParameters ( )

Update the value of parameters for which no user value has been provided

◆ WriteOutput()

void otb::Wrapper::Application::WriteOutput ( )

write all of the output to disk if they have an associated filename. This is a helper function for wrappers without pipeline support.

Friends And Related Function Documentation

◆ ElevationParametersHandler

friend class ElevationParametersHandler
friend

Definition at line 921 of file otbWrapperApplication.h.

◆ MapProjectionParametersHandler

friend class MapProjectionParametersHandler
friend

Declare the class

Definition at line 920 of file otbWrapperApplication.h.

Member Data Documentation

◆ m_Chrono

otb::Stopwatch otb::Wrapper::Application::m_Chrono
private

Chrono to measure execution time

Definition at line 905 of file otbWrapperApplication.h.

◆ m_Description

std::string otb::Wrapper::Application::m_Description
private

Definition at line 874 of file otbWrapperApplication.h.

◆ m_DocAuthors

std::string otb::Wrapper::Application::m_DocAuthors
private

Author List. Format : "John Doe, Winnie the Pooh".

Definition at line 890 of file otbWrapperApplication.h.

◆ m_DocExample

DocExampleStructure::Pointer otb::Wrapper::Application::m_DocExample
private

Doc example structure. Use GetDocExample() to access it

Definition at line 887 of file otbWrapperApplication.h.

◆ m_DocLimitations

std::string otb::Wrapper::Application::m_DocLimitations
private

Known limitations (threading, invalid pixel type ...) or bugs

Definition at line 893 of file otbWrapperApplication.h.

◆ m_Doclink

std::string otb::Wrapper::Application::m_Doclink
private

Doc link application

Definition at line 902 of file otbWrapperApplication.h.

◆ m_DocLongDescription

std::string otb::Wrapper::Application::m_DocLongDescription
private

Long and precise application description .

Definition at line 884 of file otbWrapperApplication.h.

◆ m_DocSeeAlso

std::string otb::Wrapper::Application::m_DocSeeAlso
private

Related applications

Definition at line 896 of file otbWrapperApplication.h.

◆ m_DocTags

std::vector<std::string> otb::Wrapper::Application::m_DocTags
private

Tags that define the application (ex : segmentation, OBIA).

Definition at line 899 of file otbWrapperApplication.h.

◆ m_ExecuteDone

bool otb::Wrapper::Application::m_ExecuteDone
private

Flag to check if Execute has already been called

Definition at line 911 of file otbWrapperApplication.h.

◆ m_Filters

std::set<itk::ProcessObject::Pointer> otb::Wrapper::Application::m_Filters
private

Definition at line 881 of file otbWrapperApplication.h.

◆ m_IsInPrivateDo

bool otb::Wrapper::Application::m_IsInPrivateDo
private

Flag is true when executing DoInit, DoUpdateParameters or DoExecute

Definition at line 908 of file otbWrapperApplication.h.

◆ m_Logger

otb::Logger::Pointer otb::Wrapper::Application::m_Logger
private

Definition at line 876 of file otbWrapperApplication.h.

◆ m_Name

std::string otb::Wrapper::Application::m_Name
private

Definition at line 873 of file otbWrapperApplication.h.

◆ m_ParameterList

ParameterGroup::Pointer otb::Wrapper::Application::m_ParameterList
private

Definition at line 875 of file otbWrapperApplication.h.

◆ m_ProgressSource

itk::ProcessObject::Pointer otb::Wrapper::Application::m_ProgressSource
private

Definition at line 878 of file otbWrapperApplication.h.

◆ m_ProgressSourceDescription

std::string otb::Wrapper::Application::m_ProgressSourceDescription
private

Definition at line 879 of file otbWrapperApplication.h.


The documentation for this class was generated from the following files: