Skip to content
Snippets Groups Projects
Commit c0944562 authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

BUG: fix output parameter usage

parent f3f25d6e
No related branches found
No related tags found
No related merge requests found
...@@ -146,11 +146,9 @@ private: ...@@ -146,11 +146,9 @@ private:
SetDocExampleParameterValue("spatialr", "4"); SetDocExampleParameterValue("spatialr", "4");
SetDocExampleParameterValue("ranger", "80"); SetDocExampleParameterValue("ranger", "80");
SetDocExampleParameterValue("minsize", "16"); SetDocExampleParameterValue("minsize", "16");
SetDocExampleParameterValue("out", "regions.shp"); SetDocExampleParameterValue("mode.vector.out", "regions.shp");
SetOfficialDocLink(); SetOfficialDocLink();
DebugOn();
} }
void DoUpdateParameters() ITK_OVERRIDE void DoUpdateParameters() ITK_OVERRIDE
...@@ -158,9 +156,13 @@ private: ...@@ -158,9 +156,13 @@ private:
void DoExecute() ITK_OVERRIDE void DoExecute() ITK_OVERRIDE
{ {
bool isVector(GetParameterString("mode") == "vector");
std::string outPath(isVector ?
GetParameterString("mode.vector.out"):
GetParameterString("mode.raster.out"));
std::vector<std::string> tmpFilenames; std::vector<std::string> tmpFilenames;
tmpFilenames.push_back(GetParameterString("out")+std::string("_labelmap.tif")); tmpFilenames.push_back(outPath+std::string("_labelmap.tif"));
tmpFilenames.push_back(GetParameterString("out")+std::string("_labelmap.geom")); tmpFilenames.push_back(outPath+std::string("_labelmap.geom"));
ExecuteInternal("smoothing"); ExecuteInternal("smoothing");
// in-memory connexion here (saves 1 additional update for foutpos) // in-memory connexion here (saves 1 additional update for foutpos)
GetInternalApplication("segmentation")->SetParameterInputImage("in", GetInternalApplication("segmentation")->SetParameterInputImage("in",
...@@ -180,10 +182,10 @@ private: ...@@ -180,10 +182,10 @@ private:
GetInternalApplication("merging")->SetParameterString("inseg", GetInternalApplication("merging")->SetParameterString("inseg",
tmpFilenames[0]); tmpFilenames[0]);
EnableParameter("mode.raster.out"); EnableParameter("mode.raster.out");
if (GetParameterString("mode") == "vector") if (isVector)
{ {
tmpFilenames.push_back(GetParameterString("out")+std::string("_labelmap_merged.tif")); tmpFilenames.push_back(outPath+std::string("_labelmap_merged.tif"));
tmpFilenames.push_back(GetParameterString("out")+std::string("_labelmap_merged.geom")); tmpFilenames.push_back(outPath+std::string("_labelmap_merged.geom"));
GetInternalApplication("merging")->SetParameterString("out", GetInternalApplication("merging")->SetParameterString("out",
tmpFilenames[2]); tmpFilenames[2]);
GetInternalApplication("merging")->ExecuteAndWriteOutput(); GetInternalApplication("merging")->ExecuteAndWriteOutput();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment