Commit 58909492 authored by Antoine Regimbeau's avatar Antoine Regimbeau
Browse files

TEST : hack commandline to rerun application through cli

No related merge requests found
Showing with 55 additions and 1 deletion
+55 -1
...@@ -64,11 +64,12 @@ private: ...@@ -64,11 +64,12 @@ private:
AddParameter(ParameterType_InputImage, "in", "Input image"); AddParameter(ParameterType_InputImage, "in", "Input image");
SetParameterDescription("in", "Input image"); SetParameterDescription("in", "Input image");
SetParameterString("in", "/home/antoine/dev/my_data/anaglyphInput2.tif");
AddParameter(ParameterType_OutputImage, "out", "Output Image"); AddParameter(ParameterType_OutputImage, "out", "Output Image");
SetParameterDescription("out", "Output image"); SetParameterDescription("out", "Output image");
SetDefaultOutputPixelType("out",ImagePixelType_uint8); SetDefaultOutputPixelType("out",ImagePixelType_uint8);
SetParameterString("out", "/home/antoine/dev/my_data/anaglyphtestInput2.tif");
AddRAMParameter(); AddRAMParameter();
...@@ -85,18 +86,26 @@ private: ...@@ -85,18 +86,26 @@ private:
void DoExecute() ITK_OVERRIDE void DoExecute() ITK_OVERRIDE
{ {
#ifdef MEM_DEBUG
std::cout<<"Debug on input "<<std::endl; std::cout<<"Debug on input "<<std::endl;
GetParameterImage("in")->DebugOn(); GetParameterImage("in")->DebugOn();
#endif
ExtractROIFilterType::Pointer extractor = ExtractROIFilterType::New(); ExtractROIFilterType::Pointer extractor = ExtractROIFilterType::New();
#ifdef MEM_DEBUG
extractor->DebugOn(); extractor->DebugOn();
#endif
m_Filters.push_back(extractor.GetPointer()); m_Filters.push_back(extractor.GetPointer());
#ifdef MEM_DEBUG
std::cout<<"Debug on extractor "<<std::endl; std::cout<<"Debug on extractor "<<std::endl;
extractor->DebugOn(); extractor->DebugOn();
#endif
extractor->SetInput(GetParameterImage("in")); extractor->SetInput(GetParameterImage("in"));
extractor->SetChannel(1); extractor->SetChannel(1);
extractor->UpdateOutputInformation(); extractor->UpdateOutputInformation();
#ifdef MEM_DEBUG
std::cout<<"Debug on extractor's output "<<std::endl; std::cout<<"Debug on extractor's output "<<std::endl;
extractor->GetOutput()->DebugOn(); extractor->GetOutput()->DebugOn();
#endif
SetParameterOutputImage("out" , extractor->GetOutput() ); SetParameterOutputImage("out" , extractor->GetOutput() );
} }
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "otbWrapperCommandLineLauncher.h" #include "otbWrapperCommandLineLauncher.h"
#include "otb_tinyxml.h" #include "otb_tinyxml.h"
#include <vector> #include <vector>
#include <iostream>
#ifdef OTB_USE_MPI #ifdef OTB_USE_MPI
#include "otbMPIConfig.h" #include "otbMPIConfig.h"
...@@ -304,9 +305,53 @@ int main(int argc, char* argv[]) ...@@ -304,9 +305,53 @@ int main(int argc, char* argv[])
ShowUsage(argv); ShowUsage(argv);
return false; return false;
} }
goto RUN;
RUN :
for (auto i : vexp)
std::cout<<i<<" ";
std::cout<<std::endl;
bool success = launcher->Load(vexp) && launcher->ExecuteAndWriteOutput(); bool success = launcher->Load(vexp) && launcher->ExecuteAndWriteOutput();
std::string answer;
std::cout<<"Rerun or run with other args? r : rerun ; s : small test ; b : big test ; else quit "<<std::endl;
std::cin >> answer;
if ( answer[0]=='r')
{
std::cout<<"again"<<std::endl;
goto RUN;
}
else if ( answer[0]=='s' )
{
std::cout<<"Small test running"<<std::endl;
vexp[2] = "/home/antoine/dev/my_data/anaglyphInput2.tif";
vexp[4] = "/home/antoine/dev/my_data/anaglyphOut.tif";
goto RUN;
}
else if ( answer[0]=='b' )
{
std::cout<<"Big test running"<<std::endl;
vexp[2] = "/home/antoine/dev/my_data/bigbigtestclassic.tif";
vexp[4] = "/home/antoine/dev/my_data/bigbigtestclasssic.tif";
goto RUN;
}
// else
// {
// vexp.clear();
// for (int i = 1; i < argc; i++)
// {
// std::string strarg(answer[i]);
// std::string cleanArg = CleanWord(strarg);
// if (cleanArg.empty())
// {
// // Empty argument !
// continue;
// }
// vexp.push_back(cleanArg);
// }
// goto RUN;
// }
// shutdown MPI after application finished // shutdown MPI after application finished
#ifdef OTB_USE_MPI #ifdef OTB_USE_MPI
otb::MPIConfig::Instance()->terminate(); otb::MPIConfig::Instance()->terminate();
......
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