OTB  6.7.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 Self
ConstPointer
 
typedef itk::SmartPointer< SelfPointer
 
typedef Application Self
 
typedef itk::Object Superclass
 
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Object Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

Public Member Functions

void AddDocTag (const std::string &)
 
unsigned int AddExample (const std::string &comm="")
 
void AddImageToParameterInputImageList (std::string parameter, ImageBaseType *img)
 
void AddParameterStringList (std::string parameter, const std::string &str)
 
void ClearParameterInputImageList (std::string parameter)
 
void ClearValue (std::string paramKey)
 
void DisableParameter (std::string paramKey)
 
void EnableParameter (std::string paramKey)
 
int Execute ()
 
int ExecuteAndWriteOutput ()
 
void FreeRessources ()
 
std::vector< std::string > GetChoiceKeys (std::string paramKey)
 
std::vector< std::string > GetChoiceNames (std::string paramKey)
 
std::string GetCLExample ()
 
float GetDefaultParameterFloat (std::string parameter)
 
int GetDefaultParameterInt (std::string 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 parameter)
 
unsigned int GetNumberOfExamples ()
 
std::vector< std::pair
< std::string, std::string > > 
GetOutputParametersSumUp ()
 
std::string GetParameterAsString (std::string paramKey)
 
ParameterGetParameterByKey (std::string parameter, bool follow=true)
 
const ParameterGetParameterByKey (std::string parameter, bool follow=true) const
 
ComplexDoubleImageTypeGetParameterComplexDoubleImage (std::string)
 
ComplexDoubleVectorImageTypeGetParameterComplexDoubleVectorImage (std::string)
 
ComplexFloatImageTypeGetParameterComplexFloatImage (std::string)
 
ComplexFloatVectorImageTypeGetParameterComplexFloatVectorImage (std::string)
 
ComplexInt16ImageTypeGetParameterComplexInt16Image (std::string)
 
ComplexInt16VectorImageTypeGetParameterComplexInt16VectorImage (std::string)
 
ComplexInt32ImageTypeGetParameterComplexInt32Image (std::string)
 
ComplexInt32VectorImageTypeGetParameterComplexInt32VectorImage (std::string)
 
std::string GetParameterDescription (std::string paramKey)
 
DoubleImageTypeGetParameterDoubleImage (std::string)
 
DoubleVectorImageTypeGetParameterDoubleVectorImage (std::string)
 
float GetParameterFloat (std::string parameter)
 
FloatImageTypeGetParameterFloatImage (std::string)
 
FloatVectorImageTypeGetParameterFloatVectorImage (std::string)
 
FloatVectorImageTypeGetParameterImage (std::string parameter)
 
ImageBaseTypeGetParameterImageBase (const std::string &key, unsigned int idx=0)
 
FloatVectorImageListTypeGetParameterImageList (std::string parameter)
 
int GetParameterInt (std::string parameter)
 
Int16ImageTypeGetParameterInt16Image (std::string)
 
Int16VectorImageTypeGetParameterInt16VectorImage (std::string)
 
Int32ImageTypeGetParameterInt32Image (std::string)
 
Int32VectorImageTypeGetParameterInt32VectorImage (std::string)
 
ParameterGroupGetParameterList ()
 
std::string GetParameterName (std::string paramKey)
 
ImageBaseTypeGetParameterOutputImage (std::string parameter)
 
ImagePixelType GetParameterOutputImagePixelType (std::string parameter)
 
Role GetParameterRole (std::string paramKey) const
 
std::vector< std::string > GetParametersKeys (bool recursive=true)
 
std::string GetParameterString (std::string parameter)
 
std::vector< std::string > GetParameterStringList (const std::string &parameter)
 
ParameterType GetParameterType (std::string paramKey) const
 
UInt16ImageTypeGetParameterUInt16Image (std::string)
 
UInt16VectorImageTypeGetParameterUInt16VectorImage (std::string)
 
UInt32ImageTypeGetParameterUInt32Image (std::string)
 
UInt32VectorImageTypeGetParameterUInt32VectorImage (std::string)
 
UInt8ImageTypeGetParameterUInt8Image (std::string)
 
UInt8RGBAImageTypeGetParameterUInt8RGBAImage (std::string)
 
UInt8RGBImageTypeGetParameterUInt8RGBImage (std::string)
 
UInt8VectorImageTypeGetParameterUInt8VectorImage (std::string)
 
UserLevel GetParameterUserLevel (std::string paramKey) const
 
VectorDataTypeGetParameterVectorData (std::string parameter)
 
VectorDataListTypeGetParameterVectorDataList (std::string parameter)
 
std::string GetProgressDescription () const
 
itk::ProcessObjectGetProgressSource () const
 
bool HasAutomaticValue (std::string paramKey) const
 
bool HasUserValue (std::string paramKey) const
 
bool HasValue (std::string paramKey) const
 
void Init ()
 
bool IsApplicationReady ()
 
bool IsDeprecated ()
 
bool IsInitialized () const
 
bool IsMandatory (std::string paramKey) const
 
bool IsParameterEnabled (std::string paramKey, bool recurseParents=false) const
 
bool IsParameterMissing (const std::string &key) const
 
void LoadParametersFromXML (const std::string &filename)
 
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 parameter, ComplexImagePixelType type)
 
void SetDefaultOutputPixelType (std::string parameter, ImagePixelType type)
 
void SetDefaultParameterFloat (std::string parameter, float value)
 
void SetDefaultParameterInt (std::string 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 parameter, bool status)
 
void SetLogger (otb::Logger *logger)
 
void SetMaximumParameterFloatValue (std::string parameter, float value)
 
void SetMaximumParameterIntValue (std::string parameter, int value)
 
void SetMinimumParameterFloatValue (std::string parameter, float value)
 
void SetMinimumParameterIntValue (std::string parameter, int value)
 
virtual void SetName (const std::string &)
 
void SetNthParameterInputImageList (std::string parameter, const unsigned int &id, ImageBaseType *img)
 
void SetNthParameterStringList (std::string parameter, const unsigned int &id, const std::string &str)
 
void SetOfficialDocLink ()
 
void SetParameterDescription (std::string paramKey, std::string dec)
 
void SetParameterFloat (std::string parameter, float value, bool hasUserValueFlag=true)
 
void SetParameterImageBase (const std::string &key, ImageBaseType *img, unsigned int idx=0)
 
void SetParameterInputImage (std::string parameter, ImageBaseType *inputImage)
 
void SetParameterInt (std::string parameter, int value, bool hasUserValueFlag=true)
 
void SetParameterList (ParameterGroup::Pointer paramGroup)
 
void SetParameterOutputImage (std::string parameter, FloatVectorImageType *value)
 
void SetParameterOutputImagePixelType (std::string parameter, ImagePixelType pixelType)
 
void SetParameterOutputVectorData (std::string parameter, VectorDataType *value)
 
void SetParameterString (std::string parameter, std::string value, bool hasUserValueFlag=true)
 
void SetParameterStringList (std::string parameter, std::vector< std::string > values, bool hasUserValueFlag=true)
 
void SetParameterUserValue (std::string paramKey, bool value)
 
void Stop ()
 
void UpdateParameters ()
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
virtual LightObject::Pointer CreateAnother () const override
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
virtual ModifiedTimeType GetMTime () const
 
virtual const std::string & GetObjectName () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
virtual void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual void SetReferenceCount (int) override
 
virtual void UnRegister () const noexceptoverride
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 

Protected Member Functions

void AddChoice (std::string paramKey, std::string paramName)
 
void AddParameter (ParameterType type, std::string paramKey, std::string paramName)
 
void AddProcess (itk::ProcessObject *object, std::string description)
 
void AddRAMParameter (std::string paramKey="ram")
 
void AddRAMParameter (std::string paramKey, std::string paramName, unsigned int defaultValue)
 
void AddRANDParameter (std::string paramKey="rand")
 
void AddRANDParameter (std::string paramKey, std::string paramName, unsigned int defaultValue)
 
 Application ()
 
void AutomaticValueOff (std::string paramKey)
 
void AutomaticValueOn (std::string paramKey)
 
void ClearChoices (std::string key)
 
template<class TImageType >
TImageType * GetParameterImage (std::string parameter)
 
std::vector< int > GetSelectedItems (std::string paramKey)
 
void MandatoryOff (std::string paramKey)
 
void MandatoryOn (std::string paramKey)
 
template<class TImageType >
void SetParameterOutputImage (std::string parameter, TImageType *value)
 
void SetParameterRole (std::string paramKey, Role role)
 
void SetParameterUserLevel (std::string paramKey, UserLevel level)
 
 ~Application () override
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void PrintSelf (std::ostream &os, Indent indent) const override
 
virtual void SetTimeStamp (const TimeStamp &time)
 
virtual ~Object ()
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

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
 
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
 

Additional Inherited Members

- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool flag)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 
- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount
 

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 81 of file otbWrapperApplication.h.

Member Typedef Documentation

Definition at line 88 of file otbWrapperApplication.h.

Definition at line 87 of file otbWrapperApplication.h.

Standard class typedefs.

Definition at line 85 of file otbWrapperApplication.h.

Definition at line 86 of file otbWrapperApplication.h.

Constructor & Destructor Documentation

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

Constructor

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

Destructor

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

Member Function Documentation

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

Add a new choice value to an existing choice parameter

void otb::Wrapper::Application::AddDocTag ( const std::string &  )
unsigned int otb::Wrapper::Application::AddExample ( const std::string &  comm = "")
void otb::Wrapper::Application::AddImageToParameterInputImageList ( std::string  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
void otb::Wrapper::Application::AddParameter ( ParameterType  type,
std::string  paramKey,
std::string  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::TrainImagesBase::InitClassification(), otb::Wrapper::TrainImagesBase::InitIO(), and otb::Wrapper::TrainImagesBase::InitSampling().

void otb::Wrapper::Application::AddParameterStringList ( std::string  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
void otb::Wrapper::Application::AddProcess ( itk::ProcessObject object,
std::string  description 
)
protected
void otb::Wrapper::Application::AddRAMParameter ( std::string  paramKey = "ram")
protected

Add a parameterRAM method with no parameter

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

Add a parameterRAM method with parameter

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

Add a parameterRAND method with no parameter

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

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

virtual void otb::Wrapper::Application::AfterExecuteAndWriteOutputs ( )
privatevirtual
void otb::Wrapper::Application::AutomaticValueOff ( std::string  paramKey)
protected

Declare a parameter as NOT having an automatic value

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

Declare a parameter as having an automatic value

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

Remove the items added to the ListWidget

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

Clear all images from an InputImageList parameter.

parameter The parameter key

Exceptions
itk::Exceptionif parameter is not found or not an InputImageList parameter
void otb::Wrapper::Application::ClearValue ( std::string  paramKey)
void otb::Wrapper::Application::DisableParameter ( std::string  paramKey)
virtual void otb::Wrapper::Application::DoExecute ( )
privatepure virtual
virtual void otb::Wrapper::Application::DoFreeRessources ( )
inlineprivatevirtual

Definition at line 861 of file otbWrapperApplication.h.

virtual void otb::Wrapper::Application::DoInit ( )
privatepure virtual
virtual void otb::Wrapper::Application::DoUpdateParameters ( )
privatepure virtual
void otb::Wrapper::Application::EnableParameter ( std::string  paramKey)
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

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

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.

std::vector<std::string> otb::Wrapper::Application::GetChoiceKeys ( std::string  paramKey)
std::vector<std::string> otb::Wrapper::Application::GetChoiceNames ( std::string  paramKey)
std::string otb::Wrapper::Application::GetCLExample ( )
float otb::Wrapper::Application::GetDefaultParameterFloat ( std::string  parameter)
int otb::Wrapper::Application::GetDefaultParameterInt ( std::string  parameter)
virtual const char* otb::Wrapper::Application::GetDescription ( ) const
virtual
virtual const char* otb::Wrapper::Application::GetDocAuthors ( ) const
virtual
DocExampleStructure::Pointer otb::Wrapper::Application::GetDocExample ( )
virtual const char* otb::Wrapper::Application::GetDocLimitations ( ) const
virtual
virtual const std::string& otb::Wrapper::Application::GetDocLink ( ) const
virtual
virtual const char* otb::Wrapper::Application::GetDocLongDescription ( ) const
virtual
virtual const char* otb::Wrapper::Application::GetDocSeeAlso ( ) const
virtual
virtual std::vector<std::string> otb::Wrapper::Application::GetDocTags ( ) const
virtual
std::string otb::Wrapper::Application::GetExampleComment ( unsigned int  id)
unsigned int otb::Wrapper::Application::GetExampleNumberOfParameters ( unsigned int  id)
std::string otb::Wrapper::Application::GetExampleParameterKey ( unsigned int  exId,
unsigned int  paramId 
)
std::string otb::Wrapper::Application::GetExampleParameterValue ( unsigned int  exId,
unsigned int  paramId 
)
std::string otb::Wrapper::Application::GetHtmlExample ( )
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 to access InputImageList.

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 to select the image in an InputImageList.

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

Returns a copy of the metadata dictionary of the image

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 to select the image in an InputImageList.

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.

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.

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 to select the image in an InputImageList. It should be assumed that the index of the largest possible region starts at (0,0).

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 to select the image in an InputImageList. It corresponds to the size of LargestPossibleRegion

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 to select the image in an InputImageList. We use the signed spacing convention.

double otb::Wrapper::Application::GetLastExecutionTiming ( ) const
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
otb::Logger* otb::Wrapper::Application::GetLogger ( ) const
virtual const char* otb::Wrapper::Application::GetName ( ) const
virtual
virtual const char* otb::Wrapper::Application::GetNameOfClass ( ) const
virtual
unsigned int otb::Wrapper::Application::GetNumberOfElementsInParameterInputImageList ( std::string  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
unsigned int otb::Wrapper::Application::GetNumberOfExamples ( )
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.

std::string otb::Wrapper::Application::GetParameterAsString ( std::string  paramKey)
Parameter* otb::Wrapper::Application::GetParameterByKey ( std::string  parameter,
bool  follow = true 
)
const Parameter* otb::Wrapper::Application::GetParameterByKey ( std::string  parameter,
bool  follow = true 
) const
ComplexDoubleImageType* otb::Wrapper::Application::GetParameterComplexDoubleImage ( std::string  )
ComplexDoubleVectorImageType* otb::Wrapper::Application::GetParameterComplexDoubleVectorImage ( std::string  )
ComplexFloatImageType* otb::Wrapper::Application::GetParameterComplexFloatImage ( std::string  )
ComplexFloatVectorImageType* otb::Wrapper::Application::GetParameterComplexFloatVectorImage ( std::string  )
ComplexInt16ImageType* otb::Wrapper::Application::GetParameterComplexInt16Image ( std::string  )
ComplexInt16VectorImageType* otb::Wrapper::Application::GetParameterComplexInt16VectorImage ( std::string  )
ComplexInt32ImageType* otb::Wrapper::Application::GetParameterComplexInt32Image ( std::string  )
ComplexInt32VectorImageType* otb::Wrapper::Application::GetParameterComplexInt32VectorImage ( std::string  )
std::string otb::Wrapper::Application::GetParameterDescription ( std::string  paramKey)
DoubleImageType* otb::Wrapper::Application::GetParameterDoubleImage ( std::string  )
DoubleVectorImageType* otb::Wrapper::Application::GetParameterDoubleVectorImage ( std::string  )
float otb::Wrapper::Application::GetParameterFloat ( std::string  parameter)
FloatImageType* otb::Wrapper::Application::GetParameterFloatImage ( std::string  )
FloatVectorImageType* otb::Wrapper::Application::GetParameterFloatVectorImage ( std::string  )
template OTBApplicationEngine_EXPORT_TEMPLATE ComplexDoubleImageType * otb::Wrapper::Application::GetParameterImage< ComplexDoubleImageType > ( std::string  parameter)
template<class TImageType >
TImageType * otb::Wrapper::Application::GetParameterImage ( std::string  parameter)
protected
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 to access InputImageList.

Works on parameters:

  • ParameterType_InputImage
  • ParameterType_InputImageList
  • ParameterType_OutputImage
FloatVectorImageListType* otb::Wrapper::Application::GetParameterImageList ( std::string  parameter)
int otb::Wrapper::Application::GetParameterInt ( std::string  parameter)
Int16ImageType* otb::Wrapper::Application::GetParameterInt16Image ( std::string  )
Int16VectorImageType* otb::Wrapper::Application::GetParameterInt16VectorImage ( std::string  )
Int32ImageType* otb::Wrapper::Application::GetParameterInt32Image ( std::string  )
Int32VectorImageType* otb::Wrapper::Application::GetParameterInt32VectorImage ( std::string  )
ParameterGroup* otb::Wrapper::Application::GetParameterList ( )
std::string otb::Wrapper::Application::GetParameterName ( std::string  paramKey)
ImageBaseType* otb::Wrapper::Application::GetParameterOutputImage ( std::string  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
ImagePixelType otb::Wrapper::Application::GetParameterOutputImagePixelType ( std::string  parameter)
Role otb::Wrapper::Application::GetParameterRole ( std::string  paramKey) const

Get the role of the parameter

std::vector<std::string> otb::Wrapper::Application::GetParametersKeys ( bool  recursive = true)
std::string otb::Wrapper::Application::GetParameterString ( std::string  parameter)
std::vector< std::string > otb::Wrapper::Application::GetParameterStringList ( const std::string &  parameter)
ParameterType otb::Wrapper::Application::GetParameterType ( std::string  paramKey) const
UInt16ImageType* otb::Wrapper::Application::GetParameterUInt16Image ( std::string  )
UInt16VectorImageType* otb::Wrapper::Application::GetParameterUInt16VectorImage ( std::string  )
UInt32ImageType* otb::Wrapper::Application::GetParameterUInt32Image ( std::string  )
UInt32VectorImageType* otb::Wrapper::Application::GetParameterUInt32VectorImage ( std::string  )
UInt8ImageType* otb::Wrapper::Application::GetParameterUInt8Image ( std::string  )
UInt8RGBAImageType* otb::Wrapper::Application::GetParameterUInt8RGBAImage ( std::string  )
UInt8RGBImageType* otb::Wrapper::Application::GetParameterUInt8RGBImage ( std::string  )
UInt8VectorImageType* otb::Wrapper::Application::GetParameterUInt8VectorImage ( std::string  )
UserLevel otb::Wrapper::Application::GetParameterUserLevel ( std::string  paramKey) const
VectorDataType* otb::Wrapper::Application::GetParameterVectorData ( std::string  parameter)
VectorDataListType* otb::Wrapper::Application::GetParameterVectorDataList ( std::string  parameter)
std::string otb::Wrapper::Application::GetProgressDescription ( ) const
itk::ProcessObject* otb::Wrapper::Application::GetProgressSource ( ) const
std::vector<int> otb::Wrapper::Application::GetSelectedItems ( std::string  paramKey)
protected

Get Items selected in the ListView Parameter

bool otb::Wrapper::Application::HasAutomaticValue ( std::string  paramKey) const
bool otb::Wrapper::Application::HasUserValue ( std::string  paramKey) const
bool otb::Wrapper::Application::HasValue ( std::string  paramKey) const
void otb::Wrapper::Application::Init ( )

Initialize the application, instantiating the parameter list

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

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

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

return wether the application has the "deprecated tag or not

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

Check if the application has been initialized

bool otb::Wrapper::Application::IsMandatory ( std::string  paramKey) const
bool otb::Wrapper::Application::IsParameterEnabled ( std::string  paramKey,
bool  recurseParents = false 
) const
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.
void otb::Wrapper::Application::LoadParametersFromXML ( const std::string &  filename)
void otb::Wrapper::Application::MandatoryOff ( std::string  paramKey)
protected

Declare a parameter as NOT mandatory (default state)

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

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

Declare a parameter as mandatory

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

void otb::Wrapper::Application::operator= ( const Application )
privatedelete
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 to select the image in an InputImageList

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.

void otb::Wrapper::Application::SaveParametersToXML ( const std::string &  filename)
void otb::Wrapper::Application::SetDefaultOutputComplexPixelType ( std::string  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
void otb::Wrapper::Application::SetDefaultOutputPixelType ( std::string  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
void otb::Wrapper::Application::SetDefaultParameterFloat ( std::string  parameter,
float  value 
)
void otb::Wrapper::Application::SetDefaultParameterInt ( std::string  parameter,
int  value 
)
void otb::Wrapper::Application::SetDescription ( const std::string &  )
virtual void otb::Wrapper::Application::SetDocAuthors ( const std::string &  )
virtual
void otb::Wrapper::Application::SetDocExampleParameterValue ( const std::string  key,
const std::string  value,
unsigned int  exId = 0 
)
virtual void otb::Wrapper::Application::SetDocLimitations ( const std::string &  )
virtual
virtual void otb::Wrapper::Application::SetDocLink ( const std::string &  link)
virtual
virtual void otb::Wrapper::Application::SetDocLongDescription ( const std::string &  )
virtual
virtual void otb::Wrapper::Application::SetDocSeeAlso ( const std::string &  )
virtual
virtual void otb::Wrapper::Application::SetDocTags ( std::vector< std::string >  )
virtual
void otb::Wrapper::Application::SetExampleComment ( const std::string &  comm,
unsigned int  i 
)
void otb::Wrapper::Application::SetListViewSingleSelectionMode ( std::string  parameter,
bool  status 
)

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

Can be called for types:

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

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

void otb::Wrapper::Application::SetMaximumParameterFloatValue ( std::string  parameter,
float  value 
)
void otb::Wrapper::Application::SetMaximumParameterIntValue ( std::string  parameter,
int  value 
)
void otb::Wrapper::Application::SetMinimumParameterFloatValue ( std::string  parameter,
float  value 
)
void otb::Wrapper::Application::SetMinimumParameterIntValue ( std::string  parameter,
int  value 
)
virtual void otb::Wrapper::Application::SetName ( const std::string &  )
virtual
void otb::Wrapper::Application::SetNthParameterInputImageList ( std::string  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
void otb::Wrapper::Application::SetNthParameterStringList ( std::string  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
void otb::Wrapper::Application::SetOfficialDocLink ( )
void otb::Wrapper::Application::SetParameterDescription ( std::string  paramKey,
std::string  dec 
)
void otb::Wrapper::Application::SetParameterFloat ( std::string  parameter,
float  value,
bool  hasUserValueFlag = true 
)
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 to access InputImageList.

Works on parameters:

  • ParameterType_InputImage
  • ParameterType_InputImageList
void otb::Wrapper::Application::SetParameterInputImage ( std::string  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().

void otb::Wrapper::Application::SetParameterInt ( std::string  parameter,
int  value,
bool  hasUserValueFlag = true 
)
void otb::Wrapper::Application::SetParameterList ( ParameterGroup::Pointer  paramGroup)
inline

Definition at line 632 of file otbWrapperApplication.h.

template OTBApplicationEngine_EXPORT_TEMPLATE void otb::Wrapper::Application::SetParameterOutputImage< FloatVectorImageType > ( std::string  parameter,
FloatVectorImageType value 
)
template<class TImageType >
void otb::Wrapper::Application::SetParameterOutputImage ( std::string  parameter,
TImageType *  value 
)
protected
void otb::Wrapper::Application::SetParameterOutputImagePixelType ( std::string  parameter,
ImagePixelType  pixelType 
)
void otb::Wrapper::Application::SetParameterOutputVectorData ( std::string  parameter,
VectorDataType value 
)
void otb::Wrapper::Application::SetParameterRole ( std::string  paramKey,
Role  role 
)
protected
void otb::Wrapper::Application::SetParameterString ( std::string  parameter,
std::string  value,
bool  hasUserValueFlag = true 
)
void otb::Wrapper::Application::SetParameterStringList ( std::string  parameter,
std::vector< std::string >  values,
bool  hasUserValueFlag = true 
)
void otb::Wrapper::Application::SetParameterUserLevel ( std::string  paramKey,
UserLevel  level 
)
protected
void otb::Wrapper::Application::SetParameterUserValue ( std::string  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.

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

Request the application to stop its processing

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

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

Friends And Related Function Documentation

friend class ElevationParametersHandler
friend

Definition at line 911 of file otbWrapperApplication.h.

friend class MapProjectionParametersHandler
friend

Declare the class

Definition at line 910 of file otbWrapperApplication.h.

Member Data Documentation

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

Chrono to measure execution time

Definition at line 898 of file otbWrapperApplication.h.

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

Definition at line 867 of file otbWrapperApplication.h.

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

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

Definition at line 883 of file otbWrapperApplication.h.

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

Doc example structure. Use GetDocExample() to access it

Definition at line 880 of file otbWrapperApplication.h.

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

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

Definition at line 886 of file otbWrapperApplication.h.

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

Doc link application

Definition at line 895 of file otbWrapperApplication.h.

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

Long and precise application description .

Definition at line 877 of file otbWrapperApplication.h.

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

Related applications

Definition at line 889 of file otbWrapperApplication.h.

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

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

Definition at line 892 of file otbWrapperApplication.h.

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

Definition at line 874 of file otbWrapperApplication.h.

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

Flag is true when executing DoInit, DoUpdateParameters or DoExecute

Definition at line 901 of file otbWrapperApplication.h.

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

Definition at line 869 of file otbWrapperApplication.h.

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

Definition at line 866 of file otbWrapperApplication.h.

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

Definition at line 868 of file otbWrapperApplication.h.

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

Definition at line 871 of file otbWrapperApplication.h.

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

Definition at line 872 of file otbWrapperApplication.h.


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