diff --git a/Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h b/Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h index bb4ce4f4df3bcc6ddbfb937d30e0ab2981255162..26c389002dc32713c481a6fd5fc6728f57a83d73 100644 --- a/Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h +++ b/Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h @@ -484,27 +484,31 @@ public: void SetNthParameterInputImageList(std::string parameter, const unsigned int &id, InputImageListParameter::ImageBaseType * img); /** - * Add an image to an InputImageList parameter as a filename string - * pointer instead of reading from file. Useful to connect pipelines - * between different application instances. + * Add a value to a parameter list as a string + * + * Can be called for parameter types: + * \li ParameterType_InputImageList + * * \in parameter The parameter key - * \in img The image path + * \in str The string * \throw itk::Exception if parameter is not found or not an * InputImageList parameter */ - void AddImageToParameterInputImageList(std::string parameter, const std::string & filename); + void AddParameterStringList(std::string parameter, const std::string & str); /** - * Set the nth image of an InputImageList parameter as a filename string - * instead of reading from file. Useful to connect pipelines - * between different application instances. + * Set the nth value of a parameter list as a string. + * + * Can be called for parameter types: + * \li ParameterType_InputImageList + * * \in parameter The parameter key * \in id Position at which to set the ImageBase pointer - * \in img The image path + * \in str The string * \throw itk::Exception if parameter is not found or not an * InputImageList parameter or if id is out of bounds */ - void SetNthParameterInputImageList(std::string parameter, const unsigned int &id, const std::string& filename); + void SetNthParameterStringList(std::string parameter, const unsigned int &id, const std::string& str); /** diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx index 17d0de74f583f8d345da4abf0dcbbea46b4349bf..cf17ba6fc9b2d0856d0d69e5350740b0803a83dc 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx @@ -1263,7 +1263,7 @@ void Application::SetNthParameterInputImageList(std::string parameter, const uns } -void Application::AddImageToParameterInputImageList(std::string parameter, const std::string & filename) +void Application::AddParameterStringList(std::string parameter, const std::string & str) { Parameter* param = GetParameterByKey(parameter); @@ -1271,7 +1271,7 @@ void Application::AddImageToParameterInputImageList(std::string parameter, const if(paramDown) { - paramDown->AddFromFileName(filename); + paramDown->AddFromFileName(str); } else { @@ -1280,7 +1280,7 @@ void Application::AddImageToParameterInputImageList(std::string parameter, const } -void Application::SetNthParameterInputImageList(std::string parameter, const unsigned int &id, const std::string & filename) +void Application::SetNthParameterStringList(std::string parameter, const unsigned int &id, const std::string & str) { Parameter* param = GetParameterByKey(parameter); @@ -1288,7 +1288,7 @@ void Application::SetNthParameterInputImageList(std::string parameter, const uns if(paramDown) { - paramDown->SetNthFileName(id,filename); + paramDown->SetNthFileName(id,str); } else { diff --git a/Modules/Wrappers/ApplicationEngine/test/otbApplicationMemoryConnectTest.cxx b/Modules/Wrappers/ApplicationEngine/test/otbApplicationMemoryConnectTest.cxx index 0faedceb028c6781fb9727cc7cc583de884f1050..b9d92f8d265f873ef87b6ef0e038ab6119b513df 100644 --- a/Modules/Wrappers/ApplicationEngine/test/otbApplicationMemoryConnectTest.cxx +++ b/Modules/Wrappers/ApplicationEngine/test/otbApplicationMemoryConnectTest.cxx @@ -64,7 +64,7 @@ int otbApplicationMemoryConnectTest(int argc, char * argv[]) app4->AddImageToParameterInputImageList("il",app2->GetParameterOutputImage("out")); app4->AddImageToParameterInputImageList("il",app3->GetParameterOutputImage("out")); - app4->AddImageToParameterInputImageList("il",infname); + app4->AddParameterStringList("il",infname); app4->ExecuteAndWriteOutput(); diff --git a/Modules/Wrappers/SWIG/src/otbApplication.i b/Modules/Wrappers/SWIG/src/otbApplication.i index 32a91a90f72df1059a4ffda18695132462c2f36c..aa93633ba359170270f853d5b4973c7cfa54de1e 100644 --- a/Modules/Wrappers/SWIG/src/otbApplication.i +++ b/Modules/Wrappers/SWIG/src/otbApplication.i @@ -209,9 +209,9 @@ public: ComplexInputImageParameter::ImageBaseType * GetParameterComplexOutputImage(std::string parameter); void SetParameterComplexInputImage(std::string parameter, ComplexInputImageParameter::ImageBaseType * inputImage); void AddImageToParameterInputImageList(std::string parameter,InputImageParameter::ImageBaseType * img); - void AddImageToParameterInputImageList(std::string parameter,const std::string & filename); + void AddParameterStringList(std::string parameter,const std::string & str); void SetNthParameterInputImageList(std::string parameter, const unsigned int &id, InputImageParameter::ImageBaseType * img); - void SetNthParameterInputImageList(std::string parameter, const unsigned int &id, const std::string& filename); + void SetNthParameterStringList(std::string parameter, const unsigned int &id, const std::string& str); void ClearParameterInputImageList(std::string parameter); unsigned int GetNumberOfElementsInParameterInputImageList(std::string parameter); diff --git a/Modules/Wrappers/SWIG/test/python/PythonConnectApplications.py b/Modules/Wrappers/SWIG/test/python/PythonConnectApplications.py index d14bbaff354bfaa535025751e34f3ae2c774d6a1..30a0be351910636d28e5969d050e0df2c3548bd6 100644 --- a/Modules/Wrappers/SWIG/test/python/PythonConnectApplications.py +++ b/Modules/Wrappers/SWIG/test/python/PythonConnectApplications.py @@ -21,7 +21,7 @@ def test(otb, argv): app4.AddImageToParameterInputImageList("il",app2.GetParameterOutputImage("out")); app4.AddImageToParameterInputImageList("il",app3.GetParameterOutputImage("out")); - app4.AddImageToParameterInputImageList("il",argv[1]) + app4.AddParameterStringList("il",argv[1]) app4.OUT = argv[2] app4.ExecuteAndWriteOutput()