Commit bca09fa5 authored by remi cresson's avatar remi cresson
Browse files

ENH: default temporary directory path is the same as output image, when -tmpdir parameter is empty

parent dc93112c
...@@ -97,6 +97,7 @@ private: ...@@ -97,6 +97,7 @@ private:
// For large scale // For large scale
AddParameter(ParameterType_Directory, "tmpdir", "Directory for temporary files"); AddParameter(ParameterType_Directory, "tmpdir", "Directory for temporary files");
MandatoryOff("tmpdir");
AddParameter(ParameterType_Choice, "tiling", "Tiling layout for the large scale segmentation"); AddParameter(ParameterType_Choice, "tiling", "Tiling layout for the large scale segmentation");
AddChoice("tiling.auto", "Automatic tiling layout"); AddChoice("tiling.auto", "Automatic tiling layout");
AddChoice("tiling.user", "User tiling layout"); AddChoice("tiling.user", "User tiling layout");
...@@ -124,7 +125,16 @@ private: ...@@ -124,7 +125,16 @@ private:
std::string outbfname = itksys::SystemTools::GetFilenameWithoutExtension(outfname.c_str()); std::string outbfname = itksys::SystemTools::GetFilenameWithoutExtension(outfname.c_str());
// Get specified temporary directory // Get specified temporary directory
std::string tmpdir = GetParameterAsString("tmpdir"); std::string tmpdir;
if (HasValue("tmpdir"))
{
tmpdir= GetParameterAsString("tmpdir");
}
else
{
tmpdir = itksys::SystemTools::GetFilenamePath(outfname);
}
if (!tmpdir.empty()) if (!tmpdir.empty())
{ {
// A temporary directory is specified: we check that it ends with a POSIX separator // A temporary directory is specified: we check that it ends with a POSIX separator
...@@ -140,6 +150,7 @@ private: ...@@ -140,6 +150,7 @@ private:
{ {
otbAppLogFATAL("The directory " << tmpdir << " does not exist."); otbAppLogFATAL("The directory " << tmpdir << " does not exist.");
} }
otbAppLogINFO("Using temporary directory " << tmpdir);
// Return the prefix // Return the prefix
std::string prefix = tmpdir + outbfname; std::string prefix = tmpdir + outbfname;
......
Markdown is supported
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