Commit 66fc64ed authored by Otmane Lahlou's avatar Otmane Lahlou
Browse files

STYLE

No related merge requests found
Showing with 44 additions and 31 deletions
+44 -31
...@@ -192,4 +192,3 @@ OutputImageParameter::HasValue() const ...@@ -192,4 +192,3 @@ OutputImageParameter::HasValue() const
} }
} }
...@@ -34,7 +34,7 @@ class ITK_EXPORT OutputImageParameter : public Parameter ...@@ -34,7 +34,7 @@ class ITK_EXPORT OutputImageParameter : public Parameter
{ {
public: public:
/** Standard class typedef */ /** Standard class typedef */
typedef OutputImageParameter Self; typedef OutputImageParameter Self;
typedef Parameter Superclass; typedef Parameter Superclass;
typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer; typedef itk::SmartPointer<const Self> ConstPointer;
...@@ -89,8 +89,8 @@ protected: ...@@ -89,8 +89,8 @@ protected:
virtual ~OutputImageParameter(); virtual ~OutputImageParameter();
FloatVectorImageType::Pointer m_Image; FloatVectorImageType::Pointer m_Image;
std::string m_FileName; std::string m_FileName;
ImagePixelType m_PixelType; ImagePixelType m_PixelType;
typedef otb::StreamingImageFileWriter<Int8VectorImageType> Int8WriterType; typedef otb::StreamingImageFileWriter<Int8VectorImageType> Int8WriterType;
typedef otb::StreamingImageFileWriter<UInt8VectorImageType> UInt8WriterType; typedef otb::StreamingImageFileWriter<UInt8VectorImageType> UInt8WriterType;
......
...@@ -116,7 +116,9 @@ CommandLineLauncher::Load() ...@@ -116,7 +116,9 @@ CommandLineLauncher::Load()
{ {
if( this->LoadPath() == false ) if( this->LoadPath() == false )
{ {
std::cerr << "ERROR: At least one specifed path within \""<< m_Parser->GetAttributAsString(m_Parser->GetModulePathKey(), m_Expression)<<"\" is invalid or doesn't exist..." <<std::endl; std::cerr << "ERROR: At least one specifed path within \""
<< m_Parser->GetAttributAsString(m_Parser->GetModulePathKey(), m_Expression)
<<"\" is invalid or doesn't exist..." <<std::endl;
return false; return false;
} }
} }
...@@ -415,9 +417,12 @@ CommandLineLauncher::LoadParameters() ...@@ -415,9 +417,12 @@ CommandLineLauncher::LoadParameters()
} }
// Single value parameter // Single value parameter
if( type == ParameterType_Choice || type == ParameterType_Float || type == ParameterType_Int || type == ParameterType_Radius if( type == ParameterType_Choice || type == ParameterType_Float
|| type == ParameterType_Directory || type == ParameterType_String || type == ParameterType_Filename || type == ParameterType_InputComplexImage || type == ParameterType_Int || type == ParameterType_Radius
|| type == ParameterType_InputImage || type == ParameterType_InputVectorData || type == ParameterType_OutputVectorData ) || type == ParameterType_Directory || type == ParameterType_String
|| type == ParameterType_Filename || type == ParameterType_InputComplexImage
|| type == ParameterType_InputImage || type == ParameterType_InputVectorData
|| type == ParameterType_OutputVectorData )
{ {
m_Application->SetParameterString( paramKey, values[0] ); m_Application->SetParameterString( paramKey, values[0] );
} }
...@@ -636,11 +641,15 @@ CommandLineLauncher::DisplayParameterHelp( const Parameter::Pointer & param, con ...@@ -636,11 +641,15 @@ CommandLineLauncher::DisplayParameterHelp( const Parameter::Pointer & param, con
// In the case choice, don't show the enum type. // In the case choice, don't show the enum type.
if( type == ParameterType_Choice ) if( type == ParameterType_Choice )
{ {
oss << "\t Default value: "<< m_Application->GetChoiceKeys(paramKey)[m_Application->GetParameterInt( paramKey )]<< std::endl; oss << "\t Default value: "
<< m_Application->GetChoiceKeys(paramKey)[m_Application->GetParameterInt( paramKey )]
<< std::endl;
} }
else if( type == ParameterType_OutputImage ) else if( type == ParameterType_OutputImage )
{ {
oss << "\t Default value: filename: "<< m_Application->GetParameterAsString( paramKey )<< std::endl; oss << "\t Default value: filename: "
<< m_Application->GetParameterAsString( paramKey )
<< std::endl;
oss << "\t pixel type: float"<< std::endl; oss << "\t pixel type: float"<< std::endl;
} }
else else
...@@ -748,4 +757,3 @@ CommandLineLauncher::CheckKeyValidity() ...@@ -748,4 +757,3 @@ CommandLineLauncher::CheckKeyValidity()
} }
} }
...@@ -42,9 +42,13 @@ namespace Wrapper ...@@ -42,9 +42,13 @@ namespace Wrapper
* \brief This class check the validity of a command line application. * \brief This class check the validity of a command line application.
* *
* To be valid, the expression must be as follow: * To be valid, the expression must be as follow:
* ModuleName --attribut1_Key attrubut1_Value --attribut2_Key attrubut2_Value * ModuleName --attribut1_Key attribut1_Value --attribut2_Key
* After the attribut key, if the user give several values (expression without \"--\" separated by space), it will automacally be interpreted as a list. * attribut2_Value
* The module name can be set as the first element of the expression or in the expression with the key --moduleName. * After the attribut key, if the user give several values (expression
* without \"--\" separated by space), it will automacally be
* interpreted as a list.
* The module name can be set as the first element of the expression
* or in the expression with the key --moduleName.
* The exe path have to be set in with the option --modulePath. * The exe path have to be set in with the option --modulePath.
*/ */
...@@ -52,9 +56,9 @@ class ITK_EXPORT CommandLineLauncher : public itk::Object ...@@ -52,9 +56,9 @@ class ITK_EXPORT CommandLineLauncher : public itk::Object
{ {
public: public:
/** Standard class typedefs. */ /** Standard class typedefs. */
typedef CommandLineLauncher Self; typedef CommandLineLauncher Self;
typedef itk::Object Superclass; typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer; typedef itk::SmartPointer<const Self> ConstPointer;
/** Defining ::New() static method */ /** Defining ::New() static method */
...@@ -65,8 +69,10 @@ public: ...@@ -65,8 +69,10 @@ public:
/** Parse result enum */ /** Parse result enum */
typedef CommandLineParser::ParseResultType ParseResultType; typedef CommandLineParser::ParseResultType ParseResultType;
typedef enum { OKPARAM, MISSINGMANDATORYPARAMETER, MISSINGPARAMETERVALUE, WRONGPARAMETERVALUE, INVALIDNUMBEROFVALUE, DEFAULT} ParamResultType; typedef enum { OKPARAM, MISSINGMANDATORYPARAMETER,
MISSINGPARAMETERVALUE, WRONGPARAMETERVALUE,
INVALIDNUMBEROFVALUE, DEFAULT} ParamResultType;
/** Filter watcher list type */ /** Filter watcher list type */
typedef std::vector<StandardOneLineFilterWatcher *> WatcherListType; typedef std::vector<StandardOneLineFilterWatcher *> WatcherListType;
...@@ -83,12 +89,14 @@ public: ...@@ -83,12 +89,14 @@ public:
bool Load( const std::string & exp ); bool Load( const std::string & exp );
/** Launch the process, using the Execute application method /** Launch the process, using the Execute application method
* The method will check if the user asked for help (looking at --help key) before loading parameter and launching process. * The method will check if the user asked for help (looking at
--help key) before loading parameter and launching process.
**/ **/
bool Execute(); bool Execute();
/** Launch the process, using the ExecuteAndWriteOutput application method /** Launch the process, using the ExecuteAndWriteOutput application method
* The method will check if the user asked for help (looking at --help key) before loading parameter and launching process. * The method will check if the user asked for help (looking at
--help key) before loading parameter and launching process.
*/ */
bool ExecuteAndWriteOutput(); bool ExecuteAndWriteOutput();
...@@ -139,20 +147,18 @@ private: ...@@ -139,20 +147,18 @@ private:
CommandLineLauncher(const CommandLineLauncher &); //purposely not implemented CommandLineLauncher(const CommandLineLauncher &); //purposely not implemented
void operator =(const CommandLineLauncher&); //purposely not implemented void operator =(const CommandLineLauncher&); //purposely not implemented
std::string m_Path; std::string m_Path;
Application::Pointer m_Application;
std::string m_Expression;
CommandLineParser::Pointer m_Parser;
WatcherListType m_WatcherList;
itk::StdStreamLogOutput::Pointer m_LogOutput; Application::Pointer m_Application;
std::string m_Expression;
CommandLineParser::Pointer m_Parser;
AddProcessCommandType::Pointer m_AddProcessCommand; WatcherListType m_WatcherList;
bool m_ReportProgress; itk::StdStreamLogOutput::Pointer m_LogOutput;
AddProcessCommandType::Pointer m_AddProcessCommand;
bool m_ReportProgress;
}; //end class }; //end class
} // end namespace Wrapper } // end namespace Wrapper
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment