OTB  9.0.0
Orfeo Toolbox
Classes | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
otb::Wrapper::CompositeApplication Class Reference

#include <otbWrapperCompositeApplication.h>

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

Classes

struct  InternalApplication
 

Public Types

typedef itk::MemberCommand< SelfAddProcessCommandType
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef std::map< std::string, InternalApplicationInternalAppContainer
 
typedef itk::SmartPointer< SelfPointer
 
typedef CompositeApplication Self
 
typedef Application Superclass
 
- Public Types inherited from otb::Wrapper::Application
typedef itk::SmartPointer< const SelfConstPointer
 
typedef itk::SmartPointer< SelfPointer
 
typedef Application Self
 
typedef itk::Object Superclass
 

Public Member Functions

virtual const char * GetNameOfClass () const
 
- Public Member Functions inherited from otb::Wrapper::Application
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 ()
 
std::vector< std::string > GetChoiceKeys (std::string const &paramKey)
 
std::vector< std::string > GetChoiceNames (std::string const &paramKey)
 
std::string GetCLExample ()
 
double GetDefaultParameterDouble (std::string const &parameter)
 
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 ()
 
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
 
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)
 
double GetParameterDouble (std::string const &parameter) const
 
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)
 
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
 
const FieldParameter::TypeFilterTypeGetTypeFilter (std::string const &key) 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 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 SaveParametersToXML (const std::string &filename)
 
void SetDefaultOutputComplexPixelType (std::string const &parameter, ComplexImagePixelType type)
 
void SetDefaultOutputPixelType (std::string const &parameter, ImagePixelType type)
 
void SetDefaultParameterDouble (std::string const &parameter, double value)
 
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 SetMaximumParameterDoubleValue (std::string const &parameter, double value)
 
void SetMaximumParameterFloatValue (std::string const &parameter, float value)
 
void SetMaximumParameterIntValue (std::string const &parameter, int value)
 
void SetMinimumParameterDoubleValue (std::string const &parameter, double 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 SetParameterDouble (std::string const &parameter, double value, bool hasUserValueFlag=true)
 
void SetParameterFloat (std::string const &parameter, float value, bool hasUserValueFlag=true)
 
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 SetRasterData (std::string const &key, std::string const &rasterData)
 
void SetTypeFilter (std::string const &key, FieldParameter::TypeFilterType const &typeFilter)
 
void SetVectorData (std::string const &key, std::string const &vectorData)
 
void Stop ()
 
void UpdateParameters ()
 
void WriteOutput ()
 
ImageMetadataGetImageMetadata (const std::string &key, unsigned int idx=0)
 
void SetImageMetadata (const ImageMetadata &imd, const std::string &key, unsigned int idx=0)
 
itk::MetaDataDictionary GetMetadataDictionary (const std::string &key, unsigned int idx=0)
 
ImagePixelType GetImageBasePixelType (const std::string &key, unsigned int idx=0)
 
ImageBaseTypeGetParameterImageBase (const std::string &key, unsigned int idx=0)
 
void SetParameterImageBase (const std::string &key, ImageBaseType *img, unsigned int idx=0)
 
void RegisterPipeline ()
 
void FreeRessources ()
 
bool IsExecuteDone ()
 
bool IsMultiWritingEnabled ()
 

Protected Member Functions

bool AddApplication (std::string appType, std::string key, std::string desc)
 
void ClearApplications ()
 
 CompositeApplication ()
 
bool Connect (std::string fromKey, std::string toKey)
 
ApplicationDecodeKey (std::string &key)
 
void ExecuteInternal (std::string key)
 
std::string GetInternalAppDescription (std::string id)
 
ApplicationGetInternalApplication (std::string id)
 
void LinkWatchers (itk::Object *, const itk::EventObject &event)
 
bool ShareParameter (std::string localKey, std::string internalKey, std::string name=std::string(), std::string desc=std::string())
 
void UpdateInternalParameters (std::string key)
 
 ~CompositeApplication () override
 
- Protected Member Functions inherited from otb::Wrapper::Application
 Application ()
 
 ~Application () override
 
void AddProcess (itk::ProcessObject *object, std::string description)
 
void AddChoice (std::string const &paramKey, std::string const &paramName)
 
void AddParameter (ParameterType type, std::string const &paramKey, std::string const &paramName)
 
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)
 
void ClearChoices (std::string const &key)
 
std::vector< int > GetSelectedItems (std::string const &paramKey)
 
void MandatoryOn (std::string const &paramKey)
 
void MandatoryOff (std::string const &paramKey)
 
void SetParameterUserLevel (std::string const &paramKey, UserLevel level)
 
void SetParameterRole (std::string const &paramKey, Role role)
 
template<class TImageType >
TImageType * GetParameterImage (std::string const &parameter)
 
void AutomaticValueOn (std::string const &paramKey)
 
void AutomaticValueOff (std::string const &paramKey)
 
template<class TImageType >
void SetParameterOutputImage (std::string const &parameter, TImageType *value)
 
virtual void SetMultiWriting (bool _arg)
 
void EnableInPrivateDo ()
 
void DisableInPrivateDo ()
 

Private Member Functions

 CompositeApplication (const CompositeApplication &)=delete
 
void operator= (const CompositeApplication &)=delete
 

Private Attributes

AddProcessCommandType::Pointer m_AddProcessCommand
 
InternalAppContainer m_AppContainer
 

Detailed Description

This class is a base class for composite applications.

This class allows creating & storing internal applications with the same logic as parameters. You choose the application type to create, you choose an identifier (alphanumeric string), and you can give a short description. Later, you will refer to this application using the identifier. In the functions of this class, you can refer to parameters from internal applications by using their identifier as prefix. For instance, "app1.in" will refer to parameter "in" from internal application named "app1" (if such application exists, if not it will refer to a parameter of this composite application).

Definition at line 48 of file otbWrapperCompositeApplication.h.

Member Typedef Documentation

◆ AddProcessCommandType

Filters typedef

Definition at line 58 of file otbWrapperCompositeApplication.h.

◆ ConstPointer

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

Definition at line 55 of file otbWrapperCompositeApplication.h.

◆ InternalAppContainer

Definition at line 69 of file otbWrapperCompositeApplication.h.

◆ Pointer

Definition at line 54 of file otbWrapperCompositeApplication.h.

◆ Self

Standard class typedefs.

Definition at line 52 of file otbWrapperCompositeApplication.h.

◆ Superclass

Definition at line 53 of file otbWrapperCompositeApplication.h.

Constructor & Destructor Documentation

◆ CompositeApplication() [1/2]

otb::Wrapper::CompositeApplication::CompositeApplication ( )
protected

Constructor

◆ ~CompositeApplication()

otb::Wrapper::CompositeApplication::~CompositeApplication ( )
overrideprotected

Destructor

◆ CompositeApplication() [2/2]

otb::Wrapper::CompositeApplication::CompositeApplication ( const CompositeApplication )
privatedelete

Member Function Documentation

◆ AddApplication()

bool otb::Wrapper::CompositeApplication::AddApplication ( std::string  appType,
std::string  key,
std::string  desc 
)
protected

Method to instantiate and register a new internal application

Parameters
appTypeType of the application to instantiate
keyIdentifier associated to the created application
descDescription of the internal application

Referenced by otb::Wrapper::TrainImagesBase::InitClassification(), and otb::Wrapper::TrainImagesBase::InitSampling().

◆ ClearApplications()

void otb::Wrapper::CompositeApplication::ClearApplications ( )
protected

Method to remove all internal applications. Application deriving from CompositeApplication should call this method at the beginning of their DoInit().

◆ Connect()

bool otb::Wrapper::CompositeApplication::Connect ( std::string  fromKey,
std::string  toKey 
)
protected

Connect two existing parameters together. The first parameter will point to the second parameter.

Referenced by otb::Wrapper::TrainImagesBase::ConnectClassificationParams(), and otb::Wrapper::TrainImagesBase::ConnectSamplingParameters().

◆ DecodeKey()

Application* otb::Wrapper::CompositeApplication::DecodeKey ( std::string &  key)
protected

Decode a key to extract potential prefix for internal applications If a valid prefix (corresponding to an internal app) is found:

  • prefix is removed from the input key which is altered.
  • the function returns a pointer to the internal application If no valid prefix is found, the input key is not modified, and the function returns 'this'.

◆ ExecuteInternal()

void otb::Wrapper::CompositeApplication::ExecuteInternal ( std::string  key)
protected

◆ GetInternalAppDescription()

std::string otb::Wrapper::CompositeApplication::GetInternalAppDescription ( std::string  id)
protected

Get the description of an internal application

◆ GetInternalApplication()

Application* otb::Wrapper::CompositeApplication::GetInternalApplication ( std::string  id)
protected

◆ GetNameOfClass()

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

RTTI support

Reimplemented from otb::Wrapper::Application.

Reimplemented in otb::Wrapper::TrainImagesBase.

◆ LinkWatchers()

void otb::Wrapper::CompositeApplication::LinkWatchers ( itk::Object *  ,
const itk::EventObject &  event 
)
protected

Callback function to retrieve the process watchers on internal filters

◆ operator=()

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

◆ ShareParameter()

bool otb::Wrapper::CompositeApplication::ShareParameter ( std::string  localKey,
std::string  internalKey,
std::string  name = std::string(),
std::string  desc = std::string() 
)
protected

Share a parameter between the composite application and an internal application The local parameter is created as a proxy to the internal parameter.

Parameters
localKeyNew parameter key in the composite application
internalKeyKey to the internal parameter to expose
nameName for the local parameter, if empty the target's name is used
descDescription for the local parameter, if empty the target's description is used

Referenced by otb::Wrapper::TrainImagesBase::ShareClassificationParams(), and otb::Wrapper::TrainImagesBase::ShareSamplingParameters().

◆ UpdateInternalParameters()

void otb::Wrapper::CompositeApplication::UpdateInternalParameters ( std::string  key)
protected

Member Data Documentation

◆ m_AddProcessCommand

AddProcessCommandType::Pointer otb::Wrapper::CompositeApplication::m_AddProcessCommand
private

Definition at line 150 of file otbWrapperCompositeApplication.h.

◆ m_AppContainer

InternalAppContainer otb::Wrapper::CompositeApplication::m_AppContainer
private

Definition at line 148 of file otbWrapperCompositeApplication.h.


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