diff --git a/CMakeLists.txt b/CMakeLists.txt index 899d6afaf4d6a0755963b9d0f6f89c65bc77bc3b..fb6ce64896ae1ed56060adfab4ae37bb414e9efc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,7 +86,7 @@ set(main_project_name ${_OTBModuleMacros_DEFAULT_LABEL}) #----------------------------------------------------------------------------- # OTB version number. set(OTB_VERSION_MAJOR "5") -set(OTB_VERSION_MINOR "11") +set(OTB_VERSION_MINOR "10") set(OTB_VERSION_PATCH "0") set(OTB_VERSION_STRING "${OTB_VERSION_MAJOR}.${OTB_VERSION_MINOR}.${OTB_VERSION_PATCH}") @@ -312,7 +312,12 @@ if(OTB_WRAP_PYTHON) set(OTB_CONFIG_CODE "${OTB_CONFIG_CODE} set(OTB_PYTHONPATH \"${OTB_BINARY_DIR}/${OTB_INSTALL_PYTHON_DIR}\")") endif() - +if(OTB_HAS_CXX11) + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR + "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + set(OTB_REQUIRED_CXX_FLAGS " -std=c++11") + endif() +endif() set(OTB_CONFIG_APPLICATION_PATH "${OTB_BINARY_DIR}/${OTB_INSTALL_APP_DIR}") set(OTB_CONFIG_TARGETS_CONDITION " AND NOT OTB_BINARY_DIR") set(OTB_CONFIG_TARGETS_FILE "${OTB_BINARY_DIR}/OTBTargets.cmake") diff --git a/Documentation/Cookbook/rst/Installation_Linux.txt b/Documentation/Cookbook/rst/Installation_Linux.txt index 0567d00c1ce372a8ddd323481dbd3b8595584bdd..8a6e941d15f3de94da5f53739af25686a2e000db 100644 --- a/Documentation/Cookbook/rst/Installation_Linux.txt +++ b/Documentation/Cookbook/rst/Installation_Linux.txt @@ -93,17 +93,17 @@ A: This is due to a conflict with system Qt4 (usually seen on KDE) and Qt4 + gtk Q: Monteverdi and Mapla applications look different from my other applications. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -A: By default, Monteverdi, Mapla and otbapplication (otbgui\_\*) uses a default gtk theme (plastic) -which is distributed with the OTB package!. We do this to be on safe side, like when a user does -not have gtk libraries installed when using our package. +A: By default, Monteverdi, Mapla and otbapplication (otbgui\_\*) uses a the +system gtk theme. If you can't install GTK on your system you can use the +distributed with the OTB package. Note that using system GTK is the preferred +way with the OTB standalone package as the distributed version of GTK do not +work on recent Linux distributions. -gtk libraries in the package is the reason why you are getting a default "plastic" look & feel that -makes it look different from other GUI applications. -To get same look and feel, you can "force" Monteverdi and Mapla to use system GTK. +To use the distributed GTK libraries you need to set the OTB_USE_LOCAL_GTK: :: - export OTB_USE_SYSTEM_GTK=1 + export OTB_USE_LOCAL_GTK=1 And now start ``monteverdi.sh`` or ``mapla.sh`` from OTB-|release|-Linux64 -To get back default behaviour, unset OTB_USE_SYSTEM_GTK=1 or set OTB_USE_SYSTEM_GTK=0 +To get back default behaviour, unset OTB_USE_LOCAL_GTK=1 or set OTB_USE_LOCAL_GTK=0 diff --git a/Documentation/Cookbook/rst/Installation_Linux_xdk.txt b/Documentation/Cookbook/rst/Installation_Linux_xdk.txt new file mode 100644 index 0000000000000000000000000000000000000000..9542af41aa905cc367b97c264b118a07ba11f5cd --- /dev/null +++ b/Documentation/Cookbook/rst/Installation_Linux_xdk.txt @@ -0,0 +1,66 @@ +Synopsis +-------- + +This archive provides a development kit for the ORFEO ToolBox library which +allows to easily compile OTB and facilitate the creation of programs based on +OTB. + +It contains shared libraries of OTB dependencies and helper scripts for the +configuration and the compilation of the library. + +Note that OTB sources are not included in the archive (see instructions below). + +Prerequisites +------------- + +- cmake (>= 3.2) +- gcc (>= 4.9) +- git + +Extract XDK +----------- + +:: + + cd /opt (You can use another a directory of your own choice) + chmod +x OTB-|release|-xdk-Linux64.run + ./OTB-|release|-xdk-Linux64.run + +**You now will have a directory named **OTB-|release|-xdk-Linux64** in **/opt** + +Setup environment +----------------- +There is a helper script in package called **xdkenv.profile**. This script export +required environments to configure and build OTB. + +:: + + cd /opt/OTB-|release|-xdk-Linux64 + . ./xdkenv.profile + +Test environment setup by checking value of CMAKE_PREFIX_PATH + +:: + + echo $CMAKE_PREFIX_PATH + +The above command will output: + /opt/OTB-|release|-xdk-Linux64 + + +Download, Configure and build OTB +--------------------------------- + +:: + + mkdir -p /opt/OTB/build && cd /opt/OTB + git clone --depth=1 --branch=develop https://git@git.orfeo-toolbox.org/git/otb.git source + cd build && cmake ../source + make -j2 + + +Notes +~~~~~ + +By default, all OTB\_USE\_\* variables in OTB are set to FALSE except for 6S and SiftFast. You can check/activate them in your cmake-gui/ccmake. + diff --git a/Documentation/Cookbook/rst/Installation_Macx_xdk.txt b/Documentation/Cookbook/rst/Installation_Macx_xdk.txt new file mode 100644 index 0000000000000000000000000000000000000000..648393dc3496a11f07ebc0a2f4353df09bbcab57 --- /dev/null +++ b/Documentation/Cookbook/rst/Installation_Macx_xdk.txt @@ -0,0 +1,2 @@ +README.md + diff --git a/Documentation/Cookbook/rst/Installation_Windows_xdk.txt b/Documentation/Cookbook/rst/Installation_Windows_xdk.txt new file mode 100644 index 0000000000000000000000000000000000000000..b43bf86b50fd8d3529a0dc062c30006ed38f309e --- /dev/null +++ b/Documentation/Cookbook/rst/Installation_Windows_xdk.txt @@ -0,0 +1 @@ +README.md diff --git a/Documentation/Cookbook/rst/Monteverdi.rst b/Documentation/Cookbook/rst/Monteverdi.rst index 6fb7c21db040abe0f06762efdaa3c3e2ce3fc0fe..57614e613d75aa505fa9cce1ce6cbf94f9f481b2 100644 --- a/Documentation/Cookbook/rst/Monteverdi.rst +++ b/Documentation/Cookbook/rst/Monteverdi.rst @@ -12,22 +12,19 @@ Monteverdi is a satellite image viewer. Its main features are: - **Powerful**: Access to all processing application from OTB. Orthorectification, optical calibration, classification, SAR processing, and much more! -GUI : what does it look like ? ------------------------------- - .. image:: Art/MonteverdiImages/gui.png -This is Monteverdi’s main window where the different functionalities are reachable: +This is Monteverdi’s main window where the different functionalities are: #. Main menu #. Top toolbar -#. Image displaying +#. Image View -#. Right side dock +#. Widgets -#. Stack layer +#. Layer stack Main menu ~~~~~~~~~ @@ -92,9 +89,9 @@ In the image displaying part: - CTRL+Mouse drag = Quick scroll view (rending is done after releasing CTRL key) -- CTRL+Mouse wheel = Zoom in out +- Mouse wheel = Zoom -- + or - = Zoom in out +- + or - = Zoom In the layer stack part: diff --git a/Documentation/SoftwareGuide/Latex/ContributorList.tex b/Documentation/SoftwareGuide/Latex/ContributorList.tex index dc42ae456a7fc58cc2a8d22e1f1d19ac125f5916..d17508de9313fa479c70eac7773d244c213dc383 100644 --- a/Documentation/SoftwareGuide/Latex/ContributorList.tex +++ b/Documentation/SoftwareGuide/Latex/ContributorList.tex @@ -33,6 +33,7 @@ Julien Osman, Julien Radoux (UCL), Laurentiu Nicola (CS Romania), Luc Hermitte (CS), +Ludovic Hussonnois (CS), Manuel Grizonnet (CNES), Massimo Di Stefano, Mathieu Deltorre (CS), diff --git a/Modules/Adapters/QtAdapters/src/otbQtAdapters.cxx b/Modules/Adapters/QtAdapters/src/otbQtAdapters.cxx index b36d66cff678d575dc0c20d6270a33ee1000ce3a..d665845923c78ac923baab163183389ee7c8ef14 100644 --- a/Modules/Adapters/QtAdapters/src/otbQtAdapters.cxx +++ b/Modules/Adapters/QtAdapters/src/otbQtAdapters.cxx @@ -66,13 +66,18 @@ GetExistingDirectory( QWidget * p, const QString& dir, QFileDialog::Options options ) { + QString dialogCaption(caption.isEmpty() + ? QObject::tr( "Select directory..." ) + : caption); + QString dialogDir(dir.isEmpty() + ? RecentDirectory + : dir); + QString path( QFileDialog::getExistingDirectory( p, - caption.isEmpty() - ? QObject::tr( "Select directory..." ) - : caption, - dir.isEmpty() ? RecentDirectory : dir, + dialogCaption, + dialogDir, options ) ); @@ -95,13 +100,18 @@ GetOpenFileName( QWidget * p, QString* selectedFilter, QFileDialog::Options options ) { + QString dialogCaption(caption.isEmpty() + ? QObject::tr( "Open file..." ) + : caption); + QString dialogDir(dir.isEmpty() + ? RecentDirectory + : dir); + QString filename( QFileDialog::getOpenFileName( p, - caption.isEmpty() - ? QObject::tr( "Open file..." ) - : caption, - dir.isEmpty() ? RecentDirectory : dir, + dialogCaption, + dialogDir, filter, selectedFilter, options @@ -124,13 +134,18 @@ GetOpenFileNames( QWidget * p, QString * selectedFilter, QFileDialog::Options options ) { + QString dialogCaption(caption.isEmpty() + ? QObject::tr( "Open file..." ) + : caption); + QString dialogDir(dir.isEmpty() + ? RecentDirectory + : dir); + QStringList filenames( QFileDialog::getOpenFileNames( p, - caption.isEmpty() - ? QObject::tr( "Open file..." ) - : caption, - dir.isEmpty() ? RecentDirectory : dir, + dialogCaption, + dialogDir, filter, selectedFilter, options @@ -153,13 +168,18 @@ GetSaveFileName( QWidget * p, QString * selectedFilter, QFileDialog::Options options ) { + QString dialogCaption(caption.isEmpty() + ? QObject::tr( "Save file..." ) + : caption); + QString dialogDir(dir.isEmpty() + ? RecentDirectory + : dir); + QString filename( QFileDialog::getSaveFileName( p, - caption.isEmpty() - ? QObject::tr( "Save file..." ) - : caption, - dir.isEmpty() ? RecentDirectory : dir, + dialogCaption, + dialogDir, filter, selectedFilter, options diff --git a/Modules/Applications/AppClassification/app/otbDSFuzzyModelEstimation.cxx b/Modules/Applications/AppClassification/app/otbDSFuzzyModelEstimation.cxx index dd9d347a1fc42ecfc0a190384dfeaa1b321e6b25..29a2b45989846859f26c236788f2d11d6fbf3b1c 100644 --- a/Modules/Applications/AppClassification/app/otbDSFuzzyModelEstimation.cxx +++ b/Modules/Applications/AppClassification/app/otbDSFuzzyModelEstimation.cxx @@ -140,12 +140,12 @@ private: AddParameter(ParameterType_String, "cri", "Criterion"); SetParameterDescription("cri", "Dempster Shafer criterion (by default (belief+plausibility)/2)"); MandatoryOff("cri"); - SetParameterString("cri","((Belief + Plausibility)/2.)"); + SetParameterString("cri","((Belief + Plausibility)/2.)", false); AddParameter(ParameterType_Float,"wgt","Weighting"); SetParameterDescription("wgt","Coefficient between 0 and 1 to promote undetection or false detections (default 0.5)"); MandatoryOff("wgt"); - SetParameterFloat("wgt", 0.5); + SetParameterFloat("wgt",0.5, false); AddParameter(ParameterType_InputFilename,"initmod","initialization model"); SetParameterDescription("initmod","Initialization model (xml file) to be used. If the xml initialization model is set, the descriptor list is not used (specified using the option -desclist)"); @@ -154,12 +154,12 @@ private: AddParameter(ParameterType_StringList, "desclist","Descriptor list"); SetParameterDescription("desclist","List of the descriptors to be used in the model (must be specified to perform an automatic initialization)"); MandatoryOff("desclist"); - SetParameterString("desclist",""); + SetParameterString("desclist","", false); AddParameter(ParameterType_Int,"maxnbit","Maximum number of iterations"); MandatoryOff("maxnbit"); SetParameterDescription("maxnbit","Maximum number of optimizer iteration (default 200)"); - SetParameterInt("maxnbit", 200); + SetParameterInt("maxnbit",200, false); AddParameter(ParameterType_Empty,"optobs","Optimizer Observer"); SetParameterDescription("optobs","Activate the optimizer observer"); diff --git a/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx b/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx index d83410e452ae8825bd799cd3219379024502c43d..d511384c0e95e99a36c662b5344f36180b6b0527 100644 --- a/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx +++ b/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx @@ -245,7 +245,7 @@ private: { otbAppLogWARNING("The available RAM is too small to process this sample size of " << GetParameterInt("ts") << " pixels. The sample size will be reduced to " << maxPixNb << " pixels." << std::endl); - this->SetParameterInt("ts", maxPixNb); + this->SetParameterInt("ts",maxPixNb, false); } this->SetMaximumParameterIntValue("ts", maxPixNb); diff --git a/Modules/Applications/AppClassification/app/otbMultiImageSamplingRate.cxx b/Modules/Applications/AppClassification/app/otbMultiImageSamplingRate.cxx index f1e90e88a8c9e4a134eedb93a4ed12500bda89bf..8bbd60510cf0938116c462e59fbab50c5bed8f42 100644 --- a/Modules/Applications/AppClassification/app/otbMultiImageSamplingRate.cxx +++ b/Modules/Applications/AppClassification/app/otbMultiImageSamplingRate.cxx @@ -161,7 +161,7 @@ private: SetParameterDescription("strategy.all","Take all samples"); // Default strategy : smallest - SetParameterString("strategy","smallest"); + SetParameterString("strategy","smallest", false); AddParameter(ParameterType_Choice, "mim", "Multi-Image Mode"); diff --git a/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx b/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx index b1161dddd7a2fd9e8bd66bf930f299aa7ca29e46..6ec4a448ed8d868649e12e5b838f26044e6deec8 100644 --- a/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx +++ b/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx @@ -78,7 +78,7 @@ private: AddParameter(ParameterType_String,"cfield","Field containing the predicted class."); SetParameterDescription("cfield","Field containing the predicted class"); - SetParameterString("cfield","predicted"); + SetParameterString("cfield","predicted", false); // Doc example parameter settings SetDocExampleParameterValue("inshp", "vectorData.shp"); diff --git a/Modules/Applications/AppClassification/app/otbSampleExtraction.cxx b/Modules/Applications/AppClassification/app/otbSampleExtraction.cxx index bd5f447ed718235410bb86804787918d19620ffd..0eb1e3a8a9a60c18a3ed3a6a79fbdb44f3b9e40f 100644 --- a/Modules/Applications/AppClassification/app/otbSampleExtraction.cxx +++ b/Modules/Applications/AppClassification/app/otbSampleExtraction.cxx @@ -86,7 +86,7 @@ private: AddParameter(ParameterType_String, "outfield.prefix.name", "Output field prefix"); SetParameterDescription("outfield.prefix.name","Prefix used to form the field names that" "will contain the extracted values."); - SetParameterString("outfield.prefix.name", "value_"); + SetParameterString("outfield.prefix.name", "value_", false); AddChoice("outfield.list","Use the given name list"); SetParameterDescription("outfield.list","Use the given name list"); diff --git a/Modules/Applications/AppClassification/app/otbSampleSelection.cxx b/Modules/Applications/AppClassification/app/otbSampleSelection.cxx index 5ff2926888f5a97b2e735fd8ac3e895dae114829..81b2b33f021a01753d7a7703abe050ba4c51790e 100644 --- a/Modules/Applications/AppClassification/app/otbSampleSelection.cxx +++ b/Modules/Applications/AppClassification/app/otbSampleSelection.cxx @@ -197,7 +197,7 @@ private: SetParameterDescription("strategy.all","Take all samples"); // Default strategy : smallest - SetParameterString("strategy","smallest"); + SetParameterString("strategy","smallest", false); AddParameter(ParameterType_ListView, "field", "Field Name"); SetParameterDescription("field","Name of the field carrying the class name in the input vectors."); diff --git a/Modules/Applications/AppClassification/app/otbTrainImagesClassifier.cxx b/Modules/Applications/AppClassification/app/otbTrainImagesClassifier.cxx index 6fdcecf6d104b6aa9597fd24408c088cc3e42aa7..5433dcf170b2d8110b488267033bf87bd2ef9628 100644 --- a/Modules/Applications/AppClassification/app/otbTrainImagesClassifier.cxx +++ b/Modules/Applications/AppClassification/app/otbTrainImagesClassifier.cxx @@ -155,7 +155,7 @@ void DoInit() ITK_OVERRIDE SetParameterDescription("sample.vtr", "Ratio between training and validation samples (0.0 = all training, 1.0 = " "all validation) (default = 0.5)."); - SetParameterFloat("sample.vtr", 0.5); + SetParameterFloat("sample.vtr",0.5, false); SetMaximumParameterFloatValue("sample.vtr",1.0); SetMinimumParameterFloatValue("sample.vtr",0.0); @@ -214,7 +214,7 @@ void DoUpdateParameters() ITK_OVERRIDE if ( HasValue("io.vd") ) { std::vector<std::string> vectorFileList = GetParameterStringList("io.vd"); - GetInternalApplication("polystat")->SetParameterString("vec",vectorFileList[0]); + GetInternalApplication("polystat")->SetParameterString("vec",vectorFileList[0], false); UpdateInternalParameters("polystat"); } } @@ -289,21 +289,21 @@ void DoExecute() ITK_OVERRIDE for (unsigned int i=0 ; i<nbInputs ; i++) { GetInternalApplication("polystat")->SetParameterInputImage("in",imageList->GetNthElement(i)); - GetInternalApplication("polystat")->SetParameterString("vec",vectorFileList[i]); - GetInternalApplication("polystat")->SetParameterString("out",polyStatTrainOutputs[i]); + GetInternalApplication("polystat")->SetParameterString("vec",vectorFileList[i], false); + GetInternalApplication("polystat")->SetParameterString("out",polyStatTrainOutputs[i], false); ExecuteInternal("polystat"); // analyse polygons given for validation if (dedicatedValidation) { - GetInternalApplication("polystat")->SetParameterString("vec",validationVectorFileList[i]); - GetInternalApplication("polystat")->SetParameterString("out",polyStatValidOutputs[i]); + GetInternalApplication("polystat")->SetParameterString("vec",validationVectorFileList[i], false); + GetInternalApplication("polystat")->SetParameterString("out",polyStatValidOutputs[i], false); ExecuteInternal("polystat"); } } // --------------------------------------------------------------------------- // Compute sampling rates - GetInternalApplication("rates")->SetParameterString("mim","proportional"); + GetInternalApplication("rates")->SetParameterString("mim","proportional", false); double vtr = GetParameterFloat("sample.vtr"); long mt = GetParameterInt("sample.mt"); long mv = GetParameterInt("sample.mv"); @@ -348,44 +348,44 @@ void DoExecute() ITK_OVERRIDE } // Sampling rates for training - GetInternalApplication("rates")->SetParameterStringList("il",polyStatTrainOutputs); - GetInternalApplication("rates")->SetParameterString("out",rateTrainOut); + GetInternalApplication("rates")->SetParameterStringList("il",polyStatTrainOutputs, false); + GetInternalApplication("rates")->SetParameterString("out",rateTrainOut, false); if (GetParameterInt("sample.bm") != 0) { - GetInternalApplication("rates")->SetParameterString("strategy","smallest"); + GetInternalApplication("rates")->SetParameterString("strategy","smallest", false); } else { if (fmt > -1) { - GetInternalApplication("rates")->SetParameterString("strategy","constant"); + GetInternalApplication("rates")->SetParameterString("strategy","constant", false); GetInternalApplication("rates")->SetParameterInt("strategy.constant.nb",fmt); } else { - GetInternalApplication("rates")->SetParameterString("strategy","all"); + GetInternalApplication("rates")->SetParameterString("strategy","all", false); } } ExecuteInternal("rates"); // Sampling rates for validation if (dedicatedValidation) { - GetInternalApplication("rates")->SetParameterStringList("il",polyStatValidOutputs); - GetInternalApplication("rates")->SetParameterString("out",rateValidOut); + GetInternalApplication("rates")->SetParameterStringList("il",polyStatValidOutputs, false); + GetInternalApplication("rates")->SetParameterString("out",rateValidOut, false); if (GetParameterInt("sample.bm") != 0) { - GetInternalApplication("rates")->SetParameterString("strategy","smallest"); + GetInternalApplication("rates")->SetParameterString("strategy","smallest", false); } else { if (fmv > -1) { - GetInternalApplication("rates")->SetParameterString("strategy","constant"); + GetInternalApplication("rates")->SetParameterString("strategy","constant", false); GetInternalApplication("rates")->SetParameterInt("strategy.constant.nb",fmv); } else { - GetInternalApplication("rates")->SetParameterString("strategy","all"); + GetInternalApplication("rates")->SetParameterString("strategy","all", false); } } ExecuteInternal("rates"); @@ -393,18 +393,18 @@ void DoExecute() ITK_OVERRIDE // --------------------------------------------------------------------------- // Select & extract samples - GetInternalApplication("select")->SetParameterString("sampler", "periodic"); + GetInternalApplication("select")->SetParameterString("sampler", "periodic", false); GetInternalApplication("select")->SetParameterInt("sampler.periodic.jitter",50); - GetInternalApplication("select")->SetParameterString("strategy","byclass"); - GetInternalApplication("extraction")->SetParameterString("outfield", "prefix"); - GetInternalApplication("extraction")->SetParameterString("outfield.prefix.name","value_"); + GetInternalApplication("select")->SetParameterString("strategy","byclass", false); + GetInternalApplication("extraction")->SetParameterString("outfield", "prefix", false); + GetInternalApplication("extraction")->SetParameterString("outfield.prefix.name","value_", false); for (unsigned int i=0 ; i<nbInputs ; i++) { GetInternalApplication("select")->SetParameterInputImage("in",imageList->GetNthElement(i)); - GetInternalApplication("select")->SetParameterString("vec",vectorFileList[i]); - GetInternalApplication("select")->SetParameterString("out",sampleOutputs[i]); - GetInternalApplication("select")->SetParameterString("instats",polyStatTrainOutputs[i]); - GetInternalApplication("select")->SetParameterString("strategy.byclass.in",ratesTrainOutputs[i]); + GetInternalApplication("select")->SetParameterString("vec",vectorFileList[i], false); + GetInternalApplication("select")->SetParameterString("out",sampleOutputs[i], false); + GetInternalApplication("select")->SetParameterString("instats",polyStatTrainOutputs[i], false); + GetInternalApplication("select")->SetParameterString("strategy.byclass.in",ratesTrainOutputs[i], false); // select sample positions ExecuteInternal("select"); // extract sample descriptors @@ -412,10 +412,10 @@ void DoExecute() ITK_OVERRIDE if (dedicatedValidation) { - GetInternalApplication("select")->SetParameterString("vec",validationVectorFileList[i]); - GetInternalApplication("select")->SetParameterString("out",sampleValidOutputs[i]); - GetInternalApplication("select")->SetParameterString("instats",polyStatValidOutputs[i]); - GetInternalApplication("select")->SetParameterString("strategy.byclass.in",ratesValidOutputs[i]); + GetInternalApplication("select")->SetParameterString("vec",validationVectorFileList[i], false); + GetInternalApplication("select")->SetParameterString("out",sampleValidOutputs[i], false); + GetInternalApplication("select")->SetParameterString("instats",polyStatValidOutputs[i], false); + GetInternalApplication("select")->SetParameterString("strategy.byclass.in",ratesValidOutputs[i], false); // select sample positions ExecuteInternal("select"); // extract sample descriptors @@ -473,8 +473,8 @@ void DoExecute() ITK_OVERRIDE // --------------------------------------------------------------------------- // Train model - GetInternalApplication("training")->SetParameterStringList("io.vd",sampleTrainOutputs); - GetInternalApplication("training")->SetParameterStringList("valid.vd",sampleValidOutputs); + GetInternalApplication("training")->SetParameterStringList("io.vd",sampleTrainOutputs, false); + GetInternalApplication("training")->SetParameterStringList("valid.vd",sampleValidOutputs, false); UpdateInternalParameters("training"); // set field names FloatVectorImageType::Pointer image = imageList->GetNthElement(0); @@ -486,7 +486,7 @@ void DoExecute() ITK_OVERRIDE oss << i; selectedNames.push_back("value_"+oss.str()); } - GetInternalApplication("training")->SetParameterStringList("feat",selectedNames); + GetInternalApplication("training")->SetParameterStringList("feat",selectedNames, false); ExecuteInternal("training"); // cleanup diff --git a/Modules/Applications/AppClassification/app/otbTrainOGRLayersClassifier.cxx b/Modules/Applications/AppClassification/app/otbTrainOGRLayersClassifier.cxx index b461ac2a89f97fda7b2b2308d6e6f08ce5834964..0e4affaa6c4957b0c773af552d9756ce44339278 100644 --- a/Modules/Applications/AppClassification/app/otbTrainOGRLayersClassifier.cxx +++ b/Modules/Applications/AppClassification/app/otbTrainOGRLayersClassifier.cxx @@ -80,7 +80,7 @@ private: AddParameter(ParameterType_String,"cfield","Field containing the class id for supervision"); SetParameterDescription("cfield","Field containing the class id for supervision. Only geometries with this field available will be taken into account."); - SetParameterString("cfield","class"); + SetParameterString("cfield","class", false); // Doc example parameter settings SetDocExampleParameterValue("inshp", "vectorData.shp"); diff --git a/Modules/Applications/AppClassification/app/otbTrainRegression.cxx b/Modules/Applications/AppClassification/app/otbTrainRegression.cxx index 3039d44a0a053a5a84787683258069c16575b27c..335961cfce88ce3c259f1cb4f25be9d2b029c8ac 100644 --- a/Modules/Applications/AppClassification/app/otbTrainRegression.cxx +++ b/Modules/Applications/AppClassification/app/otbTrainRegression.cxx @@ -159,7 +159,7 @@ void DoInit() ITK_OVERRIDE AddParameter(ParameterType_Float, "sample.vtr", "Training and validation sample ratio"); SetParameterDescription("sample.vtr", "Ratio between training and validation samples (0.0 = all training, 1.0 = all validation) (default = 0.5)."); - SetParameterFloat("sample.vtr", 0.5); + SetParameterFloat("sample.vtr",0.5, false); Superclass::DoInit(); diff --git a/Modules/Applications/AppClassification/app/otbVectorDataDSValidation.cxx b/Modules/Applications/AppClassification/app/otbVectorDataDSValidation.cxx index c260e168195bc5b9e923b4ac34e48bec6a054a63..234b90e7677adcebd0259cba08d084b2d9e793d2 100644 --- a/Modules/Applications/AppClassification/app/otbVectorDataDSValidation.cxx +++ b/Modules/Applications/AppClassification/app/otbVectorDataDSValidation.cxx @@ -84,12 +84,12 @@ private: AddParameter(ParameterType_String, "cri", "Criterion"); SetParameterDescription("cri", "Dempster Shafer criterion (by default (belief+plausibility)/2)"); MandatoryOff("cri"); - SetParameterString("cri", "((Belief + Plausibility)/2.)"); + SetParameterString("cri", "((Belief + Plausibility)/2.)", false); AddParameter(ParameterType_Float, "thd", "Criterion threshold"); SetParameterDescription("thd", "Criterion threshold (default 0.5)"); MandatoryOff("thd"); - SetParameterFloat("thd", 0.5); + SetParameterFloat("thd",0.5, false); AddParameter(ParameterType_OutputVectorData, "out", "Output Vector Data"); SetParameterDescription("out", "Output VectorData containing only the validated samples"); diff --git a/Modules/Applications/AppClassification/include/otbTrainBoost.txx b/Modules/Applications/AppClassification/include/otbTrainBoost.txx index fbd99531a4eff13525b9db92ddad63643397bb2a..ea725cc28e52dfcbb1e25f4b77df859fac005792 100644 --- a/Modules/Applications/AppClassification/include/otbTrainBoost.txx +++ b/Modules/Applications/AppClassification/include/otbTrainBoost.txx @@ -39,22 +39,22 @@ namespace Wrapper AddChoice("classifier.boost.t.logit", "LogitBoost (technique producing good regression fits)"); AddChoice("classifier.boost.t.gentle", "Gentle AdaBoost (technique setting less weight on outlier data points " "and, for that reason, being often good with regression data)"); - SetParameterString("classifier.boost.t", "real"); + SetParameterString("classifier.boost.t", "real", false); SetParameterDescription("classifier.boost.t", "Type of Boosting algorithm."); //Do not expose SplitCriteria //WeakCount AddParameter(ParameterType_Int, "classifier.boost.w", "Weak count"); - SetParameterInt("classifier.boost.w", 100); + SetParameterInt("classifier.boost.w",100, false); SetParameterDescription("classifier.boost.w","The number of weak classifiers."); //WeightTrimRate AddParameter(ParameterType_Float, "classifier.boost.r", "Weight Trim Rate"); - SetParameterFloat("classifier.boost.r", 0.95); + SetParameterFloat("classifier.boost.r",0.95, false); SetParameterDescription("classifier.boost.r","A threshold between 0 and 1 used to save computational time. " "Samples with summary weight <= (1 - weight_trim_rate) do not participate in the next iteration of training. " "Set this parameter to 0 to turn off this functionality."); //MaxDepth : Not sure that this parameter has to be exposed. AddParameter(ParameterType_Int, "classifier.boost.m", "Maximum depth of the tree"); - SetParameterInt("classifier.boost.m", 1); + SetParameterInt("classifier.boost.m",1, false); SetParameterDescription("classifier.boost.m","Maximum depth of the tree."); } diff --git a/Modules/Applications/AppClassification/include/otbTrainDecisionTree.txx b/Modules/Applications/AppClassification/include/otbTrainDecisionTree.txx index 61cd1a34befbcf00aa70ea0703f3f43af3c81570..def7b605e537d51e73de0ab43dbd398d64032798 100644 --- a/Modules/Applications/AppClassification/include/otbTrainDecisionTree.txx +++ b/Modules/Applications/AppClassification/include/otbTrainDecisionTree.txx @@ -34,7 +34,7 @@ LearningApplicationBase<TInputValue,TOutputValue> "See complete documentation here \\url{http://docs.opencv.org/modules/ml/doc/decision_trees.html}."); //MaxDepth AddParameter(ParameterType_Int, "classifier.dt.max", "Maximum depth of the tree"); - SetParameterInt("classifier.dt.max", 65535); + SetParameterInt("classifier.dt.max",65535, false); SetParameterDescription( "classifier.dt.max", "The training algorithm attempts to split each node while its depth is smaller than the maximum " "possible depth of the tree. The actual depth may be smaller if the other termination criteria are met, and/or " @@ -42,13 +42,13 @@ LearningApplicationBase<TInputValue,TOutputValue> //MinSampleCount AddParameter(ParameterType_Int, "classifier.dt.min", "Minimum number of samples in each node"); - SetParameterInt("classifier.dt.min", 10); + SetParameterInt("classifier.dt.min",10, false); SetParameterDescription("classifier.dt.min", "If the number of samples in a node is smaller than this parameter, " "then this node will not be split."); //RegressionAccuracy AddParameter(ParameterType_Float, "classifier.dt.ra", "Termination criteria for regression tree"); - SetParameterFloat("classifier.dt.ra", 0.01); + SetParameterFloat("classifier.dt.ra",0.01, false); SetParameterDescription("classifier.dt.min", "If all absolute differences between an estimated value in a node " "and the values of the train samples in this node are smaller than this regression accuracy parameter, " "then the node will not be split."); @@ -60,14 +60,14 @@ LearningApplicationBase<TInputValue,TOutputValue> //MaxCategories AddParameter(ParameterType_Int, "classifier.dt.cat", "Cluster possible values of a categorical variable into K <= cat clusters to find a suboptimal split"); - SetParameterInt("classifier.dt.cat", 10); + SetParameterInt("classifier.dt.cat",10, false); SetParameterDescription( "classifier.dt.cat", "Cluster possible values of a categorical variable into K <= cat clusters to find a suboptimal split."); //CVFolds AddParameter(ParameterType_Int, "classifier.dt.f", "K-fold cross-validations"); - SetParameterInt("classifier.dt.f", 10); + SetParameterInt("classifier.dt.f",10, false); SetParameterDescription( "classifier.dt.f", "If cv_folds > 1, then it prunes a tree with K-fold cross-validation where K is equal to cv_folds."); diff --git a/Modules/Applications/AppClassification/include/otbTrainGradientBoostedTree.txx b/Modules/Applications/AppClassification/include/otbTrainGradientBoostedTree.txx index bcf5caa86181a84c546c264052bad32f2d8fd95f..d67f9643447686f4d8ee87e1143fc9a847d55b93 100644 --- a/Modules/Applications/AppClassification/include/otbTrainGradientBoostedTree.txx +++ b/Modules/Applications/AppClassification/include/otbTrainGradientBoostedTree.txx @@ -45,7 +45,7 @@ LearningApplicationBase<TInputValue,TOutputValue> //WeakCount AddParameter(ParameterType_Int, "classifier.gbt.w", "Number of boosting algorithm iterations"); - SetParameterInt("classifier.gbt.w", 200); + SetParameterInt("classifier.gbt.w",200, false); SetParameterDescription( "classifier.gbt.w", "Number \"w\" of boosting algorithm iterations, with w*K being the total number of trees in " @@ -53,20 +53,20 @@ LearningApplicationBase<TInputValue,TOutputValue> //Shrinkage AddParameter(ParameterType_Float, "classifier.gbt.s", "Regularization parameter"); - SetParameterFloat("classifier.gbt.s", 0.01); + SetParameterFloat("classifier.gbt.s",0.01, false); SetParameterDescription("classifier.gbt.s", "Regularization parameter."); //SubSamplePortion AddParameter(ParameterType_Float, "classifier.gbt.p", "Portion of the whole training set used for each algorithm iteration"); - SetParameterFloat("classifier.gbt.p", 0.8); + SetParameterFloat("classifier.gbt.p",0.8, false); SetParameterDescription( "classifier.gbt.p", "Portion of the whole training set used for each algorithm iteration. The subset is generated randomly."); //MaxDepth AddParameter(ParameterType_Int, "classifier.gbt.max", "Maximum depth of the tree"); - SetParameterInt("classifier.gbt.max", 3); + SetParameterInt("classifier.gbt.max",3, false); SetParameterDescription( "classifier.gbt.max", "The training algorithm attempts to split each node while its depth is smaller than the maximum " "possible depth of the tree. The actual depth may be smaller if the other termination criteria are met, and/or " diff --git a/Modules/Applications/AppClassification/include/otbTrainKNN.txx b/Modules/Applications/AppClassification/include/otbTrainKNN.txx index fdf10cdf283f1a5f22f3044aea335c844c16101c..6fba81fe4ea9d0604c5e0e3c19bcea876bfb76be 100644 --- a/Modules/Applications/AppClassification/include/otbTrainKNN.txx +++ b/Modules/Applications/AppClassification/include/otbTrainKNN.txx @@ -34,7 +34,7 @@ namespace Wrapper //K parameter AddParameter(ParameterType_Int, "classifier.knn.k", "Number of Neighbors"); - SetParameterInt("classifier.knn.k", 32); + SetParameterInt("classifier.knn.k",32, false); SetParameterDescription("classifier.knn.k","The number of neighbors to use."); if (this->m_RegressionFlag) diff --git a/Modules/Applications/AppClassification/include/otbTrainLibSVM.txx b/Modules/Applications/AppClassification/include/otbTrainLibSVM.txx index f89b7141566e3993f117990eaea5c7cb87f9438b..120b572fcee064bac28a14cce05526eb82862f2d 100644 --- a/Modules/Applications/AppClassification/include/otbTrainLibSVM.txx +++ b/Modules/Applications/AppClassification/include/otbTrainLibSVM.txx @@ -35,7 +35,7 @@ namespace Wrapper AddChoice("classifier.libsvm.k.rbf", "Gaussian radial basis function"); AddChoice("classifier.libsvm.k.poly", "Polynomial"); AddChoice("classifier.libsvm.k.sigmoid", "Sigmoid"); - SetParameterString("classifier.libsvm.k", "linear"); + SetParameterString("classifier.libsvm.k", "linear", false); SetParameterDescription("classifier.libsvm.k", "SVM Kernel Type."); AddParameter(ParameterType_Choice, "classifier.libsvm.m", "SVM Model Type"); SetParameterDescription("classifier.libsvm.m", "Type of SVM formulation."); @@ -43,17 +43,17 @@ namespace Wrapper { AddChoice("classifier.libsvm.m.epssvr", "Epsilon Support Vector Regression"); AddChoice("classifier.libsvm.m.nusvr", "Nu Support Vector Regression"); - SetParameterString("classifier.libsvm.m", "epssvr"); + SetParameterString("classifier.libsvm.m", "epssvr", false); } else { AddChoice("classifier.libsvm.m.csvc", "C support vector classification"); AddChoice("classifier.libsvm.m.nusvc", "Nu support vector classification"); AddChoice("classifier.libsvm.m.oneclass", "Distribution estimation (One Class SVM)"); - SetParameterString("classifier.libsvm.m", "csvc"); + SetParameterString("classifier.libsvm.m", "csvc", false); } AddParameter(ParameterType_Float, "classifier.libsvm.c", "Cost parameter C"); - SetParameterFloat("classifier.libsvm.c", 1.0); + SetParameterFloat("classifier.libsvm.c",1.0, false); SetParameterDescription( "classifier.libsvm.c", "SVM models have a cost parameter C (1 by default) to control the trade-off between training errors and forcing rigid margins."); @@ -67,9 +67,9 @@ namespace Wrapper if (this->m_RegressionFlag) { AddParameter(ParameterType_Float, "classifier.libsvm.eps", "Epsilon"); - SetParameterFloat("classifier.libsvm.eps", 1e-3); + SetParameterFloat("classifier.libsvm.eps",1e-3, false); AddParameter(ParameterType_Float, "classifier.libsvm.nu", "Nu"); - SetParameterFloat("classifier.libsvm.nu", 0.5); + SetParameterFloat("classifier.libsvm.nu",0.5, false); } } diff --git a/Modules/Applications/AppClassification/include/otbTrainNeuralNetwork.txx b/Modules/Applications/AppClassification/include/otbTrainNeuralNetwork.txx index ee7bf43d47c7e9f9b653208b8c7d611afc13c62e..8f9386a8d557b48a16f24df93edc5b943d062324 100644 --- a/Modules/Applications/AppClassification/include/otbTrainNeuralNetwork.txx +++ b/Modules/Applications/AppClassification/include/otbTrainNeuralNetwork.txx @@ -38,7 +38,7 @@ LearningApplicationBase<TInputValue,TOutputValue> AddParameter(ParameterType_Choice, "classifier.ann.t", "Train Method Type"); AddChoice("classifier.ann.t.reg", "RPROP algorithm"); AddChoice("classifier.ann.t.back", "Back-propagation algorithm"); - SetParameterString("classifier.ann.t", "reg"); + SetParameterString("classifier.ann.t", "reg", false); SetParameterDescription("classifier.ann.t", "Type of training method for the multilayer perceptron (MLP) neural network."); //LayerSizes @@ -56,25 +56,25 @@ LearningApplicationBase<TInputValue,TOutputValue> AddChoice("classifier.ann.f.ident", "Identity function"); AddChoice("classifier.ann.f.sig", "Symmetrical Sigmoid function"); AddChoice("classifier.ann.f.gau", "Gaussian function (Not completely supported)"); - SetParameterString("classifier.ann.f", "sig"); + SetParameterString("classifier.ann.f", "sig", false); SetParameterDescription("classifier.ann.f", "Neuron activation function."); //Alpha AddParameter(ParameterType_Float, "classifier.ann.a", "Alpha parameter of the activation function"); - SetParameterFloat("classifier.ann.a", 1.); + SetParameterFloat("classifier.ann.a",1., false); SetParameterDescription("classifier.ann.a", "Alpha parameter of the activation function (used only with sigmoid and gaussian functions)."); //Beta AddParameter(ParameterType_Float, "classifier.ann.b", "Beta parameter of the activation function"); - SetParameterFloat("classifier.ann.b", 1.); + SetParameterFloat("classifier.ann.b",1., false); SetParameterDescription("classifier.ann.b", "Beta parameter of the activation function (used only with sigmoid and gaussian functions)."); //BackPropDWScale AddParameter(ParameterType_Float, "classifier.ann.bpdw", "Strength of the weight gradient term in the BACKPROP method"); - SetParameterFloat("classifier.ann.bpdw", 0.1); + SetParameterFloat("classifier.ann.bpdw",0.1, false); SetParameterDescription( "classifier.ann.bpdw", "Strength of the weight gradient term in the BACKPROP method. The recommended value is about 0.1."); @@ -82,7 +82,7 @@ LearningApplicationBase<TInputValue,TOutputValue> //BackPropMomentScale AddParameter(ParameterType_Float, "classifier.ann.bpms", "Strength of the momentum term (the difference between weights on the 2 previous iterations)"); - SetParameterFloat("classifier.ann.bpms", 0.1); + SetParameterFloat("classifier.ann.bpms",0.1, false); SetParameterDescription( "classifier.ann.bpms", "Strength of the momentum term (the difference between weights on the 2 previous iterations). " @@ -92,12 +92,12 @@ LearningApplicationBase<TInputValue,TOutputValue> //RegPropDW0 AddParameter(ParameterType_Float, "classifier.ann.rdw", "Initial value Delta_0 of update-values Delta_{ij} in RPROP method"); - SetParameterFloat("classifier.ann.rdw", 0.1); + SetParameterFloat("classifier.ann.rdw",0.1, false); SetParameterDescription("classifier.ann.rdw", "Initial value Delta_0 of update-values Delta_{ij} in RPROP method (default = 0.1)."); //RegPropDWMin AddParameter(ParameterType_Float, "classifier.ann.rdwm", "Update-values lower limit Delta_{min} in RPROP method"); - SetParameterFloat("classifier.ann.rdwm", 1e-7); + SetParameterFloat("classifier.ann.rdwm",1e-7, false); SetParameterDescription( "classifier.ann.rdwm", "Update-values lower limit Delta_{min} in RPROP method. It must be positive (default = 1e-7)."); @@ -107,18 +107,18 @@ LearningApplicationBase<TInputValue,TOutputValue> AddChoice("classifier.ann.term.iter", "Maximum number of iterations"); AddChoice("classifier.ann.term.eps", "Epsilon"); AddChoice("classifier.ann.term.all", "Max. iterations + Epsilon"); - SetParameterString("classifier.ann.term", "all"); + SetParameterString("classifier.ann.term", "all", false); SetParameterDescription("classifier.ann.term", "Termination criteria."); //Epsilon AddParameter(ParameterType_Float, "classifier.ann.eps", "Epsilon value used in the Termination criteria"); - SetParameterFloat("classifier.ann.eps", 0.01); + SetParameterFloat("classifier.ann.eps",0.01, false); SetParameterDescription("classifier.ann.eps", "Epsilon value used in the Termination criteria."); //MaxIter AddParameter(ParameterType_Int, "classifier.ann.iter", "Maximum number of iterations used in the Termination criteria"); - SetParameterInt("classifier.ann.iter", 1000); + SetParameterInt("classifier.ann.iter",1000, false); SetParameterDescription("classifier.ann.iter", "Maximum number of iterations used in the Termination criteria."); } diff --git a/Modules/Applications/AppClassification/include/otbTrainRandomForests.txx b/Modules/Applications/AppClassification/include/otbTrainRandomForests.txx index 669b4562b6e955aaf34dd821675e3194d5b8f37b..7a507bb8f8d2bdbd4fabf4a9c01e3fc922c558c3 100644 --- a/Modules/Applications/AppClassification/include/otbTrainRandomForests.txx +++ b/Modules/Applications/AppClassification/include/otbTrainRandomForests.txx @@ -34,7 +34,7 @@ LearningApplicationBase<TInputValue,TOutputValue> "See complete documentation here \\url{http://docs.opencv.org/modules/ml/doc/random_trees.html}."); //MaxDepth AddParameter(ParameterType_Int, "classifier.rf.max", "Maximum depth of the tree"); - SetParameterInt("classifier.rf.max", 5); + SetParameterInt("classifier.rf.max",5, false); SetParameterDescription( "classifier.rf.max", "The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. " @@ -42,14 +42,14 @@ LearningApplicationBase<TInputValue,TOutputValue> //MinSampleCount AddParameter(ParameterType_Int, "classifier.rf.min", "Minimum number of samples in each node"); - SetParameterInt("classifier.rf.min", 10); + SetParameterInt("classifier.rf.min",10, false); SetParameterDescription( "classifier.rf.min", "If the number of samples in a node is smaller than this parameter, " "then the node will not be split. A reasonable value is a small percentage of the total data e.g. 1 percent."); //RegressionAccuracy AddParameter(ParameterType_Float, "classifier.rf.ra", "Termination Criteria for regression tree"); - SetParameterFloat("classifier.rf.ra", 0.); + SetParameterFloat("classifier.rf.ra",0., false); SetParameterDescription("classifier.rf.ra", "If all absolute differences between an estimated value in a node " "and the values of the train samples in this node are smaller than this regression accuracy parameter, " "then the node will not be split."); @@ -61,7 +61,7 @@ LearningApplicationBase<TInputValue,TOutputValue> //MaxNumberOfCategories AddParameter(ParameterType_Int, "classifier.rf.cat", "Cluster possible values of a categorical variable into K <= cat clusters to find a suboptimal split"); - SetParameterInt("classifier.rf.cat", 10); + SetParameterInt("classifier.rf.cat",10, false); SetParameterDescription( "classifier.rf.cat", "Cluster possible values of a categorical variable into K <= cat clusters to find a suboptimal split."); @@ -73,7 +73,7 @@ LearningApplicationBase<TInputValue,TOutputValue> //MaxNumberOfVariables AddParameter(ParameterType_Int, "classifier.rf.var", "Size of the randomly selected subset of features at each tree node"); - SetParameterInt("classifier.rf.var", 0); + SetParameterInt("classifier.rf.var",0, false); SetParameterDescription( "classifier.rf.var", "The size of the subset of features, randomly selected at each tree node, that are used to find the best split(s). " @@ -82,7 +82,7 @@ LearningApplicationBase<TInputValue,TOutputValue> //MaxNumberOfTrees AddParameter(ParameterType_Int, "classifier.rf.nbtrees", "Maximum number of trees in the forest"); - SetParameterInt("classifier.rf.nbtrees", 100); + SetParameterInt("classifier.rf.nbtrees",100, false); SetParameterDescription( "classifier.rf.nbtrees", "The maximum number of trees in the forest. Typically, the more trees you have, the better the accuracy. " @@ -92,7 +92,7 @@ LearningApplicationBase<TInputValue,TOutputValue> //ForestAccuracy AddParameter(ParameterType_Float, "classifier.rf.acc", "Sufficient accuracy (OOB error)"); - SetParameterFloat("classifier.rf.acc", 0.01); + SetParameterFloat("classifier.rf.acc",0.01, false); SetParameterDescription("classifier.rf.acc","Sufficient accuracy (OOB error)."); diff --git a/Modules/Applications/AppClassification/include/otbTrainSVM.txx b/Modules/Applications/AppClassification/include/otbTrainSVM.txx index d36c28dd052097b98a06bd7be44e163d5dc1cf38..2893b43e4b97304f902c5adf5a0328f042c7904e 100644 --- a/Modules/Applications/AppClassification/include/otbTrainSVM.txx +++ b/Modules/Applications/AppClassification/include/otbTrainSVM.txx @@ -37,35 +37,35 @@ namespace Wrapper { AddChoice("classifier.svm.m.epssvr", "Epsilon Support Vector Regression"); AddChoice("classifier.svm.m.nusvr", "Nu Support Vector Regression"); - SetParameterString("classifier.svm.m", "epssvr"); + SetParameterString("classifier.svm.m", "epssvr", false); } else { AddChoice("classifier.svm.m.csvc", "C support vector classification"); AddChoice("classifier.svm.m.nusvc", "Nu support vector classification"); AddChoice("classifier.svm.m.oneclass", "Distribution estimation (One Class SVM)"); - SetParameterString("classifier.svm.m", "csvc"); + SetParameterString("classifier.svm.m", "csvc", false); } AddParameter(ParameterType_Choice, "classifier.svm.k", "SVM Kernel Type"); AddChoice("classifier.svm.k.linear", "Linear"); AddChoice("classifier.svm.k.rbf", "Gaussian radial basis function"); AddChoice("classifier.svm.k.poly", "Polynomial"); AddChoice("classifier.svm.k.sigmoid", "Sigmoid"); - SetParameterString("classifier.svm.k", "linear"); + SetParameterString("classifier.svm.k", "linear", false); SetParameterDescription("classifier.svm.k", "SVM Kernel Type."); AddParameter(ParameterType_Float, "classifier.svm.c", "Cost parameter C"); - SetParameterFloat("classifier.svm.c", 1.0); + SetParameterFloat("classifier.svm.c",1.0, false); SetParameterDescription( "classifier.svm.c", "SVM models have a cost parameter C (1 by default) to control the trade-off between training errors and forcing rigid margins."); AddParameter(ParameterType_Float, "classifier.svm.nu", "Parameter nu of a SVM optimization problem (NU_SVC / ONE_CLASS)"); - SetParameterFloat("classifier.svm.nu", 0.0); + SetParameterFloat("classifier.svm.nu",0.0, false); SetParameterDescription("classifier.svm.nu", "Parameter nu of a SVM optimization problem."); if (this->m_RegressionFlag) { AddParameter(ParameterType_Float, "classifier.svm.p", "Parameter epsilon of a SVM optimization problem (EPS_SVR)"); - SetParameterFloat("classifier.svm.p", 1.0); + SetParameterFloat("classifier.svm.p",1.0, false); SetParameterDescription("classifier.svm.p", "Parameter epsilon of a SVM optimization problem (EPS_SVR)."); AddParameter(ParameterType_Choice, "classifier.svm.term", "Termination criteria"); @@ -75,22 +75,22 @@ namespace Wrapper AddChoice("classifier.svm.term.all", "Stops when either iteration or epsilon criteria is true"); AddParameter(ParameterType_Float, "classifier.svm.iter", "Maximum iteration"); - SetParameterFloat("classifier.svm.iter", 1000); + SetParameterFloat("classifier.svm.iter",1000, false); SetParameterDescription("classifier.svm.iter", "Maximum number of iterations (corresponds to the termination criteria 'iter')."); AddParameter(ParameterType_Float, "classifier.svm.eps", "Epsilon accuracy threshold"); - SetParameterFloat("classifier.svm.eps", FLT_EPSILON); + SetParameterFloat("classifier.svm.eps",FLT_EPSILON, false); SetParameterDescription("classifier.svm.eps", "Epsilon accuracy (corresponds to the termination criteria 'eps')."); } AddParameter(ParameterType_Float, "classifier.svm.coef0", "Parameter coef0 of a kernel function (POLY / SIGMOID)"); - SetParameterFloat("classifier.svm.coef0", 0.0); + SetParameterFloat("classifier.svm.coef0",0.0, false); SetParameterDescription("classifier.svm.coef0", "Parameter coef0 of a kernel function (POLY / SIGMOID)."); AddParameter(ParameterType_Float, "classifier.svm.gamma", "Parameter gamma of a kernel function (POLY / RBF / SIGMOID)"); - SetParameterFloat("classifier.svm.gamma", 1.0); + SetParameterFloat("classifier.svm.gamma",1.0, false); SetParameterDescription("classifier.svm.gamma", "Parameter gamma of a kernel function (POLY / RBF / SIGMOID)."); AddParameter(ParameterType_Float, "classifier.svm.degree", "Parameter degree of a kernel function (POLY)"); - SetParameterFloat("classifier.svm.degree", 1.0); + SetParameterFloat("classifier.svm.degree",1.0, false); SetParameterDescription("classifier.svm.degree", "Parameter degree of a kernel function (POLY)."); AddParameter(ParameterType_Empty, "classifier.svm.opt", "Parameters optimization"); MandatoryOff("classifier.svm.opt"); @@ -211,15 +211,15 @@ namespace Wrapper SVMClassifier->Save(modelPath); // Update the displayed parameters in the GUI after the training process, for further use of them - SetParameterFloat("classifier.svm.c", static_cast<float> (SVMClassifier->GetOutputC())); - SetParameterFloat("classifier.svm.nu", static_cast<float> (SVMClassifier->GetOutputNu())); + SetParameterFloat("classifier.svm.c",static_cast<float> (SVMClassifier->GetOutputC()), false); + SetParameterFloat("classifier.svm.nu",static_cast<float> (SVMClassifier->GetOutputNu()), false); if (this->m_RegressionFlag) { - SetParameterFloat("classifier.svm.p", static_cast<float> (SVMClassifier->GetOutputP())); + SetParameterFloat("classifier.svm.p",static_cast<float> (SVMClassifier->GetOutputP()), false); } - SetParameterFloat("classifier.svm.coef0", static_cast<float> (SVMClassifier->GetOutputCoef0())); - SetParameterFloat("classifier.svm.gamma", static_cast<float> (SVMClassifier->GetOutputGamma())); - SetParameterFloat("classifier.svm.degree", static_cast<float> (SVMClassifier->GetOutputDegree())); + SetParameterFloat("classifier.svm.coef0",static_cast<float> (SVMClassifier->GetOutputCoef0()), false); + SetParameterFloat("classifier.svm.gamma",static_cast<float> (SVMClassifier->GetOutputGamma()), false); + SetParameterFloat("classifier.svm.degree",static_cast<float> (SVMClassifier->GetOutputDegree()), false); } } //end namespace wrapper diff --git a/Modules/Applications/AppClassification/include/otbTrainSharkRandomForests.txx b/Modules/Applications/AppClassification/include/otbTrainSharkRandomForests.txx index c9b2d565695c708da557074076fadfcaa3a6c4cd..cf9705b3089884c39a4563b021893370d4facb2c 100644 --- a/Modules/Applications/AppClassification/include/otbTrainSharkRandomForests.txx +++ b/Modules/Applications/AppClassification/include/otbTrainSharkRandomForests.txx @@ -38,7 +38,7 @@ LearningApplicationBase<TInputValue,TOutputValue> //MaxNumberOfTrees AddParameter(ParameterType_Int, "classifier.sharkrf.nbtrees", "Maximum number of trees in the forest"); - SetParameterInt("classifier.sharkrf.nbtrees", 100); + SetParameterInt("classifier.sharkrf.nbtrees",100, false); SetParameterDescription( "classifier.sharkrf.nbtrees", "The maximum number of trees in the forest. Typically, the more trees you have, the better the accuracy. " @@ -48,7 +48,7 @@ LearningApplicationBase<TInputValue,TOutputValue> //NodeSize AddParameter(ParameterType_Int, "classifier.sharkrf.nodesize", "Min size of the node for a split"); - SetParameterInt("classifier.sharkrf.nodesize", 25); + SetParameterInt("classifier.sharkrf.nodesize",25, false); SetParameterDescription( "classifier.sharkrf.nodesize", "If the number of samples in a node is smaller than this parameter, " @@ -56,7 +56,7 @@ LearningApplicationBase<TInputValue,TOutputValue> //MTry AddParameter(ParameterType_Int, "classifier.sharkrf.mtry", "Number of features tested at each node"); - SetParameterInt("classifier.sharkrf.mtry", 0); + SetParameterInt("classifier.sharkrf.mtry",0, false); SetParameterDescription( "classifier.sharkrf.mtry", "The number of features (variables) which will be tested at each node in " @@ -66,7 +66,7 @@ LearningApplicationBase<TInputValue,TOutputValue> //OOB Ratio AddParameter(ParameterType_Float, "classifier.sharkrf.oobr", "Out of bound ratio"); - SetParameterFloat("classifier.sharkrf.oobr", 0.66); + SetParameterFloat("classifier.sharkrf.oobr",0.66, false); SetParameterDescription("classifier.sharkrf.oobr", "Set the fraction of the original training dataset to use as the out of bag sample." "A good default value is 0.66. "); diff --git a/Modules/Applications/AppDimensionalityReduction/app/otbDimensionalityReduction.cxx b/Modules/Applications/AppDimensionalityReduction/app/otbDimensionalityReduction.cxx index b3b15d108f351e616c8bee9a9dd370ffa1814995..18d951eeda4964327c5f97fbceb5fc3cb0bd94df 100644 --- a/Modules/Applications/AppDimensionalityReduction/app/otbDimensionalityReduction.cxx +++ b/Modules/Applications/AppDimensionalityReduction/app/otbDimensionalityReduction.cxx @@ -191,7 +191,7 @@ private: unsigned int nbComp = static_cast<unsigned int> (GetParameterInt("nbcomp")); if (nbComp > nbComponents) { - SetParameterInt("nbcomp", nbComponents); + SetParameterInt("nbcomp",nbComponents, false); otbAppLogINFO( << "number of selected components can't exceed image dimension : "<<nbComponents ); } @@ -201,14 +201,14 @@ private: if (this->GetParameterString("outinv").size()!= 0) { otbAppLogWARNING(<<"This application only provides the forward transform for the MAF method."); - this->SetParameterString("outinv", ""); + this->SetParameterString("outinv", "", false); } this->DisableParameter("outinv"); if (this->GetParameterString("outmatrix").size()!= 0) { otbAppLogWARNING(<<"No transformation matrix available for MAF method."); - this->SetParameterString("outmatrix", ""); + this->SetParameterString("outmatrix", "", false); } this->DisableParameter("outmatrix"); @@ -220,7 +220,7 @@ private: unsigned int nbComp = static_cast<unsigned int> (GetParameterInt("nbcomp")); if ((nbComp != 0) && (nbComp != nbComponents)) { - SetParameterInt("nbcomp", nbComponents); + SetParameterInt("nbcomp",nbComponents, false); otbAppLogINFO( << "all components are kept when using MAF filter method."); } diff --git a/Modules/Applications/AppDomainTransform/app/otbDomainTransform.cxx b/Modules/Applications/AppDomainTransform/app/otbDomainTransform.cxx index 3e791c67826b93a072c48eb1a1b91b6721eb41e4..417861fa8d36762d7fa3405d02a1c70207bb59f8 100644 --- a/Modules/Applications/AppDomainTransform/app/otbDomainTransform.cxx +++ b/Modules/Applications/AppDomainTransform/app/otbDomainTransform.cxx @@ -92,7 +92,7 @@ private: } void DoInit() ITK_OVERRIDE - { + { SetName("DomainTransform"); SetDescription("Domain Transform application for wavelet and fourier"); @@ -104,25 +104,35 @@ private: SetDocSeeAlso("otbWaveletImageFilter, otbWaveletInverseImageFilter, otbWaveletTransform"); AddDocTag(Tags::Filter); + // Parameters AddParameter(ParameterType_InputImage, "in", "Input Image"); SetParameterDescription("in", "This will take an input image to be transformed" " image. For FFT inverse transform, it expects a complex image as two-band" " image in which first band represent real part and second band represent" " imaginary part."); - AddRAMParameter(); + AddParameter(ParameterType_OutputImage, "out", "Output Image"); + SetParameterDescription("out", "This parameter holds the output file name to" + " which transformed image will be written. This has a slightly different" + " behaviour depending on transform type. \n For Wavelet, output is a" + " single band image for both forward and inverse transform. \n For FFT" + " forward transform, output is two band image where first band represents" + " real part and second band represents imaginary part of a complex image."); - AddParameter(ParameterType_Choice, "mode", "mode"); + AddParameter(ParameterType_Choice, "mode", "Mode"); SetParameterDescription("mode", "This parameter allows one to select between" " fft(fourier) and wavelet"); + AddChoice("mode.fft", "FFT transform"); SetParameterDescription("mode.fft", "FFT transform"); - AddParameter(ParameterType_Empty, "mode.fft.shift", "false"); + + AddParameter(ParameterType_Empty, "mode.fft.shift", "Shift fft transform"); SetParameterDescription("mode.fft.shift", "Shift transform of fft filter"); - AddChoice("mode.wavelet", "wavelet"); + + AddChoice("mode.wavelet", "Wavelet"); SetParameterDescription("mode.wavelet", "Wavelet transform"); - AddParameter(ParameterType_Choice, "mode.wavelet.form", "Select wavelet form"); + AddParameter(ParameterType_Choice, "mode.wavelet.form", "Select wavelet form"); AddChoice("mode.wavelet.form.haar", "HAAR"); AddChoice("mode.wavelet.form.db4", "DAUBECHIES4"); AddChoice("mode.wavelet.form.db6", "DAUBECHIES6"); @@ -133,32 +143,25 @@ private: AddChoice("mode.wavelet.form.sb44", "SPLINE_BIORTHOGONAL_4_4"); AddChoice("mode.wavelet.form.sym8", "SYMLET8"); - //Default value - SetParameterString("mode", "wavelet"); - SetParameterString("mode.wavelet.form", "haar"); + // Default values for mode + SetParameterString("mode", "wavelet", false); + SetParameterString("mode.wavelet.form", "haar", false); + + AddParameter(ParameterType_Choice,"direction", "Direction"); + AddChoice("direction.forward", "Forward"); + AddChoice("direction.inverse", "Inverse"); AddParameter(ParameterType_Int,"mode.wavelet.nlevels","Number of decomposition levels"); SetParameterDescription("mode.wavelet.nlevels","Number of decomposition levels"); SetDefaultParameterInt("mode.wavelet.nlevels",2); SetMinimumParameterIntValue("mode.wavelet.nlevels",2); - AddParameter(ParameterType_Choice,"dir", "Direction"); - - AddChoice("dir.fwd", "Forward"); - AddChoice("dir.inv", "Inverse"); - - AddParameter(ParameterType_OutputImage, "out", "Output Image"); - SetParameterDescription("out", "This parameter holds the output file name to" - " which transformed image will be written. This has a slightly different" - " behaviour depending on transform type. \n For Wavelet, output is a" - " single band image for both forward and inverse transform. \n For FFT" - " forward transform, output is two band image where first band represents" - " real part and second band represents imaginary part of a complex image."); + AddRAMParameter(); SetDocExampleParameterValue("in", "input.tif"); SetDocExampleParameterValue("mode.wavelet.form", "haar"); SetDocExampleParameterValue("out", "output_wavelet_haar.tif"); - } + } void DoUpdateParameters() ITK_OVERRIDE { @@ -167,14 +170,14 @@ private: void DoExecute() ITK_OVERRIDE { - int dir = GetParameterInt("dir"); + int dir = GetParameterInt("direction"); int mode = GetParameterInt("mode"); if( dir != 0 && dir != 1) { itkExceptionMacro(<< "-dir is '" << dir << "'." - << "It must be either 'fwd' or 'inv'"); + << "It must be either 'forward' or 'inverse'"); } if( mode != 0 && mode != 1) @@ -252,14 +255,14 @@ private: // fft ttransform bool shift = IsParameterEnabled( "mode.fft.shift"); typedef otb::Image< std::complex<OutputPixelType> > ComplexOutputImageType; - + if (dir == 0 ) { //forward fft typedef otb::Image<InputPixelType> TInputImage; typedef TInputImage::Pointer TInputImagePointer; - //get input paramter as otb::Image<InputPixelType> + //get input parameter as otb::Image<InputPixelType> TInputImagePointer inImage = GetParameterImage<TInputImage>("in"); //typedef itk::::ForwardFFTImageFilter over otbImage< InputPixelType > @@ -268,7 +271,7 @@ private: FFTFilter::Pointer fwdFilter = FFTFilter::New(); fwdFilter->SetInput( inImage ); - + //typedef VectorImage for output of UnaryFunctorImageFilter typedef otb::VectorImage<OutputPixelType> TOutputImage; @@ -276,13 +279,13 @@ private: ComplexOutputImageType, TOutputImage > ComplexToVectorImageCastFilter; ComplexToVectorImageCastFilter::Pointer unaryFunctorImageFilter = ComplexToVectorImageCastFilter::New(); - + if( shift) { otbAppLogINFO( << "Applying Shift image filter" ); typedef itk::FFTShiftImageFilter< - typename FFTFilter::OutputImageType, - typename FFTFilter::OutputImageType > FFTShiftFilterType; + FFTFilter::OutputImageType, + FFTFilter::OutputImageType > FFTShiftFilterType; FFTShiftFilterType::Pointer fftShiftFilter = FFTShiftFilterType::New(); @@ -316,7 +319,7 @@ private: std::complex<InputPixelType>, 2 > TComplexImage; //typedef TOutputImage for InverseFFTImageFilter output typedef otb::Image< OutputPixelType > TOutputImage; - + // a unary functor to convert vectorimage to complex image typedef itk::UnaryFunctorImageFilter <TInputImage, diff --git a/Modules/Applications/AppDomainTransform/test/CMakeLists.txt b/Modules/Applications/AppDomainTransform/test/CMakeLists.txt index e397c71378b543164a511cef1b67c313f7f95bb8..593cf6f458cd2fb143bc7d916a0288efcbc0446e 100644 --- a/Modules/Applications/AppDomainTransform/test/CMakeLists.txt +++ b/Modules/Applications/AppDomainTransform/test/CMakeLists.txt @@ -5,7 +5,7 @@ otb_test_application(NAME apTvDomainTransform_wav_db20_fwd -mode wavelet -mode.wavelet.form db20 -mode.wavelet.nlevels 2 - -dir fwd + -direction forward -out ${TEMP}/apTvDomainTransform_wav_db20_fwd.tif ) @@ -14,7 +14,7 @@ otb_test_application(NAME apTvDomainTransform_wav_haar_inv OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_PAN.tif -mode wavelet -mode.wavelet.form haar - -dir inv + -direction inverse -out ${TEMP}/apTvDomainTransform_wav_haar_inv.tif ) @@ -23,16 +23,16 @@ otb_test_application(NAME apTvDomainTransform_fft_shift_fwd OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_PAN.tif -mode fft -mode.fft.shift true - -dir fwd + -direction forward -out ${TEMP}/apTvDomainTransform_fft_shift_fwd.tif ) - + otb_test_application(NAME apTvDomainTransform_fft_inv APP DomainTransform OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_PAN.tif -mode fft - -dir inv + -direction inverse -out ${TEMP}/apTvDomainTransform_fft_shift_inv.tif ) - + diff --git a/Modules/Applications/AppFiltering/app/otbSmoothing.cxx b/Modules/Applications/AppFiltering/app/otbSmoothing.cxx index 18cd825f50212ee39e70be300824861e15503d23..14e6be72943071e6dc9f8d92299e70ec1209d98e 100644 --- a/Modules/Applications/AppFiltering/app/otbSmoothing.cxx +++ b/Modules/Applications/AppFiltering/app/otbSmoothing.cxx @@ -103,7 +103,7 @@ private: SetDefaultParameterInt("type.anidif.nbiter", 10); SetDefaultParameterInt("type.anidif.conductance", 1.); - SetParameterString("type", "anidif"); + SetParameterString("type", "anidif", false); // Doc example parameter settings SetExampleComment("Image smoothing using a mean filter.", 0); diff --git a/Modules/Applications/AppFusion/app/otbBundleToPerfectSensor.cxx b/Modules/Applications/AppFusion/app/otbBundleToPerfectSensor.cxx index 62741969214b647891ac0bc47f282906080cf86b..48d0c9c0a8f8cd3c133d07ab30ea367e95aaa088 100644 --- a/Modules/Applications/AppFusion/app/otbBundleToPerfectSensor.cxx +++ b/Modules/Applications/AppFusion/app/otbBundleToPerfectSensor.cxx @@ -72,8 +72,8 @@ private: Connect("pansharp.inp","superimpose.inr"); Connect("pansharp.ram","superimpose.ram"); - GetInternalApplication("superimpose")->SetParameterString("interpolator","bco"); - GetInternalApplication("pansharp")->SetParameterString("method","rcs"); + GetInternalApplication("superimpose")->SetParameterString("interpolator","bco", false); + GetInternalApplication("pansharp")->SetParameterString("method","rcs", false); // Doc example parameter settings SetDocExampleParameterValue("inp", "QB_Toulouse_Ortho_PAN.tif"); diff --git a/Modules/Applications/AppHyperspectral/app/otbHyperspectralUnmixing.cxx b/Modules/Applications/AppHyperspectral/app/otbHyperspectralUnmixing.cxx index 750dab500b013de237e0873ca42ee8829384dc2d..403368ec40fcb2f466ec2938d4513ffed9847fc2 100644 --- a/Modules/Applications/AppHyperspectral/app/otbHyperspectralUnmixing.cxx +++ b/Modules/Applications/AppHyperspectral/app/otbHyperspectralUnmixing.cxx @@ -126,7 +126,7 @@ private: AddChoice("ua.mdmdnmf", "MDMDNMF"); SetParameterDescription("ua.mdmdnmf", "Minimum Dispersion Constrained Non Negative Matrix Factorization"); - SetParameterString("ua", "ucls"); + SetParameterString("ua", "ucls", false); // Doc example parameter settings SetDocExampleParameterValue("in", "cupriteSubHsi.tif"); SetDocExampleParameterValue("ie", "cupriteEndmembers.tif"); diff --git a/Modules/Applications/AppHyperspectral/app/otbVertexComponentAnalysis.cxx b/Modules/Applications/AppHyperspectral/app/otbVertexComponentAnalysis.cxx index 8191f40f6242d61e8d90f86e775c0778e614b91b..214c77f4e458bbec05dc6f855821bb12c541c73a 100644 --- a/Modules/Applications/AppHyperspectral/app/otbVertexComponentAnalysis.cxx +++ b/Modules/Applications/AppHyperspectral/app/otbVertexComponentAnalysis.cxx @@ -65,7 +65,7 @@ private: AddParameter(ParameterType_Int, "ne", "Number of endmembers"); SetParameterDescription("ne","The number of endmembers to extract from the data cube"); - SetParameterInt("ne", 1); + SetParameterInt("ne",1, false); MandatoryOn("ne"); AddParameter(ParameterType_OutputImage, "outendm", "Output Endmembers"); diff --git a/Modules/Applications/AppImageUtils/app/otbColorMapping.cxx b/Modules/Applications/AppImageUtils/app/otbColorMapping.cxx index 5be587709679b0ad3f70d7472b2c5a7a24244af6..cd1d0c4e8911de9f5fe253a56b79ba93709dd549 100644 --- a/Modules/Applications/AppImageUtils/app/otbColorMapping.cxx +++ b/Modules/Applications/AppImageUtils/app/otbColorMapping.cxx @@ -342,11 +342,11 @@ private: AddParameter(ParameterType_Float,"method.continuous.min","Mapping range lower value"); SetParameterDescription("method.continuous.min","Set the lower input value of the mapping range."); - SetParameterFloat("method.continuous.min", 0.); + SetParameterFloat("method.continuous.min",0., false); AddParameter(ParameterType_Float,"method.continuous.max","Mapping range higher value"); SetParameterDescription("method.continuous.max","Set the higher input value of the mapping range."); - SetParameterFloat("method.continuous.max", 255.); + SetParameterFloat("method.continuous.max",255., false); // Optimal LUT AddChoice("method.optimal","Compute an optimized look-up table"); @@ -355,7 +355,7 @@ private: "[color to label] Searching all the colors present in the image to compute a continuous label list"); AddParameter(ParameterType_Int,"method.optimal.background", "Background label"); SetParameterDescription("method.optimal.background","Value of the background label"); - SetParameterInt("method.optimal.background", 0); + SetParameterInt("method.optimal.background",0, false); SetMinimumParameterIntValue("method.optimal.background", 0); SetMaximumParameterIntValue("method.optimal.background", 255); @@ -367,18 +367,18 @@ private: AddParameter(ParameterType_Float, "method.image.nodatavalue", "NoData value"); SetParameterDescription("method.image.nodatavalue","NoData value for each channel of the support image, which will not be handled in the LUT estimation. If NOT checked, ALL the pixel values of the support image will be handled in the LUT estimation."); MandatoryOff("method.image.nodatavalue"); - SetParameterFloat("method.image.nodatavalue", 0); + SetParameterFloat("method.image.nodatavalue",0, false); DisableParameter("method.image.nodatavalue"); AddParameter(ParameterType_Int, "method.image.low", "lower quantile"); SetParameterDescription("method.image.low","lower quantile for image normalization"); MandatoryOff("method.image.low"); - SetParameterInt("method.image.low", 2); + SetParameterInt("method.image.low",2, false); SetMinimumParameterIntValue("method.image.low", 0); SetMaximumParameterIntValue("method.image.low", 100); AddParameter(ParameterType_Int, "method.image.up", "upper quantile"); SetParameterDescription("method.image.up","upper quantile for image normalization"); MandatoryOff("method.image.up"); - SetParameterInt("method.image.up", 2); + SetParameterInt("method.image.up",2, false); SetMinimumParameterIntValue("method.image.up", 0); SetMaximumParameterIntValue("method.image.up", 100); @@ -400,7 +400,7 @@ private: if (GetParameterInt("method")==1 || GetParameterInt("method")==3) { otbAppLogWARNING("Override method : use optimal"); - SetParameterInt("method", 2); + SetParameterInt("method",2, false); } } } diff --git a/Modules/Applications/AppImageUtils/app/otbCompareImages.cxx b/Modules/Applications/AppImageUtils/app/otbCompareImages.cxx index 37210b5790277f47898c442b2b0576048fe9c877..b7d34b93bbb52d6b1733e1fbbba6fa9e94acac7a 100644 --- a/Modules/Applications/AppImageUtils/app/otbCompareImages.cxx +++ b/Modules/Applications/AppImageUtils/app/otbCompareImages.cxx @@ -220,10 +220,10 @@ private: otbAppLogINFO( << "PSNR: " << m_CompareFilter->GetPSNR() ); otbAppLogINFO( << "Number of Pixel different: " << m_CompareFilter->GetDiffCount() ); - SetParameterFloat( "mse", m_CompareFilter->GetMSE() ); - SetParameterFloat( "mae", m_CompareFilter->GetMAE() ); - SetParameterFloat( "psnr", m_CompareFilter->GetPSNR() ); - SetParameterFloat( "count", m_CompareFilter->GetDiffCount() ); + SetParameterFloat( "mse",m_CompareFilter->GetMSE() , false); + SetParameterFloat( "mae",m_CompareFilter->GetMAE() , false); + SetParameterFloat( "psnr",m_CompareFilter->GetPSNR() , false); + SetParameterFloat( "count",m_CompareFilter->GetDiffCount() , false); } diff --git a/Modules/Applications/AppImageUtils/app/otbConvert.cxx b/Modules/Applications/AppImageUtils/app/otbConvert.cxx index c5ec7a20bc3a6fbd26880c2294a387024579640b..085fe5db06158ac110424666d2100b4b32fbd546 100644 --- a/Modules/Applications/AppImageUtils/app/otbConvert.cxx +++ b/Modules/Applications/AppImageUtils/app/otbConvert.cxx @@ -99,7 +99,7 @@ private: AddChoice("type.none", "None"); AddChoice("type.linear", "Linear"); AddChoice("type.log2", "Log2"); - SetParameterString("type", "none"); + SetParameterString("type", "none", false); AddParameter(ParameterType_Float,"type.linear.gamma","Gamma correction factor"); SetParameterDescription("type.linear.gamma","Gamma correction factor"); diff --git a/Modules/Applications/AppImageUtils/app/otbExtractROI.cxx b/Modules/Applications/AppImageUtils/app/otbExtractROI.cxx index 8a3bc91d200271f629acfb2e5341a8bdb35c104a..4983ff4dc1f26bf7b00549e38b0f1049fe5fa83a 100644 --- a/Modules/Applications/AppImageUtils/app/otbExtractROI.cxx +++ b/Modules/Applications/AppImageUtils/app/otbExtractROI.cxx @@ -126,8 +126,8 @@ private: if (!HasUserValue("sizex") && !HasUserValue("sizey") ) { - SetParameterInt("sizex", largestRegion.GetSize()[0]); - SetParameterInt("sizey", largestRegion.GetSize()[1]); + SetParameterInt("sizex",largestRegion.GetSize()[0], false); + SetParameterInt("sizey",largestRegion.GetSize()[1], false); } unsigned int nbComponents = inImage->GetNumberOfComponentsPerPixel(); @@ -164,8 +164,8 @@ private: if(!this->CropRegionOfInterest()) { // Put the index of the ROI to origin and try to crop again - SetParameterInt("startx", 0); - SetParameterInt("starty", 0); + SetParameterInt("startx",0, false); + SetParameterInt("starty",0, false); this->CropRegionOfInterest(); } } @@ -209,10 +209,10 @@ private: { if (region.Crop(GetParameterImage("in")->GetLargestPossibleRegion())) { - SetParameterInt("sizex", region.GetSize(0)); - SetParameterInt("sizey", region.GetSize(1)); - SetParameterInt("startx", region.GetIndex(0)); - SetParameterInt("starty", region.GetIndex(1)); + SetParameterInt("sizex",region.GetSize(0), HasUserValue("sizex")); + SetParameterInt("sizey",region.GetSize(1), HasUserValue("sizey")); + SetParameterInt("startx",region.GetIndex(0), HasUserValue("startx")); + SetParameterInt("starty",region.GetIndex(1), HasUserValue("starty")); return true; } } diff --git a/Modules/Applications/AppImageUtils/app/otbManageNoData.cxx b/Modules/Applications/AppImageUtils/app/otbManageNoData.cxx index 03d98cf42bb1fd1577fd65be9731192b35155d82..5611b960aa02194370a4d11d684e857b4f5c2742 100644 --- a/Modules/Applications/AppImageUtils/app/otbManageNoData.cxx +++ b/Modules/Applications/AppImageUtils/app/otbManageNoData.cxx @@ -109,7 +109,7 @@ private: SetParameterDescription("mode.apply.ndval","No Data value used according to the mask image"); SetDefaultParameterFloat("mode.apply.ndval", 0.0); - SetParameterString("mode","buildmask"); + SetParameterString("mode","buildmask", false); AddRAMParameter(); diff --git a/Modules/Applications/AppImageUtils/app/otbPixelValue.cxx b/Modules/Applications/AppImageUtils/app/otbPixelValue.cxx index f616b678864604ba6c759d067ebe171cc580235b..ed170b21e63896ea5562165d5fe08bbf93444086 100644 --- a/Modules/Applications/AppImageUtils/app/otbPixelValue.cxx +++ b/Modules/Applications/AppImageUtils/app/otbPixelValue.cxx @@ -147,7 +147,7 @@ private: std::ostringstream oss; oss << extractor->GetOutput()->GetPixel(id)<<std::endl; - SetParameterString("value", oss.str()); + SetParameterString("value", oss.str(), false); //Display image information in the dedicated logger otbAppLogINFO( << oss.str() ); diff --git a/Modules/Applications/AppImageUtils/app/otbQuicklook.cxx b/Modules/Applications/AppImageUtils/app/otbQuicklook.cxx index 7c3677041f526f47dbad77da25e6b96344ebdd3a..03d9ef4e2ac0d73c4533a20bc2aca1badc44d092 100644 --- a/Modules/Applications/AppImageUtils/app/otbQuicklook.cxx +++ b/Modules/Applications/AppImageUtils/app/otbQuicklook.cxx @@ -141,8 +141,8 @@ private: if (!HasUserValue("rsx") && !HasUserValue("rsy") ) { - SetParameterInt("rsx", largestRegion.GetSize()[0]); - SetParameterInt("rsy", largestRegion.GetSize()[1]); + SetParameterInt("rsx",largestRegion.GetSize()[0], false); + SetParameterInt("rsy",largestRegion.GetSize()[1], false); } // Put the limit of the index and the size relative the image @@ -163,8 +163,8 @@ private: if(!this->CropRegionOfInterest()) { // Put the index of the ROI to origin and try to crop again - SetParameterInt("rox", 0); - SetParameterInt("roy", 0); + SetParameterInt("rox",0, false); + SetParameterInt("roy",0, false); this->CropRegionOfInterest(); } } @@ -183,10 +183,10 @@ bool CropRegionOfInterest() { if (region.Crop(GetParameterImage("in")->GetLargestPossibleRegion())) { - SetParameterInt("rsx", region.GetSize(0)); - SetParameterInt("rsy", region.GetSize(1)); - SetParameterInt("rox", region.GetIndex(0)); - SetParameterInt("roy", region.GetIndex(1)); + SetParameterInt( "rsx", region.GetSize(0), HasUserValue("rsx") ); + SetParameterInt( "rsy", region.GetSize(1), HasUserValue("rsy") ); + SetParameterInt( "rox", region.GetIndex(0), HasUserValue("rox") ); + SetParameterInt( "roy", region.GetIndex(1), HasUserValue("roy") ); return true; } } diff --git a/Modules/Applications/AppImageUtils/app/otbReadImageInfo.cxx b/Modules/Applications/AppImageUtils/app/otbReadImageInfo.cxx index aaa1143fb52239e13ece0aed69ab33829a49280a..8c78a284ec289951807ea4f064149b1cc6a1fde2 100644 --- a/Modules/Applications/AppImageUtils/app/otbReadImageInfo.cxx +++ b/Modules/Applications/AppImageUtils/app/otbReadImageInfo.cxx @@ -262,7 +262,7 @@ private: ImageMetadataInterfaceType::Pointer metadataInterface = ImageMetadataInterfaceFactory::CreateIMI(inImage->GetMetaDataDictionary()); //Get number of bands - SetParameterInt("numberbands", inImage->GetNumberOfComponentsPerPixel()); + SetParameterInt("numberbands",inImage->GetNumberOfComponentsPerPixel(), false); ossOutput << "\tNumber of bands : " << GetParameterInt("numberbands") << std::endl; std::vector<bool> noDataValueAvailable; bool ret = itk::ExposeMetaData<std::vector<bool> >(inImage->GetMetaDataDictionary(),MetaDataKey::NoDataValueAvailable,noDataValueAvailable); @@ -293,26 +293,26 @@ private: ossOutput<<std::endl; //Get image size - SetParameterInt("indexx", inImage->GetLargestPossibleRegion().GetIndex()[0]); - SetParameterInt("indexy", inImage->GetLargestPossibleRegion().GetIndex()[1]); + SetParameterInt("indexx",inImage->GetLargestPossibleRegion().GetIndex()[0], false); + SetParameterInt("indexy",inImage->GetLargestPossibleRegion().GetIndex()[1], false); ossOutput << "\tStart index : [" << GetParameterInt("indexx") << "," << GetParameterInt("indexy") << "]" << std::endl; //Get image size - SetParameterInt("sizex", inImage->GetLargestPossibleRegion().GetSize()[0]); - SetParameterInt("sizey", inImage->GetLargestPossibleRegion().GetSize()[1]); + SetParameterInt("sizex",inImage->GetLargestPossibleRegion().GetSize()[0], false); + SetParameterInt("sizey",inImage->GetLargestPossibleRegion().GetSize()[1], false); ossOutput << "\tSize : [" << GetParameterInt("sizex") << "," << GetParameterInt("sizey") << "]" << std::endl; //Get image origin - SetParameterFloat("originx", inImage->GetOrigin()[0]); - SetParameterFloat("originy", inImage->GetOrigin()[1]); + SetParameterFloat("originx",inImage->GetOrigin()[0], false); + SetParameterFloat("originy",inImage->GetOrigin()[1], false); ossOutput << "\tOrigin : [" << GetParameterFloat("originx") << "," << GetParameterFloat("originy") << "]" << std::endl; //Get image spacing - SetParameterFloat("spacingx", inImage->GetSpacing()[0]); - SetParameterFloat("spacingy", inImage->GetSpacing()[1]); + SetParameterFloat("spacingx",inImage->GetSpacing()[0], false); + SetParameterFloat("spacingy",inImage->GetSpacing()[1], false); ossOutput << "\tSpacing : [" << GetParameterFloat("spacingx") << "," << GetParameterFloat("spacingy") << "]" << std::endl; //Estimate ground spacing @@ -331,14 +331,14 @@ private: approxGroundSpacing = groundSpacing->EvaluateAtIndex(index); //Get image estimated ground spacing (in m) - SetParameterFloat("estimatedgroundspacingx", approxGroundSpacing[0]); - SetParameterFloat("estimatedgroundspacingy", approxGroundSpacing[1]); + SetParameterFloat("estimatedgroundspacingx",approxGroundSpacing[0], false); + SetParameterFloat("estimatedgroundspacingy",approxGroundSpacing[1], false); ossOutput << "\tEstimated ground spacing (in meters): [" << GetParameterFloat("estimatedgroundspacingx") << "," << GetParameterFloat("estimatedgroundspacingy") << "]" << std::endl; ossOutput << std::endl << "Image acquisition information:" << std::endl; - SetParameterString("sensor", metadataInterface->GetSensorID()); + SetParameterString("sensor", metadataInterface->GetSensorID(), false); ossOutput << "\tSensor : "; if (!GetParameterString("sensor").empty()) ossOutput << GetParameterString("sensor"); @@ -348,11 +348,11 @@ private: ossOutput << "\tImage identification number: "; if (metadataInterface->GetImageKeywordlist().HasKey("image_id")) { - SetParameterString("id", metadataInterface->GetImageKeywordlist().GetMetadataByKey("image_id")); + SetParameterString("id", metadataInterface->GetImageKeywordlist().GetMetadataByKey("image_id"), false); ossOutput << GetParameterString("id"); } ossOutput << std::endl; - SetParameterString("projectionref", metadataInterface->GetProjectionRef()); + SetParameterString("projectionref", metadataInterface->GetProjectionRef(), false); if (!GetParameterString("projectionref").empty()) ossOutput << "\tImage projection : " << GetParameterString("projectionref") << std::endl; @@ -376,7 +376,7 @@ private: osstime<<"0"; osstime<<metadataInterface->GetMinute(); osstime<<":00"; - SetParameterString("time", osstime.str()); + SetParameterString("time", osstime.str(), false); ossOutput << "\tAcquisition time : " << GetParameterString("time") << std::endl; } @@ -405,29 +405,29 @@ private: if( !coord2name->GetCountryName().empty() ) { - SetParameterString("country", coord2name->GetCountryName()); + SetParameterString("country", coord2name->GetCountryName(), false); ossOutput << "\tCountry : " << GetParameterString("country") << std::endl; } else - SetParameterString("country", "Not available"); + SetParameterString("country", "Not available", false); if( !coord2name->GetPlaceName().empty() ) { - SetParameterString("town", coord2name->GetPlaceName()); + SetParameterString("town", coord2name->GetPlaceName(), false); ossOutput << "\tTown : " << GetParameterString("town") << std::endl; } else - SetParameterString("town", "Not available"); + SetParameterString("town", "Not available", false); // Retrieve footprint - SetParameterFloat("ullat", ullat); - SetParameterFloat("ullon", ullon); - SetParameterFloat("urlat", urlat); - SetParameterFloat("urlon", urlon); - SetParameterFloat("lrlat", lrlat); - SetParameterFloat("lrlon", lrlon); - SetParameterFloat("lllat", lllat); - SetParameterFloat("lllon", lllon); + SetParameterFloat("ullat",ullat, false); + SetParameterFloat("ullon",ullon, false); + SetParameterFloat("urlat",urlat, false); + SetParameterFloat("urlon",urlon, false); + SetParameterFloat("lrlat",lrlat, false); + SetParameterFloat("lrlon",lrlon, false); + SetParameterFloat("lllat",lllat, false); + SetParameterFloat("lllon",lllon, false); ossOutput << std::endl << "Image footprint coordinates:" << std::endl; ossOutput << "\tUpper left corner (latitude, longitude) = [" << GetParameterFloat("ullat") << "," << GetParameterFloat("ullon") << "]" << std::endl; @@ -439,15 +439,15 @@ private: { } - SetParameterInt("rgb.r", metadataInterface->GetDefaultDisplay()[0]); - SetParameterInt("rgb.g", metadataInterface->GetDefaultDisplay()[1]); - SetParameterInt("rgb.b", metadataInterface->GetDefaultDisplay()[2]); + SetParameterInt("rgb.r",metadataInterface->GetDefaultDisplay()[0], false); + SetParameterInt("rgb.g",metadataInterface->GetDefaultDisplay()[1], false); + SetParameterInt("rgb.b",metadataInterface->GetDefaultDisplay()[2], false); ossOutput << std::endl << "Image default RGB composition:" << std::endl; ossOutput << "\t[R, G, B] = [" << GetParameterInt("rgb.r") << "," << GetParameterInt("rgb.g") << "," << GetParameterInt("rgb.b") << "]" << std::endl; - SetParameterInt("gcp.count", metadataInterface->GetGCPCount()); - SetParameterString("gcp.proj", metadataInterface->GetGCPProjection()); + SetParameterInt("gcp.count",metadataInterface->GetGCPCount(), false); + SetParameterString("gcp.proj", metadataInterface->GetGCPProjection(), false); ossOutput << std::endl << "Ground control points information:" << std::endl; ossOutput << "\tNumber of GCPs = " << GetParameterInt("gcp.count") << std::endl; @@ -476,16 +476,16 @@ private: ossOutput << "\t\tGround coordinates =" << gcp_geocoord.back() << std::endl; } - SetParameterStringList("gcp.ids", gcp_ids); - SetParameterStringList("gcp.imcoord", gcp_imcoord); - SetParameterStringList("gcp.geocoord", gcp_geocoord); - SetParameterStringList("gcp.info", gcp_infos); + SetParameterStringList("gcp.ids", gcp_ids, false); + SetParameterStringList("gcp.imcoord", gcp_imcoord, false); + SetParameterStringList("gcp.geocoord", gcp_geocoord, false); + SetParameterStringList("gcp.info", gcp_infos, false); if ( IsParameterEnabled("keywordlist") ) { std::ostringstream osskeywordlist; osskeywordlist<<metadataInterface->GetImageKeywordlist() << std::endl; - SetParameterString("keyword", osskeywordlist.str()); + SetParameterString("keyword", osskeywordlist.str(), false); ossOutput << std::endl << "Image OSSIM keywordlist (optional):" << std::endl; ossOutput << "\t" << GetParameterString("keyword") << std::endl; diff --git a/Modules/Applications/AppImageUtils/app/otbRescale.cxx b/Modules/Applications/AppImageUtils/app/otbRescale.cxx index ea109547cf8cba64d6e9775436ad18aafeb4d6f3..21ada14c85674bff0b3795578f7dc7c1ec619cfe 100644 --- a/Modules/Applications/AppImageUtils/app/otbRescale.cxx +++ b/Modules/Applications/AppImageUtils/app/otbRescale.cxx @@ -52,8 +52,9 @@ private: SetDescription("Rescale the image between two given values."); SetDocName("Rescale Image"); - SetDocLongDescription("This application scales the given image pixel intensity between two given values. " - "By default min (resp. max) value is set to 0 (resp. 255)."); + SetDocLongDescription("This application scales the given image pixel intensity between two given values.\n" + "By default min (resp. max) value is set to 0 (resp. 255).\n" + "Input minimum and maximum values is automatically computed for all image bands."); SetDocLimitations("None"); SetDocAuthors("OTB-Team"); SetDocSeeAlso(" "); @@ -109,6 +110,7 @@ private: m_RescaleFilter = RescaleImageFilterType::New(); m_RescaleFilter->SetInput( inImage ); + m_RescaleFilter->SetAutomaticInputMinMaxComputation(false); m_RescaleFilter->SetInputMinimum( m_MinMaxFilter->GetMinimum() ); m_RescaleFilter->SetInputMaximum( m_MinMaxFilter->GetMaximum() ); diff --git a/Modules/Applications/AppMathParserX/app/otbBandMathX.cxx b/Modules/Applications/AppMathParserX/app/otbBandMathX.cxx index 19ef784627e25fa05532510984377a1705074f75..53884d3afa94e2455f1a94dc940e44949bff1168 100644 --- a/Modules/Applications/AppMathParserX/app/otbBandMathX.cxx +++ b/Modules/Applications/AppMathParserX/app/otbBandMathX.cxx @@ -209,7 +209,7 @@ private: if (useContext) { // only set the first expression, 'ManyExpression' is disabled. - this->SetParameterString("exp",dummyFilter->GetExpression(0)); + this->SetParameterString("exp",dummyFilter->GetExpression(0), false); } } } diff --git a/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx b/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx index 10004ff35386d3add63f0cb6eef784ceacabac5a..52dd349396c57ebc48d03ae629ee5a13e8a5bfd9 100644 --- a/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx +++ b/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx @@ -194,7 +194,7 @@ private: AddChoice("level.toa", "Image to Top Of Atmosphere reflectance"); AddChoice("level.toatoim", "TOA reflectance to Image"); AddChoice("level.toc", "Image to Top Of Canopy reflectance (atmospheric corrections)"); - SetParameterString("level", "toa"); + SetParameterString("level", "toa", false); AddParameter(ParameterType_Empty, "milli", "Convert to milli reflectance"); SetParameterDescription("milli", "Flag to use milli-reflectance instead of reflectance.\n" @@ -424,21 +424,21 @@ private: ossOutput << "Acquisition Minute already set by user: no overload" <<std::endl; else { - SetParameterInt("acqui.minute", lImageMetadataInterface->GetMinute()); + SetParameterInt("acqui.minute",lImageMetadataInterface->GetMinute(), false); } if (HasUserValue("acqui.hour")) ossOutput << "Acquisition Hour already set by user: no overload" <<std::endl; else { - SetParameterInt("acqui.hour", lImageMetadataInterface->GetHour()); + SetParameterInt("acqui.hour",lImageMetadataInterface->GetHour(), false); } if (HasUserValue("acqui.day")) ossOutput << "Acquisition Day already set by user: no overload" <<std::endl; else { - SetParameterInt("acqui.day", lImageMetadataInterface->GetDay()); + SetParameterInt("acqui.day",lImageMetadataInterface->GetDay(), false); if (IsParameterEnabled("acqui.fluxnormcoeff")) DisableParameter("acqui.day"); } @@ -447,7 +447,7 @@ private: ossOutput << "Acquisition Month already set by user: no overload" <<std::endl; else { - SetParameterInt("acqui.month", lImageMetadataInterface->GetMonth()); + SetParameterInt("acqui.month",lImageMetadataInterface->GetMonth(), false); if (IsParameterEnabled("acqui.fluxnormcoeff")) DisableParameter("acqui.month"); } @@ -456,28 +456,28 @@ private: ossOutput << "Acquisition Year already set by user: no overload" <<std::endl; else { - SetParameterInt("acqui.year", lImageMetadataInterface->GetYear()); + SetParameterInt("acqui.year",lImageMetadataInterface->GetYear(), false); } if (HasUserValue("acqui.sun.elev")) ossOutput << "Acquisition Sun Elevation Angle already set by user: no overload" <<std::endl; else - SetParameterFloat("acqui.sun.elev", lImageMetadataInterface->GetSunElevation()); + SetParameterFloat("acqui.sun.elev",lImageMetadataInterface->GetSunElevation(), false); if (HasUserValue("acqui.sun.azim")) ossOutput << "Acquisition Sun Azimuth Angle already set by user: no overload" <<std::endl; else - SetParameterFloat("acqui.sun.azim", lImageMetadataInterface->GetSunAzimuth()); + SetParameterFloat("acqui.sun.azim",lImageMetadataInterface->GetSunAzimuth(), false); if (HasUserValue("acqui.view.elev")) ossOutput << "Acquisition Viewing Elevation Angle already set by user: no overload" <<std::endl; else - SetParameterFloat("acqui.view.elev", lImageMetadataInterface->GetSatElevation()); + SetParameterFloat("acqui.view.elev",lImageMetadataInterface->GetSatElevation(), false); if (HasUserValue("acqui.view.azim")) ossOutput << "Acquisition Viewing Azimuth Angle already set by user: no overload" <<std::endl; else - SetParameterFloat("acqui.view.azim", lImageMetadataInterface->GetSatAzimuth()); + SetParameterFloat("acqui.view.azim",lImageMetadataInterface->GetSatAzimuth(), false); // Set default value so that they are stored somewhere even if // they are overloaded by user values @@ -823,12 +823,14 @@ private: { otbAppLogWARNING("No relative spectral response found, using " "default response (constant between 0.3 and 1.0µm)"); - AcquiCorrectionParametersType::WavelengthSpectralBandVectorType spectralDummy; + AcquiCorrectionParametersType::WavelengthSpectralBandVectorType spectralDummy = + AcquiCorrectionParametersType::InternalWavelengthSpectralBandVectorType::New(); spectralDummy->Clear(); for (unsigned int i = 0; i < inImage->GetNumberOfComponentsPerPixel(); ++i) { spectralDummy->PushBack(FilterFunctionValues::New()); } + m_paramAcqui->SetWavelengthSpectralBand(spectralDummy); } // Aeronet file diff --git a/Modules/Applications/AppProjection/app/otbConvertCartoToGeoPoint.cxx b/Modules/Applications/AppProjection/app/otbConvertCartoToGeoPoint.cxx index 718d79168034d56ea72abadfa55c8aead3f81e1c..819b035884da04e9caeffd2dad3f9f5673e06af9 100644 --- a/Modules/Applications/AppProjection/app/otbConvertCartoToGeoPoint.cxx +++ b/Modules/Applications/AppProjection/app/otbConvertCartoToGeoPoint.cxx @@ -117,8 +117,8 @@ private: otbAppLogINFO( << std::setprecision(10) << "Geographic Point (Long, Lat) : (" << geoPoint[0] << ", " << geoPoint[1] << ")" ); - SetParameterFloat( "long", geoPoint[0] ); - SetParameterFloat( "lat", geoPoint[1] ); + SetParameterFloat( "long",geoPoint[0] , false); + SetParameterFloat( "lat",geoPoint[1] , false); } }; diff --git a/Modules/Applications/AppProjection/app/otbConvertSensorToGeoPoint.cxx b/Modules/Applications/AppProjection/app/otbConvertSensorToGeoPoint.cxx index 3b3140b2b1c614000e4f4d193cc852e64974e4a0..be3f19a20f2c6524b8dd7e126103f4c3b60b3ceb 100644 --- a/Modules/Applications/AppProjection/app/otbConvertSensorToGeoPoint.cxx +++ b/Modules/Applications/AppProjection/app/otbConvertSensorToGeoPoint.cxx @@ -125,8 +125,8 @@ private: outputPoint = model->TransformPoint(point); // Set the value computed - SetParameterFloat("output.idx", outputPoint[0]); - SetParameterFloat("output.idy", outputPoint[1]); + SetParameterFloat("output.idx",outputPoint[0], false); + SetParameterFloat("output.idy",outputPoint[1], false); // Set the town and the neaerest city CoordinateToName::Pointer coord2name = CoordinateToName::New(); @@ -134,8 +134,8 @@ private: coord2name->SetLat(outputPoint[1]); coord2name->Evaluate(); - SetParameterString("output.town", coord2name->GetPlaceName()); - SetParameterString("output.country", coord2name->GetCountryName()); + SetParameterString("output.town", coord2name->GetPlaceName(), false); + SetParameterString("output.country", coord2name->GetCountryName(), false); } }; diff --git a/Modules/Applications/AppProjection/app/otbGenerateRPCSensorModel.cxx b/Modules/Applications/AppProjection/app/otbGenerateRPCSensorModel.cxx index be181ebb320b2b4fe0f97d48c0e836f42512e73d..f640e072e7441bc60430c89333640061364c7bae 100644 --- a/Modules/Applications/AppProjection/app/otbGenerateRPCSensorModel.cxx +++ b/Modules/Applications/AppProjection/app/otbGenerateRPCSensorModel.cxx @@ -60,7 +60,13 @@ private: SetDescription("Generate a RPC sensor model from a list of Ground Control Points."); SetDocName("Generate a RPC sensor model"); - SetDocLongDescription("This application generates a RPC sensor model from a list of Ground Control Points. At least 20 points are required for estimation wihtout elevation support, and 40 points for estimation with elevation support. Elevation support will be automatically deactivated if an insufficient amount of points is provided. The application can optionnaly output a file containing accuracy statistics for each point, and a vector file containing segments represening points residues. The map projection parameter allows defining a map projection in which the accuracy is evaluated."); + SetDocLongDescription( "This application generates a RPC sensor model from a list of Ground Control Points. " + "At least 20 points are required for estimation without elevation support, " + "and 40 points for estimation with elevation support. " + "Elevation support will be automatically deactivated if an insufficient amount of points is provided. " + "The application can optionally output a file containing accuracy statistics for each point," + " and a vector file containing segments representing points residues. " + "The map projection parameter allows defining a map projection in which the accuracy is evaluated." ); AddDocTag(Tags::Geometry); @@ -72,7 +78,7 @@ private: SetParameterDescription("outgeom","Geom file containing the generated RPC sensor model"); AddParameter(ParameterType_InputFilename,"inpoints","Input file containing tie points"); - SetParameterDescription("inpoints","Input file containing tie points. Points are stored in following format: col row lon lat. Line beginning with # are ignored."); + SetParameterDescription("inpoints","Input file containing tie points. Points are stored in following format: col row lon lat. Spaced by a space or tab character. Line beginning with # are ignored."); AddParameter(ParameterType_OutputFilename,"outstat","Output file containing output precision statistics"); SetParameterDescription("outstat","Output file containing the following info: ref_lon ref_lat elevation predicted_lon predicted_lat x_error_ref(meters) y_error_ref(meters) global_error_ref(meters) x_error(meters) y_error(meters) overall_error(meters)"); @@ -125,20 +131,8 @@ private: // Avoid commented lines or too short ones if (!line.empty() && line[0] != '#') { - // retrieve the x component - std::string::size_type pos = 0; - std::string::size_type nextpos = line.find_first_of("\t", pos); - x = atof(line.substr(pos, nextpos).c_str()); - pos = nextpos + 1; - nextpos = line.find_first_of("\t", pos); - y = atof(line.substr(pos, nextpos).c_str()); - pos = nextpos + 1; - nextpos = line.find_first_of("\t", pos); - lon = atof(line.substr(pos, nextpos).c_str()); - pos = nextpos + 1; - nextpos = line.find_first_of("\t", pos); - lat = atof(line.substr(pos, nextpos).c_str()); - + std::istringstream iss(line); + iss >> x >> y >> lon >> lat; z = otb::DEMHandler::Instance()->GetHeightAboveEllipsoid(lon,lat); otbAppLogINFO("Adding tie point x="<<x<<", y="<<y<<", z="<<z<<", lon="<<lon<<", lat="<<lat); diff --git a/Modules/Applications/AppProjection/app/otbGridBasedImageResampling.cxx b/Modules/Applications/AppProjection/app/otbGridBasedImageResampling.cxx index 5d782b3d17d1f5cfcf31613172cea5d2e42791c1..5a3286c4664ee2b0a87e17faa9b03fe604e62e54 100644 --- a/Modules/Applications/AppProjection/app/otbGridBasedImageResampling.cxx +++ b/Modules/Applications/AppProjection/app/otbGridBasedImageResampling.cxx @@ -170,7 +170,7 @@ private: AddParameter(ParameterType_Radius, "interpolator.bco.radius", "Radius for bicubic interpolation"); SetParameterDescription("interpolator.bco.radius","This parameter allows controlling the size of the bicubic interpolation filter. If the target pixel size is higher than the input pixel size, increasing this parameter will reduce aliasing artifacts."); SetDefaultParameterInt("interpolator.bco.radius", 2); - SetParameterString("interpolator","bco"); + SetParameterString("interpolator","bco", false); AddRAMParameter(); diff --git a/Modules/Applications/AppProjection/app/otbObtainUTMZoneFromGeoPoint.cxx b/Modules/Applications/AppProjection/app/otbObtainUTMZoneFromGeoPoint.cxx index e31337346082e978c70673002df5074802f12500..acfb9028faf1690c3f556225f45ec7ad6e04f188 100644 --- a/Modules/Applications/AppProjection/app/otbObtainUTMZoneFromGeoPoint.cxx +++ b/Modules/Applications/AppProjection/app/otbObtainUTMZoneFromGeoPoint.cxx @@ -89,7 +89,7 @@ private: { int utmZone = otb::Utils::GetZoneFromGeoPoint(GetParameterFloat("lon"), GetParameterFloat("lat")); - SetParameterInt("utm", utmZone); + SetParameterInt("utm",utmZone, false); } }; diff --git a/Modules/Applications/AppProjection/app/otbOrthoRectification.cxx b/Modules/Applications/AppProjection/app/otbOrthoRectification.cxx index e94168465dba16134a52a42901156dc430521b67..4e0b6b56f56c8d40c5e68503e3f844e84c1ed9e9 100644 --- a/Modules/Applications/AppProjection/app/otbOrthoRectification.cxx +++ b/Modules/Applications/AppProjection/app/otbOrthoRectification.cxx @@ -235,6 +235,11 @@ private: { if (HasValue("io.in")) { + + // Clear and reset the DEM Handler + otb::DEMHandler::Instance()->ClearDEMs(); + otb::Wrapper::ElevationParametersHandler::SetupDEMHandlerFromElevationParameters(this,"elev"); + // input image FloatVectorImageType::Pointer inImage = GetParameterImage("io.in"); @@ -263,28 +268,28 @@ private: // Fill the Gui with the computed parameters if (!HasUserValue("outputs.sizex")) - SetParameterInt("outputs.sizex", genericRSEstimator->GetOutputSize()[0]); + SetParameterInt("outputs.sizex",genericRSEstimator->GetOutputSize()[0], false); if (!HasUserValue("outputs.sizey")) - SetParameterInt("outputs.sizey", genericRSEstimator->GetOutputSize()[1]); + SetParameterInt("outputs.sizey",genericRSEstimator->GetOutputSize()[1], false); if (!HasUserValue("outputs.spacingx")) - SetParameterFloat("outputs.spacingx", genericRSEstimator->GetOutputSpacing()[0]); + SetParameterFloat("outputs.spacingx",genericRSEstimator->GetOutputSpacing()[0], false); if (!HasUserValue("outputs.spacingy")) - SetParameterFloat("outputs.spacingy", genericRSEstimator->GetOutputSpacing()[1]); + SetParameterFloat("outputs.spacingy",genericRSEstimator->GetOutputSpacing()[1], false); if (!HasUserValue("outputs.ulx")) - SetParameterFloat("outputs.ulx", genericRSEstimator->GetOutputOrigin()[0] - 0.5 * genericRSEstimator->GetOutputSpacing()[0]); + SetParameterFloat("outputs.ulx",genericRSEstimator->GetOutputOrigin()[0] - 0.5 * genericRSEstimator->GetOutputSpacing()[0], false); if (!HasUserValue("outputs.uly")) - SetParameterFloat("outputs.uly", genericRSEstimator->GetOutputOrigin()[1] - 0.5 * genericRSEstimator->GetOutputSpacing()[1]); + SetParameterFloat("outputs.uly",genericRSEstimator->GetOutputOrigin()[1] - 0.5 * genericRSEstimator->GetOutputSpacing()[1], false); if (!HasUserValue("outputs.lrx")) - SetParameterFloat("outputs.lrx", GetParameterFloat("outputs.ulx") + GetParameterFloat("outputs.spacingx") * static_cast<double>(GetParameterInt("outputs.sizex"))); + SetParameterFloat("outputs.lrx",GetParameterFloat("outputs.ulx") + GetParameterFloat("outputs.spacingx") * static_cast<double>(GetParameterInt("outputs.sizex")), false); if (!HasUserValue("outputs.lry")) - SetParameterFloat("outputs.lry", GetParameterFloat("outputs.uly") + GetParameterFloat("outputs.spacingy") * static_cast<double>(GetParameterInt("outputs.sizey"))); + SetParameterFloat("outputs.lry",GetParameterFloat("outputs.uly") + GetParameterFloat("outputs.spacingy") * static_cast<double>(GetParameterInt("outputs.sizey")), false); // Handle the spacing and size field following the mode // chose by the user @@ -325,8 +330,8 @@ private: MandatoryOff("outputs.ortho"); // Update lower right - SetParameterFloat("outputs.lrx", GetParameterFloat("outputs.ulx") + GetParameterFloat("outputs.spacingx") * static_cast<double>(GetParameterInt("outputs.sizex"))); - SetParameterFloat("outputs.lry", GetParameterFloat("outputs.uly") + GetParameterFloat("outputs.spacingy") * static_cast<double>(GetParameterInt("outputs.sizey"))); + SetParameterFloat("outputs.lrx",GetParameterFloat("outputs.ulx") + GetParameterFloat("outputs.spacingx") * static_cast<double>(GetParameterInt("outputs.sizex")), false); + SetParameterFloat("outputs.lry",GetParameterFloat("outputs.uly") + GetParameterFloat("outputs.spacingy") * static_cast<double>(GetParameterInt("outputs.sizey")), false); } break; case Mode_AutomaticSize: @@ -371,16 +376,16 @@ private: genericRSEstimator->Compute(); // Set the processed size relative to this forced spacing - SetParameterInt("outputs.sizex", genericRSEstimator->GetOutputSize()[0]); - SetParameterInt("outputs.sizey", genericRSEstimator->GetOutputSize()[1]); + SetParameterInt("outputs.sizex",genericRSEstimator->GetOutputSize()[0], false); + SetParameterInt("outputs.sizey",genericRSEstimator->GetOutputSize()[1], false); // Reset Origin to default - SetParameterFloat("outputs.ulx", genericRSEstimator->GetOutputOrigin()[0] - 0.5 * genericRSEstimator->GetOutputSpacing()[0]); - SetParameterFloat("outputs.uly", genericRSEstimator->GetOutputOrigin()[1] - 0.5 * genericRSEstimator->GetOutputSpacing()[1]); + SetParameterFloat("outputs.ulx",genericRSEstimator->GetOutputOrigin()[0] - 0.5 * genericRSEstimator->GetOutputSpacing()[0], false); + SetParameterFloat("outputs.uly",genericRSEstimator->GetOutputOrigin()[1] - 0.5 * genericRSEstimator->GetOutputSpacing()[1], false); // Update lower right - SetParameterFloat("outputs.lrx", GetParameterFloat("outputs.ulx") + GetParameterFloat("outputs.spacingx") * static_cast<double>(GetParameterInt("outputs.sizex"))); - SetParameterFloat("outputs.lry", GetParameterFloat("outputs.uly") + GetParameterFloat("outputs.spacingy") * static_cast<double>(GetParameterInt("outputs.sizey"))); + SetParameterFloat("outputs.lrx",GetParameterFloat("outputs.ulx") + GetParameterFloat("outputs.spacingx") * static_cast<double>(GetParameterInt("outputs.sizex")), false); + SetParameterFloat("outputs.lry",GetParameterFloat("outputs.uly") + GetParameterFloat("outputs.spacingy") * static_cast<double>(GetParameterInt("outputs.sizey")), false); } break; case Mode_AutomaticSpacing: @@ -425,16 +430,16 @@ private: genericRSEstimator->Compute(); // Set the processed spacing relative to this forced size - SetParameterFloat("outputs.spacingx", genericRSEstimator->GetOutputSpacing()[0]); - SetParameterFloat("outputs.spacingy", genericRSEstimator->GetOutputSpacing()[1]); + SetParameterFloat("outputs.spacingx",genericRSEstimator->GetOutputSpacing()[0], false); + SetParameterFloat("outputs.spacingy",genericRSEstimator->GetOutputSpacing()[1], false); // Reset Origin to default - SetParameterFloat("outputs.ulx", genericRSEstimator->GetOutputOrigin()[0] - 0.5 * genericRSEstimator->GetOutputSpacing()[0]); - SetParameterFloat("outputs.uly", genericRSEstimator->GetOutputOrigin()[1] - 0.5 * genericRSEstimator->GetOutputSpacing()[1]); + SetParameterFloat("outputs.ulx",genericRSEstimator->GetOutputOrigin()[0] - 0.5 * genericRSEstimator->GetOutputSpacing()[0], false); + SetParameterFloat("outputs.uly",genericRSEstimator->GetOutputOrigin()[1] - 0.5 * genericRSEstimator->GetOutputSpacing()[1], false); // Update lower right - SetParameterFloat("outputs.lrx", GetParameterFloat("outputs.ulx") + GetParameterFloat("outputs.spacingx") * static_cast<double>(GetParameterInt("outputs.sizex"))); - SetParameterFloat("outputs.lry", GetParameterFloat("outputs.uly") + GetParameterFloat("outputs.spacingy") * static_cast<double>(GetParameterInt("outputs.sizey"))); + SetParameterFloat("outputs.lrx",GetParameterFloat("outputs.ulx") + GetParameterFloat("outputs.spacingx") * static_cast<double>(GetParameterInt("outputs.sizex")), false); + SetParameterFloat("outputs.lry",GetParameterFloat("outputs.uly") + GetParameterFloat("outputs.spacingy") * static_cast<double>(GetParameterInt("outputs.sizey")), false); } break; @@ -478,9 +483,9 @@ private: // Set the processed size relative to this forced spacing if (vcl_abs(spacing[0]) > 0.0) - SetParameterInt("outputs.sizex", static_cast<int>(vcl_ceil((GetParameterFloat("outputs.lrx")-GetParameterFloat("outputs.ulx"))/spacing[0]))); + SetParameterInt("outputs.sizex",static_cast<int>(vcl_ceil((GetParameterFloat("outputs.lrx")-GetParameterFloat("outputs.ulx"))/spacing[0])), false); if (vcl_abs(spacing[1]) > 0.0) - SetParameterInt("outputs.sizey", static_cast<int>(vcl_ceil((GetParameterFloat("outputs.lry")-GetParameterFloat("outputs.uly"))/spacing[1]))); + SetParameterInt("outputs.sizey",static_cast<int>(vcl_ceil((GetParameterFloat("outputs.lry")-GetParameterFloat("outputs.uly"))/spacing[1])), false); } break; case Mode_OrthoFit: @@ -530,11 +535,11 @@ private: SetParameterInt("outputs.sizey",size[1]); SetParameterFloat("outputs.spacingx",spacing[0]); SetParameterFloat("outputs.spacingy",spacing[1]); - SetParameterFloat("outputs.ulx", orig[0] - 0.5 * spacing[0]); - SetParameterFloat("outputs.uly", orig[1] - 0.5 * spacing[1]); + SetParameterFloat("outputs.ulx",orig[0] - 0.5 * spacing[0], false); + SetParameterFloat("outputs.uly",orig[1] - 0.5 * spacing[1], false); // Update lower right - SetParameterFloat("outputs.lrx", GetParameterFloat("outputs.ulx") + GetParameterFloat("outputs.spacingx") * static_cast<double>(GetParameterInt("outputs.sizex"))); - SetParameterFloat("outputs.lry", GetParameterFloat("outputs.uly") + GetParameterFloat("outputs.spacingy") * static_cast<double>(GetParameterInt("outputs.sizey"))); + SetParameterFloat("outputs.lrx",GetParameterFloat("outputs.ulx") + GetParameterFloat("outputs.spacingx") * static_cast<double>(GetParameterInt("outputs.sizex")), false); + SetParameterFloat("outputs.lry",GetParameterFloat("outputs.uly") + GetParameterFloat("outputs.spacingy") * static_cast<double>(GetParameterInt("outputs.sizey")), false); } } break; @@ -580,11 +585,11 @@ private: // Use the smallest spacing (more precise grid) double optimalSpacing = std::min( vcl_abs(xgridspacing), vcl_abs(ygridspacing) ); otbAppLogINFO( "Setting grid spacing to " << optimalSpacing ); - SetParameterFloat("opt.gridspacing", optimalSpacing); + SetParameterFloat("opt.gridspacing",optimalSpacing, false); } else // if (m_OutputProjectionRef == otb::GeoInformationConversion::ToWKT(4326)) { - SetParameterFloat("opt.gridspacing", DefaultGridSpacingMeter); + SetParameterFloat("opt.gridspacing",DefaultGridSpacingMeter, false); } // if (m_OutputProjectionRef == otb::GeoInformationConversion::ToWKT(4326)) } // if (!HasUserValue("opt.gridspacing")) } // if (HasValue("io.in")) @@ -645,9 +650,6 @@ private: break; } - // Setup the DEM Handler - otb::Wrapper::ElevationParametersHandler::SetupDEMHandlerFromElevationParameters(this,"elev"); - // If activated, generate RPC model if(IsParameterEnabled("opt.rpc")) { @@ -692,11 +694,16 @@ private: otbAppLogINFO("Using a deformation grid with a physical spacing of " << GetParameterFloat("opt.gridspacing")); + if ( GetParameterFloat( "opt.gridspacing" ) == 0 ) + { + otbAppLogFATAL( "opt.gridspacing must be different from 0 " ); + } + // Predict size of deformation grid - ResampleFilterType::SizeType deformationGridSize; - deformationGridSize[0] = static_cast<ResampleFilterType::SizeType::SizeValueType>(vcl_abs( + ResampleFilterType::SpacingType deformationGridSize; + deformationGridSize[0] = static_cast<ResampleFilterType::SpacingType::ValueType >(vcl_abs( GetParameterInt("outputs.sizex") * GetParameterFloat("outputs.spacingx") / GetParameterFloat("opt.gridspacing") )); - deformationGridSize[1] = static_cast<ResampleFilterType::SizeType::SizeValueType>(vcl_abs( + deformationGridSize[1] = static_cast<ResampleFilterType::SpacingType::ValueType>(vcl_abs( GetParameterInt("outputs.sizey") * GetParameterFloat("outputs.spacingy") / GetParameterFloat("opt.gridspacing") )); otbAppLogINFO("Using a deformation grid of size " << deformationGridSize); diff --git a/Modules/Applications/AppProjection/app/otbRigidTransformResample.cxx b/Modules/Applications/AppProjection/app/otbRigidTransformResample.cxx index f7ec69e7efcab2ef79c9b71065bf38df2c0e25ca..c3bd9e3df9b8055098256fa9d41573f68008c6e9 100644 --- a/Modules/Applications/AppProjection/app/otbRigidTransformResample.cxx +++ b/Modules/Applications/AppProjection/app/otbRigidTransformResample.cxx @@ -156,7 +156,7 @@ private: AddParameter(ParameterType_Radius, "interpolator.bco.radius", "Radius for bicubic interpolation"); SetParameterDescription("interpolator.bco.radius","This parameter allows controlling the size of the bicubic interpolation filter. If the target pixel size is higher than the input pixel size, increasing this parameter will reduce aliasing artifacts."); SetDefaultParameterInt("interpolator.bco.radius", 2); - SetParameterString("interpolator","bco"); + SetParameterString("interpolator","bco", false); // RAM available AddRAMParameter("ram"); diff --git a/Modules/Applications/AppProjection/app/otbSuperimpose.cxx b/Modules/Applications/AppProjection/app/otbSuperimpose.cxx index ac37bdc6e7ce080d7ec95303d3f52e7d02e69be8..71cb75003eb0f48450e4f0f07c69888f3af49153 100644 --- a/Modules/Applications/AppProjection/app/otbSuperimpose.cxx +++ b/Modules/Applications/AppProjection/app/otbSuperimpose.cxx @@ -159,7 +159,7 @@ private: if(!HasUserValue("mode") && HasValue("inr") && HasValue("inm") && otb::PleiadesPToXSAffineTransformCalculator::CanCompute(GetParameterImage("inr"),GetParameterImage("inm"))) { otbAppLogWARNING("Forcing PHR mode with PHR data. You need to add \"-mode default\" to force the default mode with PHR images."); - SetParameterString("mode","phr"); + SetParameterString("mode","phr", false); } } diff --git a/Modules/Applications/AppSegmentation/app/otbHooverCompareSegmentation.cxx b/Modules/Applications/AppSegmentation/app/otbHooverCompareSegmentation.cxx index d8224dbf51a08fa5b72f858ee1d2df1820e07da5..14fce9949dad4ae4fee9ac0615ad5d2cfefd3103 100644 --- a/Modules/Applications/AppSegmentation/app/otbHooverCompareSegmentation.cxx +++ b/Modules/Applications/AppSegmentation/app/otbHooverCompareSegmentation.cxx @@ -292,10 +292,10 @@ private: m_InstanceFilter->Update(); - SetParameterFloat("rc", m_InstanceFilter->GetMeanRC()); - SetParameterFloat("rf", m_InstanceFilter->GetMeanRF()); - SetParameterFloat("ra", m_InstanceFilter->GetMeanRA()); - SetParameterFloat("rm", m_InstanceFilter->GetMeanRM()); + SetParameterFloat("rc",m_InstanceFilter->GetMeanRC(), false); + SetParameterFloat("rf",m_InstanceFilter->GetMeanRF(), false); + SetParameterFloat("ra",m_InstanceFilter->GetMeanRA(), false); + SetParameterFloat("rm",m_InstanceFilter->GetMeanRM(), false); } ImageToLabelMapFilterType::Pointer m_GTFilter; diff --git a/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx b/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx index 4234666c4972d80a1e609f29ae873bd38af6c9be..6454b130e6cca255631841921a0c8e7dc1ec2d5a 100644 --- a/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx +++ b/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx @@ -305,11 +305,11 @@ private: AddParameter(ParameterType_String, "mode.vector.layername", "Layer name"); SetParameterDescription("mode.vector.layername", "Name of the layer in the vector file or database (default is Layer)."); - SetParameterString("mode.vector.layername", "layer"); + SetParameterString("mode.vector.layername", "layer", false); AddParameter(ParameterType_String, "mode.vector.fieldname", "Geometry index field name"); SetParameterDescription("mode.vector.fieldname", "Name of the field holding the geometry index in the output vector file or database."); - SetParameterString("mode.vector.fieldname", "DN"); + SetParameterString("mode.vector.fieldname", "DN", false); AddParameter(ParameterType_Int, "mode.vector.tilesize", "Tiles size"); SetParameterDescription("mode.vector.tilesize", diff --git a/Modules/Applications/AppStereo/app/otbStereoFramework.cxx b/Modules/Applications/AppStereo/app/otbStereoFramework.cxx index 1b18dc5b89b6cece6460f3c72f7774f239cc873b..e4c4e030e286d1754169ce702b5b9e65fd1c8dac 100644 --- a/Modules/Applications/AppStereo/app/otbStereoFramework.cxx +++ b/Modules/Applications/AppStereo/app/otbStereoFramework.cxx @@ -346,7 +346,7 @@ private: SetParameterDescription("input.co","List of index of couples im image list. Couples must be separated by a comma. (index start at 0). for example : 0 1,1 2 will process a first couple composed of the first and the second image in image list, then the first and the third image\n. note that images are handled by pairs." " if left empty couples are created from input index i.e. a first couple will be composed of the first and second image, a second couple with third and fourth image etc. (in this case image list must be even)."); MandatoryOff("input.co"); - SetParameterString("input.co",""); + SetParameterString("input.co","", false); DisableParameter("input.co"); AddParameter(ParameterType_Int, "input.channel", "Image channel used for the block matching"); @@ -363,7 +363,7 @@ private: // // Build the Output Map Projection // for custom map projection MapProjectionParametersHandler::AddMapProjectionParameters(this, "map"); - SetParameterString("map","wgs"); + SetParameterString("map","wgs", false); AddParameter(ParameterType_Float, "output.res","Output resolution"); SetParameterDescription("output.res","Spatial sampling distance of the output elevation : the cell size (in m)"); diff --git a/Modules/Applications/AppTest/test/CMakeLists.txt b/Modules/Applications/AppTest/test/CMakeLists.txt index 9a2d8705e6bcf16029961b6a972337c938d85f0b..ac83baa32c87ed5668d8771b47623689258e0f62 100644 --- a/Modules/Applications/AppTest/test/CMakeLists.txt +++ b/Modules/Applications/AppTest/test/CMakeLists.txt @@ -33,5 +33,5 @@ otb_test_application(NAME apTvTestApplicationOutputXML_All VALID --compare-ascii ${NOTOL} ${OTBAPP_BASELINE_FILES}/apTvTestApplicationOutputXML_All.xml ${TEMP}/apTvTestApplicationOutputXML_All.xml - --ignore-lines-with 7 letter.scale foo.txt world_boundaries foo.tif anaglyphInput1.tif anaglyphInput2.tif RADARSAT2_ALTONA_300_300_VV.tif + --ignore-lines-with 8 letter.scale foo.txt world_boundaries foo.tif anaglyphInput1.tif anaglyphInput2.tif RADARSAT2_ALTONA_300_300_VV.tif <version> ) diff --git a/Modules/Applications/AppVectorDataTranslation/app/otbRasterization.cxx b/Modules/Applications/AppVectorDataTranslation/app/otbRasterization.cxx index 683a46b83422b4712005904939e2c95e3d4d35e5..1d3ebf78fa4aad74b62fb4389e843442c0cd774e 100644 --- a/Modules/Applications/AppVectorDataTranslation/app/otbRasterization.cxx +++ b/Modules/Applications/AppVectorDataTranslation/app/otbRasterization.cxx @@ -129,7 +129,7 @@ private: AddParameter(ParameterType_String,"mode.attribute.field","The attribute field to burn"); SetParameterDescription("mode.attribute.field","Name of the attribute field to burn"); - SetParameterString("mode.attribute.field","DN"); + SetParameterString("mode.attribute.field","DN", false); AddRAMParameter(); diff --git a/Modules/Core/Transform/include/otbStreamingWarpImageFilter.h b/Modules/Core/Transform/include/otbStreamingWarpImageFilter.h index 813a4440bfebbf3b1dd0f2920cc013365a1c16a5..19435f45c38c0fbb3ef26fb2c124ab664990b68e 100644 --- a/Modules/Core/Transform/include/otbStreamingWarpImageFilter.h +++ b/Modules/Core/Transform/include/otbStreamingWarpImageFilter.h @@ -105,7 +105,7 @@ private: StreamingWarpImageFilter(const Self &); //purposely not implemented void operator =(const Self&); //purposely not implemented - // Assesment of the maximum displacement for streaming + // Assessment of the maximum displacement for streaming DisplacementValueType m_MaximumDisplacement; }; diff --git a/Modules/Filtering/ImageManipulation/include/otbVectorRescaleIntensityImageFilter.h b/Modules/Filtering/ImageManipulation/include/otbVectorRescaleIntensityImageFilter.h index 150b4166c9043b87bd200e880f8726105a8fdf6e..f7e5aa53b0f7ea7ff03a13479ab594339b81c0b5 100644 --- a/Modules/Filtering/ImageManipulation/include/otbVectorRescaleIntensityImageFilter.h +++ b/Modules/Filtering/ImageManipulation/include/otbVectorRescaleIntensityImageFilter.h @@ -198,10 +198,15 @@ private: * * This filter rescales each band to match the [OutputMinimum, OutputMaximum] range. * In order to avoid odd values to alter the intensity extent, one can set a clamp percentage. + * The clamp percentage is set to 0.01 by default. * * Values lower than the first quantile of this percentage are set to the OutputMinimum. * Values upper than the last quantile of this percentage are set to the OutputMaximum. * + * This filter differ from itk::VectorRescaleIntensityImageFilter. + * Instead of setting only the OutputMaximumMagnitude, you can set the minimum and maximum values for the input and output images. + * There is also the possibilty to set a Gamma value and change the clamp percentage. + * * \ingroup IntensityImageFilters * \ingroup MultiThreaded * diff --git a/Modules/Filtering/Wavelet/include/otbWaveletsBandsListToWaveletsSynopsisImageFilter.h b/Modules/Filtering/Wavelet/include/otbWaveletsBandsListToWaveletsSynopsisImageFilter.h index 3cd4af3b2bcae20e50a4a7323ad66ef59434b957..9e22f84968e16a1d48c02f674dc5e544e150be98 100644 --- a/Modules/Filtering/Wavelet/include/otbWaveletsBandsListToWaveletsSynopsisImageFilter.h +++ b/Modules/Filtering/Wavelet/include/otbWaveletsBandsListToWaveletsSynopsisImageFilter.h @@ -25,7 +25,7 @@ namespace otb { /** \class WaveletsBandsListToWaveletsSynopsisImageFilter - * \brief Converts a list of wavelets bands to the traditionnal multi-resolution wavelets view + * \brief Converts a list of wavelets bands to the traditional multi-resolution wavelets view * * The decimation ratio is taken into account. * diff --git a/Modules/Fusion/PanSharpening/include/otbSimpleRcsPanSharpeningFusionImageFilter.h b/Modules/Fusion/PanSharpening/include/otbSimpleRcsPanSharpeningFusionImageFilter.h index 25e1470de639d4b87a9a068e705dbc1281b31b13..822db14618dfa82479b480167892fc781b60b72d 100644 --- a/Modules/Fusion/PanSharpening/include/otbSimpleRcsPanSharpeningFusionImageFilter.h +++ b/Modules/Fusion/PanSharpening/include/otbSimpleRcsPanSharpeningFusionImageFilter.h @@ -110,8 +110,8 @@ private: * This functor applies the * \f[ \frac{XS}{\mathrm{Filtered}(PAN)}PAN \f] * operation. It is intended for internal use only. - * - * \ingroup OTBPanSharpening + * + * \ingroup OTBPanSharpening */ class FusionFunctor { @@ -142,6 +142,83 @@ private: } }; + + /** \class NoDataFusionFunctor + * This functor applies the following operation if there is no data : + * \f[ \frac{XS}{\mathrm{Filtered}(PAN)}PAN \f] + * It is intended for internal use only. + * + * \ingroup OTBPanSharpening + */ + class NoDataFusionFunctor + { + public: + // Implement the fusion as a three arguments operator + typename TOutputImageType::PixelType operator()(const typename TXsImageType::PixelType& xsPixel, + const TInternalPrecision& smoothPanchroPixel, + const typename TPanImageType::PixelType& sharpPanchroPixel) const + { + // Build output pixel + typename TOutputImageType::PixelType output(xsPixel.Size()); + + // Check for no data Pan value + if( m_NoDataValuePanAvailable && sharpPanchroPixel == m_NoDataValuePan ) + { + for ( unsigned int i = 0; i < xsPixel.Size(); ++i ) + { + output[i] = static_cast<typename TOutputImageType::InternalPixelType>( m_NoDataValuesXs[i] ); + } + return output; + } + + TInternalPrecision scale = 1.; + + if(vcl_abs(smoothPanchroPixel) > 1e-10) + { + scale = sharpPanchroPixel/smoothPanchroPixel; + } + + // Perform fusion for each band with appropriate casting + for(unsigned int i = 0; i < xsPixel.Size(); ++i) + { + output[i] = ( m_NoDataValuesXsAvailable[i] && (xsPixel[i] == m_NoDataValuesXs[i]) ) ? + static_cast<typename TOutputImageType::InternalPixelType>( xsPixel[i] ) : + static_cast<typename TOutputImageType::InternalPixelType>( xsPixel[i] * scale ); + } + // Returns the output pixel + return output; + } + + void SetNoDataValuePanAvailable(bool noDataAvailable) { + m_NoDataValuePanAvailable = noDataAvailable; + } + + void SetNoDataValuePan(typename TPanImageType::PixelType noDataValue) { + m_NoDataValuePan = noDataValue; + } + + void SetNoDataValuesXsAvailable(std::vector<bool> noDataValuesAvailable) { + m_NoDataValuesXsAvailable = noDataValuesAvailable; + } + + void SetNoDataValuesXs(std::vector<typename TXsImageType::InternalPixelType> noDataValues) { + m_NoDataValuesXs = noDataValues; + } + + + private: + /** No data flags and values for APN image */ + bool m_NoDataValuePanAvailable; + typename TPanImageType::InternalPixelType m_NoDataValuePan; + + /** No data flags and values for XS image */ + std::vector<bool> m_NoDataValuesXsAvailable; + std::vector<typename TXsImageType::InternalPixelType> m_NoDataValuesXs; + + + }; + + /** * Typedef of the TernaryFunctorImageFilter applying the fusion functor to * p, p_smooth and xs. @@ -152,6 +229,16 @@ private: TOutputImageType, FusionFunctor> FusionFilterType; + /** + * Typedef of the TernaryFunctorImageFilter applying the no data fusion functor to + * p, p_smooth and xs. + */ + typedef itk::TernaryFunctorImageFilter<TXsImageType, + InternalImageType, + TPanImageType, + TOutputImageType, + NoDataFusionFunctor> NoDataFusionFilterType; + /** Typedef of the convolution filter performing smoothing */ typedef otb::ConvolutionImageFilter <TPanImageType, @@ -160,10 +247,16 @@ private: TInternalPrecision> ConvolutionFilterType; /** Pointer to the internal convolution filter */ - typename ConvolutionFilterType::Pointer m_ConvolutionFilter; + typename ConvolutionFilterType::Pointer m_ConvolutionFilter; /** Pointer to the fusion filter */ - typename FusionFilterType::Pointer m_FusionFilter; + typename FusionFilterType::Pointer m_FusionFilter; + + /** Pointer to the fusion filter */ + typename NoDataFusionFilterType::Pointer m_NoDataFusionFilter; + + /** Boolean used for no data */ + bool m_UseNoData; /** Radius used for the smoothing filter */ RadiusType m_Radius; diff --git a/Modules/Fusion/PanSharpening/include/otbSimpleRcsPanSharpeningFusionImageFilter.txx b/Modules/Fusion/PanSharpening/include/otbSimpleRcsPanSharpeningFusionImageFilter.txx index 4ddbe4831764bef8a4b72abe65c251009b9f6670..f849204758ffaf98aad467666968dfe68080ab4d 100644 --- a/Modules/Fusion/PanSharpening/include/otbSimpleRcsPanSharpeningFusionImageFilter.txx +++ b/Modules/Fusion/PanSharpening/include/otbSimpleRcsPanSharpeningFusionImageFilter.txx @@ -32,6 +32,7 @@ SimpleRcsPanSharpeningFusionImageFilter { // Fix number of required inputs this->SetNumberOfRequiredInputs(2); + this->m_UseNoData = false; // Instantiate convolution filter m_ConvolutionFilter = ConvolutionFilterType::New(); @@ -42,15 +43,6 @@ SimpleRcsPanSharpeningFusionImageFilter m_Filter.SetSize(7 * 7); m_Filter.Fill(1); - // Instantiate fusion filter - m_FusionFilter = FusionFilterType::New(); - m_FusionFilter->SetInput2(m_ConvolutionFilter->GetOutput()); - - // Set-up progress reporting - m_ProgressAccumulator = itk::ProgressAccumulator::New(); - m_ProgressAccumulator->SetMiniPipelineFilter(this); - m_ProgressAccumulator->RegisterInternalFilter(m_ConvolutionFilter, 0.9); - m_ProgressAccumulator->RegisterInternalFilter(m_FusionFilter, 0.1); } template <class TPanImageType, class TXsImageType, class TOutputImageType, class TInternalPrecision> @@ -127,18 +119,89 @@ SimpleRcsPanSharpeningFusionImageFilter itkExceptionMacro(<< "SimpleRcsPanSharpeningFusionImageFilter: Wrong Pan/Xs size"); } - //Process the fusion + // Set-up progress reporting + m_ProgressAccumulator = itk::ProgressAccumulator::New(); + m_ProgressAccumulator->SetMiniPipelineFilter(this); + m_ProgressAccumulator->RegisterInternalFilter(m_ConvolutionFilter, 0.9); + m_ConvolutionFilter->SetInput(this->GetPanInput()); m_ConvolutionFilter->SetRadius(this->m_Radius); m_ConvolutionFilter->SetFilter(this->m_Filter); - m_FusionFilter->SetInput1(this->GetXsInput()); - m_FusionFilter->SetInput3(this->GetPanInput()); + typedef typename TPanImageType::InternalPixelType PanPixelType; + typedef typename TXsImageType::InternalPixelType XsPixelType; + + // Write no-data flags for Pan image + std::vector<bool> tmpNoDataValuePanAvailable; + std::vector<double> tmpNoDataValuePan; + bool noDataValuePanAvailable = false; + PanPixelType noDataValuePan = 0; + + bool retPan = itk::ExposeMetaData<std::vector<bool> >( this->GetPanInput()->GetMetaDataDictionary(), MetaDataKey::NoDataValueAvailable, tmpNoDataValuePanAvailable ); + retPan &= itk::ExposeMetaData<std::vector<double> >( this->GetPanInput()->GetMetaDataDictionary(), MetaDataKey::NoDataValue, tmpNoDataValuePan ); + + if(retPan && tmpNoDataValuePanAvailable.size() > 0 && tmpNoDataValuePan.size() > 0) + { + noDataValuePanAvailable = tmpNoDataValuePanAvailable[0] && retPan; + noDataValuePan = static_cast<PanPixelType>( tmpNoDataValuePan[0] ); + } + + + // Write no-data flags for Xs image + std::vector<bool> noDataValuesXsAvailable; + std::vector<double> tmpNoDataValuesXs; + std::vector<XsPixelType> noDataValuesXs; + + bool retXs = itk::ExposeMetaData<std::vector<bool> >( this->GetXsInput()->GetMetaDataDictionary(), MetaDataKey::NoDataValueAvailable, noDataValuesXsAvailable ); + retXs &= itk::ExposeMetaData<std::vector<double> >( this->GetXsInput()->GetMetaDataDictionary(), MetaDataKey::NoDataValue, tmpNoDataValuesXs ); + + // Check if noData is needed and update noDataValuesAvailable with return function value + if ( retPan || retXs ) + { + m_UseNoData = noDataValuePanAvailable; + for ( unsigned int i = 0; i < tmpNoDataValuesXs.size() && i < noDataValuesXsAvailable.size(); ++i ) + { + noDataValuesXs.push_back( static_cast<XsPixelType>(tmpNoDataValuesXs[i]) ); + m_UseNoData |= (noDataValuesXsAvailable[i] = (noDataValuesXsAvailable[i] && retXs)); + } + } + + // Instantiate fusion filter + if ( m_UseNoData ) + { + m_NoDataFusionFilter = NoDataFusionFilterType::New(); + m_ProgressAccumulator->RegisterInternalFilter( m_NoDataFusionFilter, 0.1 ); + + m_NoDataFusionFilter->SetInput2( m_ConvolutionFilter->GetOutput() ); + m_NoDataFusionFilter->GetFunctor().SetNoDataValuesXsAvailable( noDataValuesXsAvailable ); + m_NoDataFusionFilter->GetFunctor().SetNoDataValuePanAvailable( noDataValuePanAvailable ); + m_NoDataFusionFilter->GetFunctor().SetNoDataValuePan( noDataValuePan ); + m_NoDataFusionFilter->GetFunctor().SetNoDataValuesXs( noDataValuesXs ); + + m_NoDataFusionFilter->SetInput1( this->GetXsInput() ); + m_NoDataFusionFilter->SetInput2( m_ConvolutionFilter->GetOutput() ); + m_NoDataFusionFilter->SetInput3( this->GetPanInput() ); + + // Wire composite filter + m_NoDataFusionFilter->GraftOutput( this->GetOutput() ); + m_NoDataFusionFilter->Update(); + this->GraftOutput( m_NoDataFusionFilter->GetOutput() ); + } + else + { + m_FusionFilter = FusionFilterType::New(); + m_ProgressAccumulator->RegisterInternalFilter( m_FusionFilter, 0.1 ); + + m_FusionFilter->SetInput1( this->GetXsInput() ); + m_FusionFilter->SetInput2( m_ConvolutionFilter->GetOutput() ); + m_FusionFilter->SetInput3( this->GetPanInput() ); + + // Wire composite filter + m_FusionFilter->GraftOutput( this->GetOutput() ); + m_FusionFilter->Update(); + this->GraftOutput( m_FusionFilter->GetOutput() ); + } - // Wire composite filter - m_FusionFilter->GraftOutput(this->GetOutput()); - m_FusionFilter->Update(); - this->GraftOutput(m_FusionFilter->GetOutput()); } template <class TPanImageType, class TXsImageType, class TOutputImageType, class TInternalPrecision> diff --git a/Modules/IO/IOGDAL/src/otbGDALOverviewsBuilder.cxx b/Modules/IO/IOGDAL/src/otbGDALOverviewsBuilder.cxx index ecfdfcbeb1690a06cc0a0a513a53a83c2b7923bd..5e15ca437386840f76b958dc5242ba9a4f2d3dcf 100644 --- a/Modules/IO/IOGDAL/src/otbGDALOverviewsBuilder.cxx +++ b/Modules/IO/IOGDAL/src/otbGDALOverviewsBuilder.cxx @@ -200,7 +200,7 @@ GDALOverviewsBuilder unsigned int n = std::min( count, - CountResolutions( factor ) + CountResolutions( factor , 1) ); for( unsigned int i=0; i<n; ++i ) diff --git a/Modules/Remote/Mosaic.remote.cmake b/Modules/Remote/Mosaic.remote.cmake index 1989f99e313c74ee177e5b50b8faa3220d9baeb4..adfa72d32c7efb2f6171a63b2110352a0f141774 100644 --- a/Modules/Remote/Mosaic.remote.cmake +++ b/Modules/Remote/Mosaic.remote.cmake @@ -5,5 +5,5 @@ A more detailed description can be found on the project website: https://github.com/remicres/otb-mosaic " GIT_REPOSITORY https://github.com/remicres/otb-mosaic.git - GIT_TAG 9a8cdd63ed3bba500bb4ea3867abc38bce8be562 + GIT_TAG 516dfa7e7b91aa0263e495ee6b3878a03ced9173 ) diff --git a/Modules/Remote/otb-bv.remote.cmake b/Modules/Remote/otb-bv.remote.cmake index f699009f62157dc925cb290851f91d83bddc38f9..e760e4b739df0fdfb2ffba94d731f91aa8516b3d 100644 --- a/Modules/Remote/otb-bv.remote.cmake +++ b/Modules/Remote/otb-bv.remote.cmake @@ -5,5 +5,5 @@ A more detailed description can be found on the project website: http://tully.ups-tlse.fr/jordi/otb-bv " GIT_REPOSITORY http://tully.ups-tlse.fr/jordi/otb-bv.git - GIT_TAG master + GIT_TAG d13a3b3febe61c3c67777eac8261e07a6257a519 ) diff --git a/Modules/Remote/otbFFSforGMM.remote.cmake b/Modules/Remote/otbFFSforGMM.remote.cmake index b7ae4ee086c7bdb040faabc2c4b4c5baa381631b..f1806e1602e7a5b50cffc6205a7a7e406df5f090 100644 --- a/Modules/Remote/otbFFSforGMM.remote.cmake +++ b/Modules/Remote/otbFFSforGMM.remote.cmake @@ -5,5 +5,5 @@ A more detailed description can be found on the project website: https://github.com/Laadr/otbFFSforGMM " GIT_REPOSITORY https://github.com/Laadr/otbFFSforGMM.git - GIT_TAG master + GIT_TAG 78743f7d57de4acf913bf300cfbb93323a5c8ad3 ) diff --git a/Modules/Remote/phenotb.remote.cmake b/Modules/Remote/phenotb.remote.cmake index 3640ef3cfa99b6039f8f1010ab5ecb4daa8ffaa7..209b9682cfb29d206d17b2b35b245a2efade4964 100644 --- a/Modules/Remote/phenotb.remote.cmake +++ b/Modules/Remote/phenotb.remote.cmake @@ -7,5 +7,5 @@ A more detailed description can be found on the project website: http://tully.ups-tlse.fr/jordi/phenotb " GIT_REPOSITORY http://tully.ups-tlse.fr/jordi/phenotb.git - GIT_TAG master + GIT_TAG 17d69b1bc1f23041dafe265e320b46ffb20229b6 ) diff --git a/Modules/Remote/temporal-gapfilling.remote.cmake b/Modules/Remote/temporal-gapfilling.remote.cmake index b135cb29a30b790987240fd46d4b621878e23cd9..681ae6e773cbd3720115b9a90a31461cf1195b79 100644 --- a/Modules/Remote/temporal-gapfilling.remote.cmake +++ b/Modules/Remote/temporal-gapfilling.remote.cmake @@ -6,5 +6,5 @@ A more detailed description can be found on the project website: http://tully.ups-tlse.fr/jordi/temporalgapfilling " GIT_REPOSITORY http://tully.ups-tlse.fr/jordi/temporalgapfilling.git - GIT_TAG master + GIT_TAG 14c56cb73250861d8694effeba934cebde09424c ) diff --git a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSentinel1Model.cpp b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSentinel1Model.cpp index acfecf8f58ad57fb8222fea2d274b101b1e874ee..7925680ccbf553e00c90d2d14fee2abeff612555 100644 --- a/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSentinel1Model.cpp +++ b/Modules/ThirdParty/OssimPlugins/src/ossim/ossimSentinel1Model.cpp @@ -235,20 +235,6 @@ namespace ossimplugins return false; } } - else - { - /* Keep this notify as WARN. code should not reach here. - If manifest.safe is not found then we are not loading a valid S1 dataset. - If the input is tiff or annotation xml, then also there must exists a - manifest.safe. However, we are forced to read only annotaion xml and - make ossimSentinel1Model out of it for the sake of - "ossimSentinel1ModelTest". This is not a very good idea to allow - reading a fake dataset. So user must be warned! - */ - ossimNotify(ossimNotifyLevel_WARN) - << MODULE - << " manifest.safe not found. but checking if xml file is valid" << "\n"; - } // -----[ Read product file ossimFilename xmlFileName = file; @@ -259,6 +245,12 @@ namespace ossimplugins const ossimFilename fileNameWihtoutExtension = file.fileNoExtension(); const ossimFilename path = file.path().path(); xmlFileName = ossimFilename(path+"/annotation/"+fileNameWihtoutExtension+".xml"); + + if (!xmlFileName.exists() && safeFile.empty()) + { + // this is just a plain tiff file without safe nor xml + return false; + } } if ( !xmlFileName.exists() || !this->readProduct(xmlFileName) ) @@ -279,6 +271,23 @@ namespace ossimplugins << " !xmlFileName.exists() || !this->readProduct(xmlFileName) fails \n"; return false; } + else + { + if ( safeFile.empty() ) + { + /* Keep this notify as WARN. code should not reach here. + If manifest.safe is not found then we are not loading a valid S1 dataset. + If the input is tiff or annotation xml, then also there must exists a + manifest.safe. However, we are forced to read only annotaion xml and + make ossimSentinel1Model out of it for the sake of + "ossimSentinel1ModelTest". This is not a very good idea to allow + reading a fake dataset. So user must be warned! + */ + ossimNotify(ossimNotifyLevel_WARN) + << MODULE + << " manifest.safe not found, but xml file is valid" << "\n"; + } + } if ( !this->initImageSize( theImageSize ) ) { diff --git a/Modules/ThirdParty/Shark/src/otb_shark.h.in b/Modules/ThirdParty/Shark/src/otb_shark.h.in index 3b5ea0997ef7b354f2e509923717b17f2afb9c88..c6c432e09b4ea52d44c513b5fb4d8405d8130805 100755 --- a/Modules/ThirdParty/Shark/src/otb_shark.h.in +++ b/Modules/ThirdParty/Shark/src/otb_shark.h.in @@ -33,7 +33,7 @@ #define BOOST_PARAMETER_MAX_ARITY 15 #define BOOST_FILESYSTEM_VERSION 3 -/* without having a compile defintion will give an linker error +/* without having a compile definition will give an linker error * when build otbapp_TrainImagesClassifier or this header test. * So define them depending on wheather you have static or shared * build of boost. diff --git a/Modules/Visualization/Ice/src/otbGlImageActor.cxx b/Modules/Visualization/Ice/src/otbGlImageActor.cxx index f95da4257f877da2ca46469cbdbc9e5367340f84..530055e07ac6128893e542c183b5ceb957174d8c 100644 --- a/Modules/Visualization/Ice/src/otbGlImageActor.cxx +++ b/Modules/Visualization/Ice/src/otbGlImageActor.cxx @@ -873,13 +873,13 @@ GlImageActor #else index[ 0 ] = static_cast< IndexType::IndexValueType >( - ( physical[ 0 ] - m_Origin[ 0 ] ) / + ( physical[ 0 ] + 0.5 * m_Spacing[0] - m_Origin[ 0 ] ) / m_Spacing[ 0 ] ); index[ 1 ] = static_cast< IndexType::IndexValueType >( - ( physical[ 1 ]- m_Origin[ 1 ] ) / + ( physical[ 1 ] + 0.5 * m_Spacing[1] - m_Origin[ 1 ] ) / m_Spacing[ 1 ] ); diff --git a/Modules/Visualization/Mapla/src/mvdMaplaApplication.cxx b/Modules/Visualization/Mapla/src/mvdMaplaApplication.cxx index 4a1a871a2765d59d932c377223b97e22f0433a24..0096d801ee41af7a3797ec5ae8d5b74dfb7c7232 100644 --- a/Modules/Visualization/Mapla/src/mvdMaplaApplication.cxx +++ b/Modules/Visualization/Mapla/src/mvdMaplaApplication.cxx @@ -31,6 +31,7 @@ // // OTB includes (sorted by alphabetic order) +#include "otbWrapperApplicationRegistry.h" // // Monteverdi includes (sorted by alphabetic order) @@ -74,6 +75,7 @@ MaplaApplication MaplaApplication ::~MaplaApplication() { + otb::Wrapper::ApplicationRegistry::CleanRegistry(); } /*******************************************************************************/ diff --git a/Modules/Visualization/Monteverdi/src/CMakeLists.txt b/Modules/Visualization/Monteverdi/src/CMakeLists.txt index 85e016f6010b6734053bada692eec4f0b1ed0003..ab66fc6a2ce08e56d8a708d749c56edf10642506 100644 --- a/Modules/Visualization/Monteverdi/src/CMakeLists.txt +++ b/Modules/Visualization/Monteverdi/src/CMakeLists.txt @@ -72,6 +72,14 @@ add_executable( monteverdi ${Monteverdi_App_WIN32_RC_FILE} ${OTBMonteverdi_RESOURCES_RCC} ) + +# set monterverdi stack size to 10Mbytes on windows platform because +# the default size with visual compiler it is 1Mbyte +# which is to lower for us (thanks to 6S code). +if (WIN32) + set_linker_stack_size_flag( monteverdi 10000000 ) +endif() + target_link_libraries( monteverdi OTBMonteverdi ) diff --git a/Modules/Visualization/Monteverdi/src/mvdApplication.cxx b/Modules/Visualization/Monteverdi/src/mvdApplication.cxx index e42c38f39ab21199b0e4e0d3346581fc1b9ea0b8..265818ade759b107718b230bb87b08208b113826 100644 --- a/Modules/Visualization/Monteverdi/src/mvdApplication.cxx +++ b/Modules/Visualization/Monteverdi/src/mvdApplication.cxx @@ -34,6 +34,7 @@ // // Monteverdi includes (sorted by alphabetic order) +#include "mvdMainWindow.h" #include "mvdStackedLayerModel.h" // @@ -41,6 +42,10 @@ # include "mvdOTBApplicationsModel.h" #endif +#if USE_OTB_APPS +#include "otbWrapperApplicationRegistry.h" +#endif + // // Class implementation. namespace mvd @@ -76,6 +81,9 @@ Application Application ::~Application() { +#if USE_OTB_APPS + otb::Wrapper::ApplicationRegistry::CleanRegistry(); +#endif } /*******************************************************************************/ diff --git a/Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx b/Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx index db0d976419d438eff52100102157c4611d75a0c6..263b69deb604af1f23f02e3cb6f359498357f5a1 100644 --- a/Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx +++ b/Modules/Visualization/Monteverdi/src/mvdMainWindow.cxx @@ -1102,8 +1102,8 @@ MainWindow quicklookView->SetPickingEnabled( false ); quicklookView->SetPickingDefaultStatus( false ); - quicklookView->setMinimumSize( 64, 64 ); - quicklookView->setMaximumSize( 512, 512 ); + quicklookView->setMinimumSize( 32, 32 ); + quicklookView->setMaximumSize( 1024, 1024 ); quicklookView->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum ); return quicklookView; @@ -1757,8 +1757,9 @@ MainWindow { // // Select filename. + QString caption(tr("Open file...")); ImportImages( - otb::GetOpenFileNames( this, tr( "Open file..." ) ) + otb::GetOpenFileNames( this, caption ) ); } diff --git a/Modules/Visualization/Monteverdi/src/mvdMainWindow.qrc b/Modules/Visualization/Monteverdi/src/mvdMainWindow.qrc index c4178f41819dabd3388f1c73daf46c7039fa1ce5..dfd8f7d2866727451fc5998de9f6515725cd9362 100644 --- a/Modules/Visualization/Monteverdi/src/mvdMainWindow.qrc +++ b/Modules/Visualization/Monteverdi/src/mvdMainWindow.qrc @@ -7,7 +7,7 @@ <file alias="action_LayerProjection_Icon">../../../../Utilities/Data/Icons/projection_24x24.png</file> <file alias="action_LayerUp_Icon">../../../../Utilities/Data/Icons/layer-up_24x24.png</file> <file alias="action_LayerBottom_Icon">../../../../Utilities/Data/Icons/layer-bottom_24x24.png</file> - <file alias="action_LayerDelete_Icon">../../../../Utilities/Data/Icons/layer-delete_24x24.png</file> + <file alias="action_LayerDelete_Icon">../../../../Utilities/Data/Icons/layer-delete.png</file> <file alias="action_LayerDown_Icon">../../../../Utilities/Data/Icons/layer-down_24x24.png</file> <file alias="action_LayerTop_Icon">../../../../Utilities/Data/Icons/layer-top_24x24.png</file> <file alias="action_ZoomFull_Icon">../../../../Utilities/Data/Icons/zoom-1to1.png</file> diff --git a/Modules/Visualization/MonteverdiCore/src/mvdI18nCoreApplication.cxx b/Modules/Visualization/MonteverdiCore/src/mvdI18nCoreApplication.cxx index da3a3c66329969ea7521ab64abcc2dbc0bf09da7..f3b45caa3fcae98b30765f2a64941cc1eab8a417 100644 --- a/Modules/Visualization/MonteverdiCore/src/mvdI18nCoreApplication.cxx +++ b/Modules/Visualization/MonteverdiCore/src/mvdI18nCoreApplication.cxx @@ -562,34 +562,33 @@ I18nCoreApplication // QTextCodec::setCodecForCStrings( QTextCodec::codecForName("System") ); - qWarning() + qDebug() << "Codec for C-strings:" << ( QTextCodec::codecForCStrings()!=NULL ? QTextCodec::codecForCStrings()->name() : "none" ); - qWarning() + qDebug() << "Codec for Locale:" << ( QTextCodec::codecForLocale()!=NULL ? QTextCodec::codecForLocale()->name() : "none" ); - qWarning() + qDebug() << "Codec for Tr:" << ( QTextCodec::codecForTr()!=NULL ? QTextCodec::codecForTr()->name() : "none" ); - // // 1. default UI language is english (no translation). QLocale sys_lc( QLocale::system() ); // Trace system locale. - qWarning() + qDebug() << "Language:" << QLocale::languageToString( sys_lc.language() ); - qWarning() + qDebug() << "Country:" << QLocale::countryToString( sys_lc.country() ); // Check system locale. diff --git a/Modules/Visualization/MonteverdiCore/src/mvdStackedLayerModel.cxx b/Modules/Visualization/MonteverdiCore/src/mvdStackedLayerModel.cxx index 482ed115167ad51c55084fb6843009f91c5c709b..148aafbb79698b24b59ba47db37556efd4bd6855 100644 --- a/Modules/Visualization/MonteverdiCore/src/mvdStackedLayerModel.cxx +++ b/Modules/Visualization/MonteverdiCore/src/mvdStackedLayerModel.cxx @@ -253,7 +253,7 @@ StackedLayerModel ? m_Current : ( m_Current>0 ? m_Current - 1 - : GetCount()>0 ? 0 : StackedLayerModel::NIL_INDEX ); + : GetCount()>1 ? 0 : StackedLayerModel::NIL_INDEX ); // // Emit signals. diff --git a/Modules/Visualization/MonteverdiCore/src/mvdVectorImageModel.cxx b/Modules/Visualization/MonteverdiCore/src/mvdVectorImageModel.cxx index d891e8f687524d9f39a5d47d6aee028eade4c47b..98511d85480dd0b022c354a93a8cb0906fe41eff 100644 --- a/Modules/Visualization/MonteverdiCore/src/mvdVectorImageModel.cxx +++ b/Modules/Visualization/MonteverdiCore/src/mvdVectorImageModel.cxx @@ -212,7 +212,7 @@ VectorImageModel // TODO: this choice should be done by the user during the import of the file bool forceToCacheOvw = true; - qWarning() << tr( "The ImageIO used to read this file supports overviews." ); + qDebug() << tr( "The ImageIO used to read this file supports overviews." ); if( nbOfAvailableOvw>0 ) { @@ -223,7 +223,7 @@ VectorImageModel // TODO MSD: how to manage case of JPEG2000 with no overviews ? : wait GDAL support OpenJPEG ... // The current file don't have overviews available - qWarning() << tr( "The file doesn't have overviews." ); + qDebug() << tr( "The file doesn't have overviews." ); if( !forceToCacheOvw ) { diff --git a/Modules/Visualization/MonteverdiGui/CMakeLists.txt b/Modules/Visualization/MonteverdiGui/CMakeLists.txt index 37f9984e1ddbabc5b30532cf9802c06bfee4d2d0..d503daf285d81eac54f3688603ff6e8b9d2baab3 100644 --- a/Modules/Visualization/MonteverdiGui/CMakeLists.txt +++ b/Modules/Visualization/MonteverdiGui/CMakeLists.txt @@ -42,7 +42,8 @@ if (UNIX AND NOT APPLE) # ------------------------- # Install freedesktop entry - install(FILES ${OTBMonteverdiGUI_DATA_DIR}/monteverdi.desktop + configure_file(${OTBMonteverdiGUI_DATA_DIR}/monteverdi.desktop.in ${CMAKE_BINARY_DIR}/monteverdi.desktop) + install(FILES ${CMAKE_BINARY_DIR}/monteverdi.desktop DESTINATION share/applications) endif() diff --git a/Modules/Visualization/MonteverdiGui/src/mvdColorBandDynamicsWidget.ui b/Modules/Visualization/MonteverdiGui/src/mvdColorBandDynamicsWidget.ui index dd697ccb77c7f316937a185e2effa32c335876be..b7d6734aa9efc54de9199733340f24fa83b72ec7 100644 --- a/Modules/Visualization/MonteverdiGui/src/mvdColorBandDynamicsWidget.ui +++ b/Modules/Visualization/MonteverdiGui/src/mvdColorBandDynamicsWidget.ui @@ -343,7 +343,7 @@ </property> <property name="icon"> <iconset> - <normaloff>:/icons/Data/Icons/execute.png</normaloff>:/icons/Data/Icons/execute.png</iconset> + <normaloff>:/icons/Utilities/Data/Icons/execute.png</normaloff>:/icons/Utilities/Data/Icons/execute.png</iconset> </property> <property name="iconSize"> <size> diff --git a/Modules/Visualization/MonteverdiGui/src/mvdColorDynamicsWidget.ui b/Modules/Visualization/MonteverdiGui/src/mvdColorDynamicsWidget.ui index f09efce079e9c67f448d3329bff418abe4c5628a..09afa39e08c0a41a75e033030780ec950226a15c 100644 --- a/Modules/Visualization/MonteverdiGui/src/mvdColorDynamicsWidget.ui +++ b/Modules/Visualization/MonteverdiGui/src/mvdColorDynamicsWidget.ui @@ -321,5 +321,22 @@ <resources> <include location="mvdIcons.qrc"/> </resources> - <connections/> + <connections> + <connection> + <sender>noDataCheckBox</sender> + <signal>toggled(bool)</signal> + <receiver>noDataLineEdit</receiver> + <slot>setEnabled(bool)</slot> + <hints> + <hint type="sourcelabel"> + <x>49</x> + <y>23</y> + </hint> + <hint type="destinationlabel"> + <x>100</x> + <y>24</y> + </hint> + </hints> + </connection> + </connections> </ui> diff --git a/Modules/Visualization/MonteverdiGui/src/mvdColorSetupWidget.ui b/Modules/Visualization/MonteverdiGui/src/mvdColorSetupWidget.ui index 2bed58e35869d5ea15ce46809c4af8628686766c..662283b0b3f3b00ec1d852cda018e8e7c209556a 100644 --- a/Modules/Visualization/MonteverdiGui/src/mvdColorSetupWidget.ui +++ b/Modules/Visualization/MonteverdiGui/src/mvdColorSetupWidget.ui @@ -11,7 +11,7 @@ </rect> </property> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -47,10 +47,13 @@ </item> <item row="0" column="0"> <layout class="QGridLayout" name="gridLayout"> + <property name="margin"> + <number>9</number> + </property> <property name="spacing"> <number>3</number> </property> - <item row="4" column="0"> + <item row="3" column="0"> <layout class="QHBoxLayout" name="wHorizontalLayout"> <property name="spacing"> <number>1</number> @@ -95,7 +98,7 @@ </item> </layout> </item> - <item row="4" column="1"> + <item row="3" column="1"> <widget class="QComboBox" name="wComboBox"> <property name="enabled"> <bool>false</bool> @@ -123,23 +126,7 @@ </item> </widget> </item> - <item row="0" column="1"> - <widget class="QLabel" name="fileComponentLabel"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string><html><head/><body><p align="center">Image bands<br/>↓</p></body></html></string> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - <item row="1" column="0"> + <item row="0" column="0"> <layout class="QHBoxLayout" name="rHorizontalLayout"> <property name="spacing"> <number>1</number> @@ -178,7 +165,7 @@ </item> </layout> </item> - <item row="1" column="1"> + <item row="0" column="1"> <widget class="QComboBox" name="rComboBox"> <property name="sizePolicy"> <sizepolicy hsizetype="Expanding" vsizetype="Maximum"> @@ -203,7 +190,7 @@ </item> </widget> </item> - <item row="2" column="0"> + <item row="1" column="0"> <layout class="QHBoxLayout" name="gHorizontalLayout"> <property name="spacing"> <number>1</number> @@ -242,7 +229,7 @@ </item> </layout> </item> - <item row="2" column="1"> + <item row="1" column="1"> <widget class="QComboBox" name="gComboBox"> <property name="sizePolicy"> <sizepolicy hsizetype="Expanding" vsizetype="Maximum"> @@ -267,7 +254,7 @@ </item> </widget> </item> - <item row="3" column="0"> + <item row="2" column="0"> <layout class="QHBoxLayout" name="bHorizontalLayout"> <property name="spacing"> <number>1</number> @@ -306,7 +293,7 @@ </item> </layout> </item> - <item row="3" column="1"> + <item row="2" column="1"> <widget class="QComboBox" name="bComboBox"> <property name="sizePolicy"> <sizepolicy hsizetype="Expanding" vsizetype="Maximum"> @@ -331,7 +318,7 @@ </item> </widget> </item> - <item row="4" column="2"> + <item row="3" column="2"> <widget class="QCheckBox" name="wCheckBox"> <property name="toolTip"> <string>Enable/disable gray-scale mode.</string> diff --git a/Modules/Visualization/MonteverdiGui/src/mvdHistogramWidget.ui b/Modules/Visualization/MonteverdiGui/src/mvdHistogramWidget.ui index b66d978f9682d5422665c04bd5ad3c5344c6e744..0ca487f4eb2eb0f7f1f8e12740f9150c033f06aa 100644 --- a/Modules/Visualization/MonteverdiGui/src/mvdHistogramWidget.ui +++ b/Modules/Visualization/MonteverdiGui/src/mvdHistogramWidget.ui @@ -100,7 +100,7 @@ <property name="minimumSize"> <size> <width>200</width> - <height>100</height> + <height>60</height> </size> </property> <property name="toolTip"> diff --git a/Modules/Visualization/MonteverdiGui/src/mvdI18nMainWindow.cxx b/Modules/Visualization/MonteverdiGui/src/mvdI18nMainWindow.cxx index 3aad4081bea5228e44199aff3a2febb3c60ab9a2..499e6a8bb1430b5e7f2d9992eb3639e3c51c522c 100644 --- a/Modules/Visualization/MonteverdiGui/src/mvdI18nMainWindow.cxx +++ b/Modules/Visualization/MonteverdiGui/src/mvdI18nMainWindow.cxx @@ -181,14 +181,23 @@ I18nMainWindow ::BuildGDALOverviews( const QStringList & filenames ) { ImportImagesDialog * importDialog = new ImportImagesDialog( filenames, this ); + // The import dialog should be deleted before leaving this function if( importDialog->GetEffectiveCount()<1 ) + { + delete importDialog; + importDialog = NULL; return true; + } int result = importDialog->exec(); if( result== QDialog::Rejected ) + { + delete importDialog; + importDialog = NULL; return false; + } if( result==QDialog::Accepted ) { @@ -205,6 +214,11 @@ I18nMainWindow Import( builder ); } + if (importDialog) + { + delete importDialog; + importDialog = NULL; + } return true; } diff --git a/Modules/Visualization/MonteverdiGui/src/mvdImageViewWidget.cxx b/Modules/Visualization/MonteverdiGui/src/mvdImageViewWidget.cxx index 911ac1b8968f77256cac60fcc126ab97fab17cdd..1afaf36d82892653ff8b36ca07d7921b3df7ccf3 100644 --- a/Modules/Visualization/MonteverdiGui/src/mvdImageViewWidget.cxx +++ b/Modules/Visualization/MonteverdiGui/src/mvdImageViewWidget.cxx @@ -335,8 +335,10 @@ ImageViewWidget ::Initialize( AbstractImageViewManipulator* manipulator, AbstractImageViewRenderer* renderer ) { +#if OTB_DEBUG // Test OpenGL. ListGlVersions(); +#endif // Accept drops setAcceptDrops( true ); diff --git a/Modules/Visualization/MonteverdiGui/src/mvdImportImagesDialog.cxx b/Modules/Visualization/MonteverdiGui/src/mvdImportImagesDialog.cxx index 73b848ba0e894d9d3c03a1887d53a654ea2fbadf..76614c96afe42b8193043a8d8cd58f450f061bdc 100644 --- a/Modules/Visualization/MonteverdiGui/src/mvdImportImagesDialog.cxx +++ b/Modules/Visualization/MonteverdiGui/src/mvdImportImagesDialog.cxx @@ -222,28 +222,39 @@ ImportImagesDialog I18nCoreApplication::SETTINGS_KEY_OVERVIEWS_SIZE ) ); - - count = - builder->CountResolutions( - 2, - value.isValid() - ? value.toInt() - : OVERVIEWS_SIZE_DEFAULT - ); + unsigned int threshold = + value.isValid() ? value.toInt() : OVERVIEWS_SIZE_DEFAULT; + + otb::GDALOverviewsBuilder::SizeVector ovrSizes; + builder->SetResolutionFactor(2); + // Count all resolution with minimum size 1 (the high requested count is + // clamped by the builder) + builder->ListResolutions(ovrSizes, 2, 9999); + // Count the number of levels with a least 1 size larger than the default size + for (unsigned int k=0 ; k<ovrSizes.size() ; k++) + { + if (std::max(ovrSizes[k][0],ovrSizes[k][1]) >= threshold) + count++; + else + break; + } } if( builder->GetOverviewsCount()>0 ) builder->SetBypassEnabled( true ); - else + else if (count>1) { flags |= Qt::ItemIsEnabled; - builder->SetBypassEnabled( count<=1 ); + builder->SetBypassEnabled( false ); ++ m_EffectiveCount; } + else + { + builder->SetBypassEnabled(true); + } - builder->SetResolutionFactor( 2 ); builder->SetNbResolutions( count ); builder->SetResamplingMethod( otb::GDAL_RESAMPLING_AVERAGE ); builder->SetCompressionMethod( otb::GDAL_COMPRESSION_NONE ); diff --git a/Modules/Visualization/MonteverdiGui/src/mvdLayerStackItemModel.cxx b/Modules/Visualization/MonteverdiGui/src/mvdLayerStackItemModel.cxx index 4aa7d0c0e3ce0160328ed9b5f7d0a8871d67057a..fd626710b0d542a1f2348218a21a006bc49445c5 100644 --- a/Modules/Visualization/MonteverdiGui/src/mvdLayerStackItemModel.cxx +++ b/Modules/Visualization/MonteverdiGui/src/mvdLayerStackItemModel.cxx @@ -683,7 +683,8 @@ LayerStackItemModel // qDebug() // << this << "::index(" << row << "," << column << "," << parent << ")"; - assert( m_StackedLayerModel!=NULL ); + if (m_StackedLayerModel == NULL) + return QModelIndex(); // qDebug() // << "index:" << row << "," << column << "," << m_StackedLayerModel->At( row ); diff --git a/Modules/Visualization/MonteverdiGui/src/mvdLayerStackWidget.ui b/Modules/Visualization/MonteverdiGui/src/mvdLayerStackWidget.ui index 0d4f254b2c3dfc05866bf8678938ad7bc57c90a1..96f5c15ebc7868902d2c32a573040f7ff93fdea3 100644 --- a/Modules/Visualization/MonteverdiGui/src/mvdLayerStackWidget.ui +++ b/Modules/Visualization/MonteverdiGui/src/mvdLayerStackWidget.ui @@ -194,9 +194,9 @@ </widget> </item> <item> - <widget class="QToolButton" name="deleteAllButton"> + <widget class="QToolButton" name="deleteButton"> <property name="toolTip"> - <string>Delete all layers</string> + <string>Delete selected layer</string> </property> <property name="locale"> <locale language="C" country="AnyCountry"/> @@ -206,14 +206,14 @@ </property> <property name="icon"> <iconset> - <normaloff>:/icons/action_LayerDeleteAll_Icon</normaloff>:/icons/action_LayerDeleteAll_Icon</iconset> + <normaloff>:/icons/action_LayerDelete_Icon</normaloff>:/icons/action_LayerDelete_Icon</iconset> </property> </widget> </item> <item> - <widget class="QToolButton" name="deleteButton"> + <widget class="QToolButton" name="deleteAllButton"> <property name="toolTip"> - <string>Delete selected layer</string> + <string>Delete all layers</string> </property> <property name="locale"> <locale language="C" country="AnyCountry"/> @@ -223,7 +223,7 @@ </property> <property name="icon"> <iconset> - <normaloff>:/icons/action_LayerDelete_Icon</normaloff>:/icons/action_LayerDelete_Icon</iconset> + <normaloff>:/icons/action_LayerDeleteAll_Icon</normaloff>:/icons/action_LayerDeleteAll_Icon</iconset> </property> </widget> </item> diff --git a/Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h b/Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h index 26c389002dc32713c481a6fd5fc6728f57a83d73..90d0a226651b8dbdbc39dd6707ddd7e89a53d5ea 100644 --- a/Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h +++ b/Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h @@ -172,10 +172,6 @@ public: * or a value set externally by user */ bool HasValue(std::string paramKey) const; - /* Activate or deactivate the bool parameter - */ - void SetParameterEmpty(std::string paramKey, bool active); - /* Get active flag of parameter with key paramKey */ bool GetParameterEmpty(std::string paramKey); @@ -204,13 +200,6 @@ public: */ /* Set the Parameter value and Update the UserFlag. used by xml parameter */ - void SetParameterInt(std::string parameter, int value, bool hasUserValueFlag); - void SetParameterFloat(std::string parameter, float value, bool hasUserValueFlag); - void SetParameterString(std::string parameter, std::string value, bool hasUserValueFlag); - void SetParameterStringList(std::string parameter, std::vector<std::string> values, bool hasUserValueFlag); - void SetParameterEmpty(std::string parameter, bool value, bool hasUserValueFlag); - - bool IsApplicationReady(); /* Set an integer value * @@ -220,14 +209,48 @@ public: * \li ParameterType_Radius * \li ParameterType_Choice */ - void SetParameterInt(std::string parameter, int value); + void SetParameterInt(std::string parameter, int value, bool hasUserValueFlag = true); /* Set a floating value * * Can be called for types : * \li ParameterType_Float */ - void SetParameterFloat(std::string parameter, float value); + void SetParameterFloat(std::string parameter, float value, bool hasUserValueFlag = true); + + /* Set a string value + * + * Can be called for types : + * \li ParameterType_InputImageListParameter + * \li ParameterType_InputVectorDataListParameter + * \li ParameterType_InputFilenameListParameter + * \li ParameterType_StringList + */ + void SetParameterString(std::string parameter, std::string value, bool hasUserValueFlag = true); + + /* Set a string value + * + * Can be called for types : + * \li ParameterType_String + * \li ParameterType_InputFilename + * \li ParameterType_OutputFilename + * \li ParameterType_Directory + * \li ParameterType_Choice + * \li ParameterType_Float + * \li ParameterType_Int + * \li ParameterType_Radius + * \li ParameterType_InputImageParameter + * \li ParameterType_InputComplexImageParameter + * \li ParameterType_InputVectorDataParameter + * \li ParameterType_OutputImageParameter + * \li ParameterType_OutputVectorDataParameter + */ + void SetParameterStringList(std::string parameter, std::vector<std::string> values, bool hasUserValueFlag = true); + + void SetParameterEmpty(std::string parameter, bool value, bool hasUserValueFlag = true); + + bool IsApplicationReady(); + /* Set an default integer value, must used in the * DoInit when setting a value by default @@ -309,35 +332,6 @@ public: * \li ParameterType_ListView */ void SetListViewSingleSelectionMode(std::string parameter, bool status); - - /* Set a string value - * - * Can be called for types : - * \li ParameterType_String - * \li ParameterType_InputFilename - * \li ParameterType_OutputFilename - * \li ParameterType_Directory - * \li ParameterType_Choice - * \li ParameterType_Float - * \li ParameterType_Int - * \li ParameterType_Radius - * \li ParameterType_InputImageParameter - * \li ParameterType_InputComplexImageParameter - * \li ParameterType_InputVectorDataParameter - * \li ParameterType_OutputImageParameter - * \li ParameterType_OutputVectorDataParameter - */ - void SetParameterString(std::string parameter, std::string value); - - /* Set a string value - * - * Can be called for types : - * \li ParameterType_InputImageListParameter - * \li ParameterType_InputVectorDataListParameter - * \li ParameterType_InputFilenameListParameter - * \li ParameterType_StringList - */ - void SetParameterStringList(std::string parameter, std::vector<std::string> value); /* Set an output image value * diff --git a/Modules/Wrappers/ApplicationEngine/include/otbWrapperCompositeApplication.h b/Modules/Wrappers/ApplicationEngine/include/otbWrapperCompositeApplication.h index caa6b6754cfcf4cb9949ef025873ee53be4f39db..7c7bfa3ae3e05c144fdcd74dae3896bc7dcd6341 100644 --- a/Modules/Wrappers/ApplicationEngine/include/otbWrapperCompositeApplication.h +++ b/Modules/Wrappers/ApplicationEngine/include/otbWrapperCompositeApplication.h @@ -86,7 +86,7 @@ protected: /** * Method to remove all internal applications. Application deriving from - * CompositeApplication should call this method at the begining of their + * CompositeApplication should call this method at the beginning of their * DoInit(). */ void ClearApplications(); diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx index cf17ba6fc9b2d0856d0d69e5350740b0803a83dc..6a8a8795a44c47bedf99e1a60ac914fb9cc398a3 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx @@ -105,30 +105,185 @@ Parameter* Application::GetParameterByKey(std::string name, bool follow) void Application::SetParameterInt(std::string parameter, int value, bool hasUserValueFlag) { - this->SetParameterInt(parameter, value); + Parameter* param = GetParameterByKey(parameter); + + if (dynamic_cast<IntParameter*>(param)) + { + IntParameter* paramInt = dynamic_cast<IntParameter*>(param); + paramInt->SetValue(value); + } + else if (dynamic_cast<FloatParameter*>(param)) + { + FloatParameter* paramFloat = dynamic_cast<FloatParameter*>(param); + paramFloat->SetValue(static_cast<float>(value)); + } + else if (dynamic_cast<RadiusParameter*>(param)) + { + RadiusParameter* paramRadius = dynamic_cast<RadiusParameter*>(param); + paramRadius->SetValue(static_cast<unsigned int>(value)); + } + else if (dynamic_cast<ChoiceParameter*>(param)) + { + ChoiceParameter* paramChoice = dynamic_cast<ChoiceParameter*>(param); + paramChoice->SetValue(value); + } + this->SetParameterUserValue(parameter, hasUserValueFlag); } void Application::SetParameterFloat(std::string parameter, float value, bool hasUserValueFlag) { - this->SetParameterFloat(parameter, value); + Parameter* param = GetParameterByKey(parameter); + + if (dynamic_cast<FloatParameter*>(param)) + { + FloatParameter* paramFloat = dynamic_cast<FloatParameter*>(param); + paramFloat->SetValue(value); + } + this->SetParameterUserValue(parameter, hasUserValueFlag); } void Application::SetParameterString(std::string parameter, std::string value, bool hasUserValueFlag) { - this->SetParameterString(parameter, value); + Parameter* param = GetParameterByKey(parameter); + + if (dynamic_cast<ChoiceParameter*>(param)) + { + ChoiceParameter* paramDown = dynamic_cast<ChoiceParameter*>(param); + paramDown->SetValue(value); + } + else if (dynamic_cast<ListViewParameter*>(param)) + { + ListViewParameter* paramDown = dynamic_cast<ListViewParameter*>(param); + paramDown->SetValue(value); + } + else if (dynamic_cast<StringParameter*>(param)) + { + StringParameter* paramDown = dynamic_cast<StringParameter*>(param); + paramDown->SetValue(value); + } + else if (dynamic_cast<InputFilenameParameter*>(param)) + { + InputFilenameParameter* paramDown = dynamic_cast<InputFilenameParameter*>(param); + paramDown->SetValue(value); + } + else if (dynamic_cast<OutputFilenameParameter*>(param)) + { + OutputFilenameParameter* paramDown = dynamic_cast<OutputFilenameParameter*>(param); + paramDown->SetValue(value); + } + else if (dynamic_cast<DirectoryParameter*>(param)) + { + DirectoryParameter* paramDown = dynamic_cast<DirectoryParameter*>(param); + paramDown->SetValue(value); + } + else if (dynamic_cast<FloatParameter*>(param)) + { + FloatParameter* paramDown = dynamic_cast<FloatParameter*>(param); + paramDown->SetValue(value); + } + else if (dynamic_cast<RadiusParameter*>(param)) + { + RadiusParameter* paramDown = dynamic_cast<RadiusParameter*>(param); + paramDown->SetValue(value); + } + else if (dynamic_cast<IntParameter*>(param)) + { + IntParameter* paramDown = dynamic_cast<IntParameter*>(param); + paramDown->SetValue(value); + } + else if (dynamic_cast<InputImageParameter*>(param)) + { + InputImageParameter* paramDown = dynamic_cast<InputImageParameter*>(param); + if ( !paramDown->SetFromFileName(value) ) + otbAppLogCRITICAL( <<"Invalid image filename " << value <<"."); + + } + else if (dynamic_cast<ComplexInputImageParameter*>(param)) + { + ComplexInputImageParameter* paramDown = dynamic_cast<ComplexInputImageParameter*>(param); + paramDown->SetFromFileName(value); + } + else if (dynamic_cast<InputVectorDataParameter*>(param)) + { + InputVectorDataParameter* paramDown = dynamic_cast<InputVectorDataParameter*>(param); + if ( !paramDown->SetFromFileName(value) ) + otbAppLogCRITICAL( <<"Invalid vector data filename " << value <<"."); + } + else if (dynamic_cast<OutputImageParameter*>(param)) + { + OutputImageParameter* paramDown = dynamic_cast<OutputImageParameter*>(param); + paramDown->SetFileName(value); + } + else if (dynamic_cast<ComplexOutputImageParameter*>(param)) + { + ComplexOutputImageParameter* paramDown = dynamic_cast<ComplexOutputImageParameter*>(param); + paramDown->SetFileName(value); + } + else if (dynamic_cast<OutputVectorDataParameter*>(param)) + { + OutputVectorDataParameter* paramDown = dynamic_cast<OutputVectorDataParameter*>(param); + paramDown->SetFileName(value); + } + else if (dynamic_cast<RAMParameter*>(param)) + { + RAMParameter* paramDown = dynamic_cast<RAMParameter*>(param); + paramDown->SetValue(value); + } + else if (dynamic_cast<OutputProcessXMLParameter*>(param)) + { + OutputProcessXMLParameter* paramDown = dynamic_cast<OutputProcessXMLParameter*>(param); + paramDown->SetValue(value); + } + else if (dynamic_cast<InputProcessXMLParameter*>(param)) + { + InputProcessXMLParameter* paramDown = dynamic_cast<InputProcessXMLParameter*>(param); + if ( !paramDown->SetFileName(value) ) + otbAppLogCRITICAL( <<"Invalid XML parameter filename " << value <<"."); + } + this->SetParameterUserValue(parameter, hasUserValueFlag); } void Application::SetParameterStringList(std::string parameter, std::vector<std::string> values, bool hasUserValueFlag) { - this->SetParameterStringList(parameter, values); + Parameter* param = GetParameterByKey(parameter); + + if (dynamic_cast<InputImageListParameter*>(param)) + { + InputImageListParameter* paramDown = dynamic_cast<InputImageListParameter*>(param); + if( !paramDown->SetListFromFileName(values) ) + otbAppLogCRITICAL( <<"At least one image filename is invalid."); + } + else if (dynamic_cast<InputVectorDataListParameter*>(param)) + { + InputVectorDataListParameter* paramDown = dynamic_cast<InputVectorDataListParameter*>(param); + if( !paramDown->SetListFromFileName(values) ) + otbAppLogCRITICAL( <<"At least one vector data filename is invalid.."); + } + else if (dynamic_cast<InputFilenameListParameter*>(param)) + { + InputFilenameListParameter* paramDown = dynamic_cast<InputFilenameListParameter*>(param); + if( !paramDown->SetListFromFileName(values) ) + otbAppLogCRITICAL( <<"At least one filename is invalid.."); + } + else if (dynamic_cast<StringListParameter*>(param)) + { + StringListParameter* paramDown = dynamic_cast<StringListParameter*>(param); + paramDown->SetValue(values); + } + else if(dynamic_cast<ListViewParameter *>(param)) + { + ListViewParameter * paramDown = dynamic_cast<ListViewParameter *>(param); + paramDown->SetSelectedNames(values); + } + this->SetParameterUserValue(parameter, hasUserValueFlag); } void Application::SetParameterEmpty(std::string parameter, bool value, bool hasUserValueFlag) { - this->SetParameterEmpty(parameter, value); + GetParameterByKey(parameter)->SetActive(value); this->SetParameterUserValue(parameter, hasUserValueFlag); } @@ -429,11 +584,6 @@ Role Application::GetParameterRole(std::string paramKey) const return GetParameterByKey(paramKey)->GetRole(); } -void Application::SetParameterEmpty(std::string paramKey, bool active) -{ - GetParameterByKey(paramKey)->SetActive(active); -} - bool Application::GetParameterEmpty(std::string paramKey) { return GetParameterByKey(paramKey)->GetActive(); @@ -588,42 +738,6 @@ std::vector<std::string> Application::GetChoiceNames(std::string name) itkExceptionMacro(<< name << " is not a choice parameter"); } -void Application::SetParameterInt(std::string parameter, int value) -{ - Parameter* param = GetParameterByKey(parameter); - - if (dynamic_cast<IntParameter*>(param)) - { - IntParameter* paramInt = dynamic_cast<IntParameter*>(param); - paramInt->SetValue(value); - } - else if (dynamic_cast<FloatParameter*>(param)) - { - FloatParameter* paramFloat = dynamic_cast<FloatParameter*>(param); - paramFloat->SetValue(static_cast<float>(value)); - } - else if (dynamic_cast<RadiusParameter*>(param)) - { - RadiusParameter* paramRadius = dynamic_cast<RadiusParameter*>(param); - paramRadius->SetValue(static_cast<unsigned int>(value)); - } - else if (dynamic_cast<ChoiceParameter*>(param)) - { - ChoiceParameter* paramChoice = dynamic_cast<ChoiceParameter*>(param); - paramChoice->SetValue(value); - } -} - -void Application::SetParameterFloat(std::string parameter, float value) -{ - Parameter* param = GetParameterByKey(parameter); - - if (dynamic_cast<FloatParameter*>(param)) - { - FloatParameter* paramFloat = dynamic_cast<FloatParameter*>(param); - paramFloat->SetValue(value); - } -} void Application::SetDefaultParameterInt(std::string parameter, int value) { @@ -759,140 +873,6 @@ void Application::SetListViewSingleSelectionMode(std::string parameter, bool sta } -void Application::SetParameterString(std::string parameter, std::string value) -{ - Parameter* param = GetParameterByKey(parameter); - - if (dynamic_cast<ChoiceParameter*>(param)) - { - ChoiceParameter* paramDown = dynamic_cast<ChoiceParameter*>(param); - paramDown->SetValue(value); - } - else if (dynamic_cast<ListViewParameter*>(param)) - { - ListViewParameter* paramDown = dynamic_cast<ListViewParameter*>(param); - paramDown->SetValue(value); - } - else if (dynamic_cast<StringParameter*>(param)) - { - StringParameter* paramDown = dynamic_cast<StringParameter*>(param); - paramDown->SetValue(value); - } - else if (dynamic_cast<InputFilenameParameter*>(param)) - { - InputFilenameParameter* paramDown = dynamic_cast<InputFilenameParameter*>(param); - paramDown->SetValue(value); - } - else if (dynamic_cast<OutputFilenameParameter*>(param)) - { - OutputFilenameParameter* paramDown = dynamic_cast<OutputFilenameParameter*>(param); - paramDown->SetValue(value); - } - else if (dynamic_cast<DirectoryParameter*>(param)) - { - DirectoryParameter* paramDown = dynamic_cast<DirectoryParameter*>(param); - paramDown->SetValue(value); - } - else if (dynamic_cast<FloatParameter*>(param)) - { - FloatParameter* paramDown = dynamic_cast<FloatParameter*>(param); - paramDown->SetValue(value); - } - else if (dynamic_cast<RadiusParameter*>(param)) - { - RadiusParameter* paramDown = dynamic_cast<RadiusParameter*>(param); - paramDown->SetValue(value); - } - else if (dynamic_cast<IntParameter*>(param)) - { - IntParameter* paramDown = dynamic_cast<IntParameter*>(param); - paramDown->SetValue(value); - } - else if (dynamic_cast<InputImageParameter*>(param)) - { - InputImageParameter* paramDown = dynamic_cast<InputImageParameter*>(param); - if ( !paramDown->SetFromFileName(value) ) - otbAppLogCRITICAL( <<"Invalid image filename " << value <<"."); - - } - else if (dynamic_cast<ComplexInputImageParameter*>(param)) - { - ComplexInputImageParameter* paramDown = dynamic_cast<ComplexInputImageParameter*>(param); - paramDown->SetFromFileName(value); - } - else if (dynamic_cast<InputVectorDataParameter*>(param)) - { - InputVectorDataParameter* paramDown = dynamic_cast<InputVectorDataParameter*>(param); - if ( !paramDown->SetFromFileName(value) ) - otbAppLogCRITICAL( <<"Invalid vector data filename " << value <<"."); - } - else if (dynamic_cast<OutputImageParameter*>(param)) - { - OutputImageParameter* paramDown = dynamic_cast<OutputImageParameter*>(param); - paramDown->SetFileName(value); - } - else if (dynamic_cast<ComplexOutputImageParameter*>(param)) - { - ComplexOutputImageParameter* paramDown = dynamic_cast<ComplexOutputImageParameter*>(param); - paramDown->SetFileName(value); - } - else if (dynamic_cast<OutputVectorDataParameter*>(param)) - { - OutputVectorDataParameter* paramDown = dynamic_cast<OutputVectorDataParameter*>(param); - paramDown->SetFileName(value); - } - else if (dynamic_cast<RAMParameter*>(param)) - { - RAMParameter* paramDown = dynamic_cast<RAMParameter*>(param); - paramDown->SetValue(value); - } - else if (dynamic_cast<OutputProcessXMLParameter*>(param)) - { - OutputProcessXMLParameter* paramDown = dynamic_cast<OutputProcessXMLParameter*>(param); - paramDown->SetValue(value); - } - else if (dynamic_cast<InputProcessXMLParameter*>(param)) - { - InputProcessXMLParameter* paramDown = dynamic_cast<InputProcessXMLParameter*>(param); - if ( !paramDown->SetFileName(value) ) - otbAppLogCRITICAL( <<"Invalid XML parameter filename " << value <<"."); - } -} - -void Application::SetParameterStringList(std::string parameter, std::vector<std::string> value) -{ - Parameter* param = GetParameterByKey(parameter); - - if (dynamic_cast<InputImageListParameter*>(param)) - { - InputImageListParameter* paramDown = dynamic_cast<InputImageListParameter*>(param); - if( !paramDown->SetListFromFileName(value) ) - otbAppLogCRITICAL( <<"At least one image filename is invalid."); - } - else if (dynamic_cast<InputVectorDataListParameter*>(param)) - { - InputVectorDataListParameter* paramDown = dynamic_cast<InputVectorDataListParameter*>(param); - if( !paramDown->SetListFromFileName(value) ) - otbAppLogCRITICAL( <<"At least one vector data filename is invalid.."); - } - else if (dynamic_cast<InputFilenameListParameter*>(param)) - { - InputFilenameListParameter* paramDown = dynamic_cast<InputFilenameListParameter*>(param); - if( !paramDown->SetListFromFileName(value) ) - otbAppLogCRITICAL( <<"At least one filename is invalid.."); - } - else if (dynamic_cast<StringListParameter*>(param)) - { - StringListParameter* paramDown = dynamic_cast<StringListParameter*>(param); - paramDown->SetValue(value); - } - else if(dynamic_cast<ListViewParameter *>(param)) - { - ListViewParameter * paramDown = dynamic_cast<ListViewParameter *>(param); - paramDown->SetSelectedNames(value); - } -} - void Application::SetParameterOutputImage(std::string parameter, FloatVectorImageType* value) { Parameter* param = GetParameterByKey(parameter); diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplicationHtmlDocGenerator.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplicationHtmlDocGenerator.cxx index 086ec18a624d7a6756a4a27e859a2595452a3837..bb6864898d0c35488195ba8cdff1d4c12403e5de 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplicationHtmlDocGenerator.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplicationHtmlDocGenerator.cxx @@ -186,7 +186,7 @@ void ApplicationHtmlDocGenerator::GetDocParameters( const Application::Pointer a for( unsigned int i=0; i<nbOfParam; i++ ) { const std::string key(appKeyList[i]); - Parameter::Pointer param = app->GetParameterByKey( key ); + Parameter::Pointer param = app->GetParameterByKey(key, false); if( app->GetParameterType(key) == ParameterType_Group) { oss << "<li>"; @@ -235,7 +235,7 @@ void ApplicationHtmlDocGenerator::GetDocParameterGroup( const Application::Point for( unsigned int i=0; i<nbOfParam; i++ ) { const std::string fullKey(std::string(key).append(".").append(appKeyList[i])); - Parameter::Pointer param = app->GetParameterByKey( fullKey ); + Parameter::Pointer param = app->GetParameterByKey( fullKey, false); if( app->GetParameterType(fullKey) == ParameterType_Group) { oss<<"<li>"; diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperElevationParametersHandler.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperElevationParametersHandler.cxx index e72145ce085f42418074a7643a740d7ffb6cc756..409f8ad46ed49cad63f9b735ddd32261018bb773 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperElevationParametersHandler.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperElevationParametersHandler.cxx @@ -107,10 +107,20 @@ void ElevationParametersHandler::SetupDEMHandlerFromElevationParameters(const Ap // Set DEM directory if available if(IsDEMUsed(app,key)) { - oss.str(""); - oss<<"Elevation management: using DEM directory ("<<GetDEMDirectory(app,key)<<")"<<std::endl; - otb::DEMHandler::Instance()->OpenDEMDirectory(GetDEMDirectory(app,key)); - app->GetLogger()->Info(oss.str()); + std::string demDirectory = GetDEMDirectory(app,key); + if(otb::DEMHandler::Instance()->IsValidDEMDirectory(demDirectory.c_str())) + { + oss.str( "" ); + oss << "Elevation management: using DEM directory (" << demDirectory << ")" << std::endl; + otb::DEMHandler::Instance()->OpenDEMDirectory( demDirectory ); + app->GetLogger()->Info( oss.str() ); + } + else + { + oss.str( "" ); + oss << "DEM directory : " << demDirectory << " is not a valid DEM directory"; + app->GetLogger()->Warning( oss.str() ); + } } } @@ -161,10 +171,10 @@ ElevationParametersHandler::IsGeoidUsed(const Application::Pointer app, const st bool ElevationParametersHandler::IsDEMUsed(const Application::Pointer app, const std::string& key) { - std::ostringstream geoidKey; - geoidKey<< key<<".dem"; + std::ostringstream demKey; + demKey<< key<<".dem"; - return app->IsParameterEnabled(geoidKey.str()) && app->HasValue(geoidKey.str()); + return app->IsParameterEnabled(demKey.str()) && app->HasValue(demKey.str()); } diff --git a/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx b/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx index 8fa88be9de329b084a1876b6c3a302cea2db70a0..c75e921044d320ac88361b26b22929d77d81ec74 100644 --- a/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx +++ b/Modules/Wrappers/CommandLine/src/otbWrapperCommandLineLauncher.cxx @@ -858,7 +858,7 @@ std::string CommandLineLauncher::DisplayParameterHelp(const Parameter::Pointer & itkExceptionMacro("Not handled parameter type."); - oss<< " " << param->GetName() << " "; + oss<< " " << m_Application->GetParameterName(paramKey) << " "; if (type == ParameterType_OutputImage) { diff --git a/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetModel.cxx b/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetModel.cxx index 1e089805e5ff7ea5e4431ff58e27163cd30181e0..e9587623dbc3eeeea23a7fb28c345fbcc95aa9df 100644 --- a/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetModel.cxx +++ b/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetModel.cxx @@ -57,6 +57,8 @@ QtWidgetModel QtWidgetModel::~QtWidgetModel() { + if (m_Timer) + delete m_Timer; } void @@ -177,6 +179,13 @@ QtWidgetModel SLOT( OnApplicationExecutionDone( int ) ) ); + QObject::connect( + taskAppli, + SIGNAL( finished() ), + taskAppli, + SLOT( deleteLater() ) + ); + // Tell the Progress Reporter to begin emit SetProgressReportBegin(); diff --git a/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetParameterGroup.cxx b/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetParameterGroup.cxx index fbb113c46ad3b7b0c6cf77cb76e6cef45d54effa..872b4b4703e65e59603ed19359ebaaae77d4f86d 100644 --- a/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetParameterGroup.cxx +++ b/Modules/Wrappers/QtWidget/src/otbWrapperQtWidgetParameterGroup.cxx @@ -55,6 +55,7 @@ void QtWidgetParameterGroup::DoCreateWidget() for (unsigned int i = 0; i < nbParams; ++i) { Parameter* param = m_ParamList->GetParameterByIndex(i); + Parameter* rawParam = m_ParamList->GetParameterByIndex(i,false); if (param != ITK_NULLPTR) { @@ -70,7 +71,7 @@ void QtWidgetParameterGroup::DoCreateWidget() if (paramAsGroup == ITK_NULLPTR && paramAsChoice == ITK_NULLPTR && !paramIsXML) { // Label (col 1) - QWidget* label = new QtWidgetParameterLabel( param ); + QWidget* label = new QtWidgetParameterLabel( rawParam ); gridLayout->addWidget(label, i, 1); // Parameter Widget (col 2) @@ -149,7 +150,7 @@ void QtWidgetParameterGroup::DoCreateWidget() } connect(group, SIGNAL(clicked(bool)), specificWidget, SLOT(SetActivationState(bool))); - group->setTitle(param->GetName()); + group->setTitle(rawParam->GetName()); gridLayout->addWidget(group, i, 0, 1, -1); m_WidgetList.push_back(specificWidget); diff --git a/Modules/Wrappers/SWIG/src/otbApplication.i b/Modules/Wrappers/SWIG/src/otbApplication.i index aa93633ba359170270f853d5b4973c7cfa54de1e..d02d01a36d11aa7119c3eba841824fd6883c51cf 100644 --- a/Modules/Wrappers/SWIG/src/otbApplication.i +++ b/Modules/Wrappers/SWIG/src/otbApplication.i @@ -181,16 +181,11 @@ public: bool IsApplicationReady(); - void SetParameterInt(std::string parameter, int value); - void SetParameterFloat(std::string parameter, float value); - void SetParameterString(std::string parameter, std::string value); - void SetParameterStringList(std::string parameter, std::vector<std::string> value); - - void SetParameterInt(std::string parameter, int value, bool hasUserValueFlag); - void SetParameterFloat(std::string parameter, float value, bool hasUserValueFlag); - void SetParameterString(std::string parameter, std::string value, bool hasUserValueFlag); - void SetParameterStringList(std::string parameter, std::vector<std::string> values, bool hasUserValueFlag); - void SetParameterEmpty(std::string parameter, bool value, bool hasUserValueFlag); + void SetParameterInt(std::string parameter, int value, bool hasUserValueFlag = true); + void SetParameterFloat(std::string parameter, float value, bool hasUserValueFlag = true); + void SetParameterString(std::string parameter, std::string value, bool hasUserValueFlag = true); + void SetParameterStringList(std::string parameter, std::vector<std::string> values, bool hasUserValueFlag = true); + void SetParameterEmpty(std::string parameter, bool value, bool hasUserValueFlag = true); void SetParameterOutputImagePixelType(std::string parameter, otb::Wrapper::ImagePixelType pixelType); void SetParameterComplexOutputImagePixelType(std::string parameter, otb::Wrapper::ComplexImagePixelType cpixelType); @@ -416,6 +411,7 @@ private: void operator =(const Application&); }; + DECLARE_REF_COUNT_CLASS( Application ) diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt index e7815e818e73fbf246819fd7ae5af58d4c015079..bd8070c1c6eecdcf6b3a75588cd089ac91da989c 100644 --- a/RELEASE_NOTES.txt +++ b/RELEASE_NOTES.txt @@ -1,3 +1,61 @@ +OTB-v.5.10.0 - Changes since version 5.8.0 (February 14th, 2017) +--------------------------------------------------------------- + +* Request for Changes (http://wiki.orfeo-toolbox.org/index.php/Requests_for_Changes): + * Request for Changes-69: Force Monteverdi no-GLSL option (adopted, merged) + * Request for Changes-70: Composite application framework (adopted, merged) + * Request for Changes-71: Enhance class field selection in training applications (adopted, merged) + * Request for Changes-72: Remove JPEG2000ImageIO (adopted, merged) + * Request for Changes-73: Compatibility with muparserx 4.0.7 (last stable release) (adopted, merged) + * Request for Changes-74: Translate the application GUI to the corresponding command line (adopted, merged) + * Request for Changes-75: Monteverdi/App November code sprint (adopted, merged) + * Request for Changes-76: Single band color-mapping in Monteverdi (adopted, merged) + * Request for Changes-77: New application for wavelet and fft domain transform (adopted, merged) + * Request for Changes-78: Refactor TrainImagesClassifier (adopted, merged) + * Request for Changes-79: BundleToPerfectSensor implemented as composite application (adopted, merged) + * Request for Changes-80: Compute sub-sampled Haralick textures (adopted, merged) + +* Bugfixes : + + * Monteverdi + * 0001351: Broken 5.10 standalone package on Linux (missing libstdc++) + * 0001334: On Windows standalone package, selection and drag&drop is broken on Monteverdi layer stack + * 0001338: Monteverdi does not correctly free memory + * 0001345: Wrong behavior of minimum image size for overviews in preference dialog + * 0001320: Pixel picking in Monteverdi is half-pixel shifted + * 0001309: Monteverdi 5.8: cannot drag and drop filename to OTB app + + * OTB-Packaging + * 0001361: _dl_close error message in Linux standalone package when closing the application + * 0001357: segfault when loading OTB applications in linux standalone package + * 0001356: Linux package requires OTB_USE_SYSTEM_GTK=1 on CentOS 7 + * 0001355: Patch to set OTB_APPLICATION_PATH environment variable in monteverdi desktop file + * 0001335: On Windows standalone package, TOC calibration crashes monteverdi + * 0001326: OTB python bindings does not work + * 0001336: setup.sh is missing in Windows standalone packages + * 0001337: On windows standalone package otbcli.bat misses the GDAL_DATA environment variable + * 0001325: libsvm URL in superbuild does not exists anymore + + * OTB-applications + * 0001341: Rescale application does not exactly rescale image + * 0001339: ExtractROI application yields wrong size through python bindings + * 0001321: Unable to apply radiometric calibration to S1A SLC product + * 0001316: Application parameter of type ListView are not export in XML + + * Orfeo Toolbox (OTB) + * 0001317: cmake c and cxx flags are not written in OTBConfig.cmake or UseOTB.cmake + * 0001323: Install monteverdi icons along with the application. + * 0001342: Download of libsvm is failing when (super)building + * 0001331: TrainVectorClassifier: misleading error message + * 0001330: Superbuild crashes with invalid libSVM source link + * 0001327: Quicklook application introduces a shift + * 0001328: OTB 5.8 : superImpose introduce "NODATA" + * 0001319: OTB 5.8 vector Sampler + * 0001324: Add Keywords to desktop entry file. + + * Documentation + * 0001313: Some latex fragments are not rendered in RST cookbook + OTB-v.5.8.0 - Changes since version 5.6.1 (November 8th, 2016) -------------------------------------------------------------- diff --git a/SuperBuild/CMake/External_itk.cmake b/SuperBuild/CMake/External_itk.cmake index 8f0c9e404ab39d46206ccc2d57e23b3f7f79c893..92e674a38f62c4a24731875bf3bc1ab9327777b5 100644 --- a/SuperBuild/CMake/External_itk.cmake +++ b/SuperBuild/CMake/External_itk.cmake @@ -164,11 +164,3 @@ ExternalProject_Add(ITK SUPERBUILD_PATCH_SOURCE(ITK) -set(DIR_LIST "${SB_INSTALL_PREFIX}/lib/cmake/ITK-4.10|${SB_INSTALL_PREFIX}/lib/cmake/ITK-4.10/Modules") -ExternalProject_Add_Step(ITK POST_INSTALL - COMMAND ${CMAKE_COMMAND} - -DP_DIRS=${DIR_LIST} - -DP_MATCH=${SB_INSTALL_PREFIX} - -DP_REPLACE=ITK_INSTALL_PREFIX - -P ${CMAKE_SOURCE_DIR}/CMake/post_install.cmake - DEPENDEES install) diff --git a/SuperBuild/CMake/post_install.cmake b/SuperBuild/CMake/post_install.cmake index e211e653fdbdc1cd8547569ff119dd4cc35d76b0..603c8c24e5b86fbd4f1266a9a06d9c7642a961ef 100644 --- a/SuperBuild/CMake/post_install.cmake +++ b/SuperBuild/CMake/post_install.cmake @@ -1,11 +1,22 @@ +#check variables are set +foreach(var P_DIRS P_MATCH P_REPLACE) + if(NOT ${var}) + message(FATAL_ERROR "${var} not set") + endif() +endforeach() + string(REPLACE "|" ";" P_DIRS ${P_DIRS}) + foreach( p_dir ${P_DIRS} ) set(file_list) file( GLOB file_list "${p_dir}/*.cmake" ) +list(SORT file_list) foreach( cmake_file ${file_list} ) - file(STRINGS "${cmake_file}" MATCH_FOUND REGEX "${MATCH}") + + file(STRINGS "${cmake_file}" MATCH_FOUND REGEX "${P_MATCH}") if(MATCH_FOUND) + message("Replacing '${P_MATCH}' with '${P_REPLACE}' in ${cmake_file}") file(STRINGS "${cmake_file}" cmake_file_CONTENTS NEWLINE_CONSUME) string(REPLACE "${P_MATCH}" "$${}{${P_REPLACE}}" cmake_file_CONTENTS ${cmake_file_CONTENTS}) file(WRITE "${cmake_file}" "# This file is modified by OTB after installation. diff --git a/SuperBuild/Packaging/CreateCMakeProjects.cmake b/SuperBuild/Packaging/CreateCMakeProjects.cmake index b21a95cb0df62f9068216b955aa09017db41679b..69649513442b7122cf8484203ab13abd24e64cb1 100644 --- a/SuperBuild/Packaging/CreateCMakeProjects.cmake +++ b/SuperBuild/Packaging/CreateCMakeProjects.cmake @@ -30,6 +30,7 @@ macro(macro_setup_cmake_project pkg) include(CMakeDetermineSystem) set(CMAKE_BUILD_TYPE Release) set(PACKAGE_OTB_SRC_DIR \"${PACKAGE_OTB_SRC_DIR}\") + set(SUPERBUILD_BINARY_DIR \"${SUPERBUILD_BINARY_DIR}\") set(OTB_BINARY_DIR \"${OTB_BINARY_DIR}\") set(OTB_INSTALL_DIR \"${OTB_INSTALL_DIR}\") set(QT_PLUGINS_DIR \"${QT_PLUGINS_DIR}\") @@ -58,12 +59,16 @@ macro(macro_setup_cmake_project pkg) macro_super_package(STAGE_DIR \"${archive_name}\")" ) +set(README_FILE_SUFFIX) +if(PKG_GENERATE_XDK) + set(README_FILE_SUFFIX "_xdk") +endif() if(APPLE) - set(README_FILE ${PACKAGE_OTB_SRC_DIR}/Documentation/Cookbook/rst/Installation_Macx.txt) + set(README_FILE ${PACKAGE_OTB_SRC_DIR}/Documentation/Cookbook/rst/Installation_Macx${README_FILE_SUFFIX}.txt) elseif(LINUX) #not osx - set(README_FILE ${PACKAGE_OTB_SRC_DIR}/Documentation/Cookbook/rst/Installation_Linux.txt) + set(README_FILE ${PACKAGE_OTB_SRC_DIR}/Documentation/Cookbook/rst/Installation_Linux${README_FILE_SUFFIX}.txt) elseif(WIN32) #windows - set(README_FILE ${PACKAGE_OTB_SRC_DIR}/Documentation/Cookbook/rst/Installation_Windows.txt) + set(README_FILE ${PACKAGE_OTB_SRC_DIR}/Documentation/Cookbook/rst/Installation_Windows${README_FILE_SUFFIX}.txt) endif() configure_file( diff --git a/SuperBuild/Packaging/Files/linux_pkgsetup.in b/SuperBuild/Packaging/Files/linux_pkgsetup.in index 7b4b6b8237cf1b157957aeed5f026cd67db2c981..98e060f50a62045b1d51137e6dfc681c5ed2ede8 100644 --- a/SuperBuild/Packaging/Files/linux_pkgsetup.in +++ b/SuperBuild/Packaging/Files/linux_pkgsetup.in @@ -73,12 +73,12 @@ cat > "$OUT_DIR/otbenv.profile" << EOF # unset any existing LD_LIBRARY_PATH unset LD_LIBRARY_PATH -# if OTB_USE_SYSTEM_GTK is not set or is set to zero, +# if OTB_USE_LOCAL_GTK is set to one, # we must include <OUT_DIR>/lib/gtk because glib files are # installed there. -# OTB_USE_SYSTEM_GTK is not set by default -if [ -z "\$OTB_USE_SYSTEM_GTK" ] || [ "\$OTB_USE_SYSTEM_GTK" = "0" ]; then +# OTB_USE_LOCAL_GTK is not set by default (use GTK system) +if [ "\$OTB_USE_LOCAL_GTK" = "1" ]; then LD_LIBRARY_PATH=$OUT_DIR/lib/gtk export LD_LIBRARY_PATH fi @@ -121,6 +121,43 @@ EOF chmod +x "$OUT_DIR/otbenv.profile" +else + +cat > "$OUT_DIR/xdkenv.profile" << EOF +#!/bin/sh + +# The below environment variables only affect current shell +# So if you run again from a terminal. you need to run the script again + +# unset any existing LD_LIBRARY_PATH +unset LD_LIBRARY_PATH + +# Add bin direcotory to system PATH +PATH=$OUT_DIR/bin:\$PATH + +# set numeric locale to C +LC_NUMERIC=C + +# set GDAL_DATA variable used by otb application +GDAL_DATA=$OUT_DIR/share/gdal + +# set GEOTIFF_CSV variable used by otb application +GEOTIFF_CSV=$OUT_DIR/share/epsg_csv + +CMAKE_PREFIX_PATH=$OUT_DIR + +# export variables +export LC_NUMERIC +export GDAL_DATA +export GEOTIFF_CSV +export CMAKE_PREFIX_PATH +export PATH + +EOF + + +chmod +x "$OUT_DIR/xdkenv.profile" + fi #echo "Creating symbolic links..." @@ -149,7 +186,7 @@ python_patch_version=$($OTB_PYTHON_EXE -c "import sys;print(sys.version_info[2]) python_version="$python_major_version.$python_minor_version.$python_patch_version" python_check_failed() { - printf %s\\n "*****Error occured during installation******" + printf %s\\n "*****Error occurred during installation******" printf %s\\n "OTB python bindings requires python2.6 or python2.7 but current detected python version is $python_version" printf %s\\n "If you have python2.6 or Python2.7 installed in your system " printf %s\\n "You should set OTB_PYTHON_EXE and re-run this installation script." @@ -188,7 +225,7 @@ if [ "$found_python_lib" -eq "1" ]; then printf %s\\n "To test OTB python bindings:" printf %s\\n "$OTB_PYTHON_EXE -c 'import otbApplication'" else - printf %s\\n "*****Error occured during installation******" + printf %s\\n "*****Error occurred during installation******" printf %s\\n "Python interpreter detected is : $OTB_PYTHON_EXE ( version: $python_version )" printf %s\\n "$python_INSTSONAME cannot be found in any of search directories." printf %s\\n "We had searched following directories $python_lib_dirs" diff --git a/SuperBuild/Packaging/Files/macx_pkgsetup.in b/SuperBuild/Packaging/Files/macx_pkgsetup.in index 2fda1e5436ae0b679ff868a8867b120927750f80..c196337ae9982275d74a76a3d5589fb29e5b67a8 100755 --- a/SuperBuild/Packaging/Files/macx_pkgsetup.in +++ b/SuperBuild/Packaging/Files/macx_pkgsetup.in @@ -140,7 +140,7 @@ EOF cat > "$OUT_DIR/otbenv.profile" << EOF #!/bin/sh -PATH=\$PATH:$OUT_DIR/bin +PATH=$OUT_DIR/bin:\$PATH PYTHONPATH=$OUT_DIR/lib/python:\$PYTHONPATH GDAL_DATA=$OUT_DIR/share/gdal GEOTIFF_CSV=$OUT_DIR/share/epsg_csv diff --git a/SuperBuild/Packaging/Files/otbenv.profile b/SuperBuild/Packaging/Files/otbenv.bash similarity index 52% rename from SuperBuild/Packaging/Files/otbenv.profile rename to SuperBuild/Packaging/Files/otbenv.bash index ac6e35ff54d5378257b4e3a25c6c5acab7039ecf..4cc55aeb4034a77fd704fd76e25a5f944d3861f2 100644 --- a/SuperBuild/Packaging/Files/otbenv.profile +++ b/SuperBuild/Packaging/Files/otbenv.bash @@ -1,17 +1,13 @@ -#!/bin/sh +#!/usr/bin/env bash -DIRNAME_0=$(dirname "$0") -cd "$DIRNAME_0" - -CURRENT_DIR=$(pwd) +CURRENT_DIR=$(cd -P -- "$(dirname -- "$BASH_SOURCE")" && printf '%s\n' "$(pwd -P)") unset LD_LIBRARY_PATH -PATH=$PATH:$CURRENT_DIR/bin +PATH=$CURRENT_DIR/bin:$PATH GDAL_DATA=$CURRENT_DIR/share/gdal GEOTIFF_CSV=$CURRENT_DIR/share/epsg_csv export PATH export GDAL_DATA export GEOTIFF_CSV - diff --git a/SuperBuild/Packaging/Files/otbenv.cmd b/SuperBuild/Packaging/Files/otbenv.cmd index 493cfbde9719b9e0eb2f064022a58703961a4bc6..e7f605870e79019a5bafb0b018ed3164c355df86 100644 --- a/SuperBuild/Packaging/Files/otbenv.cmd +++ b/SuperBuild/Packaging/Files/otbenv.cmd @@ -1,6 +1,6 @@ set CURRENT_SCRIPT_DIR=%~dp0 -set PATH=%PATH%;%CURRENT_SCRIPT_DIR%\bin +set PATH=%CURRENT_SCRIPT_DIR%\bin;%PATH% set GDAL_DATA=%CURRENT_SCRIPT_DIR%\share\gdal diff --git a/SuperBuild/Packaging/InstallSupportFiles.cmake b/SuperBuild/Packaging/InstallSupportFiles.cmake index dab10f56ac31f1796e57804e79a6c2b669255971..cd3b76d5b59c7af029b621e560cca8513d44b082 100644 --- a/SuperBuild/Packaging/InstallSupportFiles.cmake +++ b/SuperBuild/Packaging/InstallSupportFiles.cmake @@ -47,10 +47,47 @@ function(func_install_xdk_files) endif() endforeach() - file(GLOB ITK_CMAKE_DIRS "${DEPENDENCIES_INSTALL_DIR}/lib/cmake/ITK*") - foreach(ITK_CMAKE_DIR ${ITK_CMAKE_DIRS}) - func_install_without_message("${ITK_CMAKE_DIR}" "lib/cmake") - endforeach() + set(ITK_CMAKE_DIR "${DEPENDENCIES_INSTALL_DIR}/lib/cmake/ITK-${PKG_ITK_SB_VERSION}") + message("COPY ${DEPENDENCIES_INSTALL_DIR}/lib/cmake/ITK-${PKG_ITK_SB_VERSION} to ${CMAKE_CURRENT_BINARY_DIR}/_tmp/ to patch") + execute_process( + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/_tmp/ + COMMAND ${CMAKE_COMMAND} + -E copy_directory + ${ITK_CMAKE_DIR} + ${CMAKE_CURRENT_BINARY_DIR}/_tmp/ITK-${PKG_ITK_SB_VERSION} + ) + + #reset ITK_CMAKE_DIR + set(ITK_CMAKE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_tmp/ITK-${PKG_ITK_SB_VERSION}") + + set(DIR_LIST "${CMAKE_CURRENT_BINARY_DIR}/_tmp/ITK-${PKG_ITK_SB_VERSION}|${CMAKE_CURRENT_BINARY_DIR}/_tmp/ITK-${PKG_ITK_SB_VERSION}/Modules") + + #SUPERBUILD_INSTALL_DIR + execute_process( + COMMAND ${CMAKE_COMMAND} + -DP_DIRS=${DIR_LIST} + -DP_MATCH=${CMAKE_INSTALL_PREFIX} + -DP_REPLACE=ITK_INSTALL_PREFIX + -P ${PACKAGE_OTB_SRC_DIR}/SuperBuild/CMake/post_install.cmake + RESULT_VARIABLE patch_itk_cmake_rv + ) + + file(STRINGS "${SUPERBUILD_BINARY_DIR}/ITK/build/CMakeCache.txt" + MATCH_FOUND REGEX "ITK_USE_SYSTEM_ZLIB:BOOL=ON") + if(MATCH_FOUND) + find_package(ZLIB QUIET) + get_filename_component(ZLIB_PREFIX ${ZLIB_LIBRARY} PATH) + execute_process( + COMMAND ${CMAKE_COMMAND} + -DP_DIRS=${DIR_LIST} + -DP_MATCH=${ZLIB_PREFIX} + -DP_REPLACE=ITK_INSTALL_PREFIX + -P ${PACKAGE_OTB_SRC_DIR}/SuperBuild/CMake/post_install.cmake + ) + + endif() + + func_install_without_message("${ITK_CMAKE_DIR}" "lib/cmake") set(QT_REQ_DIRS) if(WIN32) @@ -227,16 +264,18 @@ function(func_install_otb_support_files) set(PKG_SHARE_SOURCE_DIR ${DEPENDENCIES_INSTALL_DIR}/share) #For Unixes we make them in the *pkgsetup.in - ##################### install environment source ########################## + ##################### install environment setup file ########################## if(WIN32) - foreach(ENV_SOURCE_FILE - "${PACKAGE_SUPPORT_FILES_DIR}/otbenv.cmd" - "${PACKAGE_SUPPORT_FILES_DIR}/otbenv.profile") - if(EXISTS ${ENV_SOURCE_FILE}) - install(FILES ${ENV_SOURCE_FILE} DESTINATION ${PKG_STAGE_DIR}) - endif() - endforeach() + install( + FILES ${PACKAGE_SUPPORT_FILES_DIR}/otbenv.cmd + DESTINATION ${PKG_STAGE_DIR} + ) + install( + FILES ${PACKAGE_SUPPORT_FILES_DIR}/otbenv.bash + DESTINATION ${PKG_STAGE_DIR} + ) + #we need startup files for mapla monteverdi in the root directory #For Unixes, we make them inside pkgsetup script! foreach(exe_file mapla monteverdi) @@ -290,6 +329,7 @@ function(func_install_monteverdi_support_files) # we find this value by parsing ConfigureMonteverdi.h set(ConfigureMonteverdi_H "${OTB_BINARY_DIR}/Modules/Visualization/MonteverdiCore/ConfigureMonteverdi.h") if(NOT EXISTS "${ConfigureMonteverdi_H}") + #maybe deactivate monteverdi? message(FATAL_ERROR "${ConfigureMonteverdi_H} does not exists. Cannot continue") endif() diff --git a/SuperBuild/Packaging/PackageGlobals.cmake b/SuperBuild/Packaging/PackageGlobals.cmake index 4c33431831cd678c86ace612ce8cd401cc59929c..863fb92c2f174c2b9ab8529c2c3c663beedc2096 100644 --- a/SuperBuild/Packaging/PackageGlobals.cmake +++ b/SuperBuild/Packaging/PackageGlobals.cmake @@ -68,7 +68,9 @@ set(LINUX_SYSTEM_DLLS libICE.so* libXrandr.so* libpython* - libexpat.so.0 + libexpat.so.* + libfontconfig.so* + libfreetype.so* ) # libgcc_s.*dylib and other *.framework are dragged by QT @@ -129,11 +131,8 @@ set(GTK_LIB_LIST_1 libffi.so.6 ) set(GTK_LIB_LIST_2 - libfreetype.so.6 libz.so.1 libpng12.so.0 - libexpat.so.1 - libfontconfig.so.1 ) set(ALLOWED_SYSTEM_DLLS ${GTK_LIB_LIST_1} ${GTK_LIB_LIST_2}) diff --git a/SuperBuild/Packaging/PackageHelper.cmake b/SuperBuild/Packaging/PackageHelper.cmake index 91eae8e359fe65c3efb313ba7a719674d4ee1f78..dd42ddf4b43759c50821f518bf740bbf6c1bd9b5 100644 --- a/SuperBuild/Packaging/PackageHelper.cmake +++ b/SuperBuild/Packaging/PackageHelper.cmake @@ -105,7 +105,7 @@ macro(macro_super_package) "UniversalCRTSdkDir variable not set. call vcvarsall.bat <arch> first before starting build.") endif() - #addtional msvc redist dll from VCINSTALLDIR + #additional msvc redist dll from VCINSTALLDIR if(DEFINED ENV{VCINSTALLDIR}) file(TO_CMAKE_PATH "$ENV{VCINSTALLDIR}" PKG_VCINSTALLDIR) list( @@ -329,7 +329,9 @@ endfunction() #func_prepare_package function(func_process_deps input_file) + set(input_file_full_path) search_library(${input_file} PKG_SEARCHDIRS input_file_full_path) + if(NOT input_file_full_path) if(LINUX) setif_value_in_list(is_gtk_lib "${input_file}" ALLOWED_SYSTEM_DLLS) @@ -346,10 +348,13 @@ function(func_process_deps input_file) endif() #if(NOT input_file_full_path) - message("Processing ${input_file_full_path}") + if(NOT PKG_DEBUG) + message("Processing ${input_file_full_path}") + endif() set(is_executable FALSE) is_file_executable2(input_file_full_path is_executable) + if(NOT is_executable) #copy back to input_file_full_path pkg_install_rule(${input_file_full_path}) @@ -376,23 +381,23 @@ function(func_process_deps input_file) OR IS_DIRECTORY "${sofile}" ) set(not_valid TRUE) endif() - + if(not_valid) continue() endif() - + func_is_file_a_symbolic_link("${sofile}" is_symlink linked_to_file) - + if(is_symlink) add_to_symlink_list("${linked_to_file}" "${basename_of_sofile}") endif() # is_symlink - + endforeach() - + endif(UNIX) - + set(raw_items) - + execute_process( COMMAND ${LOADER_PROGRAM} ${LOADER_PROGRAM_ARGS} "${input_file_full_path}" RESULT_VARIABLE loader_rv @@ -410,10 +415,15 @@ function(func_process_deps input_file) get_filename_component(bn_name ${input_file_full_path} NAME) set(${bn_name}_USED TRUE CACHE INTERNAL "") + if(PKG_DEBUG) + message("Processing ${input_file} started. Set ${bn_name}_USED=${${bn_name}_USED}") + endif() + foreach(candidate ${candidates}) if(NOT candidate) continue() endif() + if(NOT "${candidate}" MATCHES "${loader_program_regex}") continue() endif() @@ -423,25 +433,25 @@ function(func_process_deps input_file) if(NOT raw_item) continue() endif() - + string(STRIP ${raw_item} raw_item) set(is_system FALSE) setif_value_in_list(is_system "${raw_item}" SYSTEM_DLLS) if(APPLE AND NOT is_system) if("${raw_item}" MATCHES "@rpath") - string(REGEX REPLACE "@rpath." "" raw_item "${raw_item}") + string(REGEX REPLACE "@rpath." "" raw_item "${raw_item}") else() - message(FATAL_ERROR "'${raw_item}' does not have @rpath") + message(FATAL_ERROR "'${raw_item}' does not have @rpath") endif() endif() - - if(is_system OR ${raw_item}_RESOLVED OR ${raw_item}_USED) - continue() + + if(PKG_DEBUG AND ${raw_item}_RESOLVED) + message("${raw_item} is already resolved [${raw_item}_RESOLVED=${${raw_item}_RESOLVED}]") endif() - - if(PKG_DEBUG) - message("${raw_item} is not resolved, used. ${raw_item}_RESOLVED | ${raw_item}_USED") + + if(is_system OR ${raw_item}_RESOLVED OR ${raw_item}_USED) + continue() endif() list(APPEND raw_items ${raw_item}) @@ -450,7 +460,7 @@ function(func_process_deps input_file) if(PKG_DEBUG) string(REPLACE ";" "\n" raw_items_pretty_print "${raw_items}") - message(FATAL_ERROR "raw_items=${raw_items_pretty_print}") + # message(FATAL_ERROR "raw_items=${raw_items_pretty_print}") endif(PKG_DEBUG) if(raw_items) @@ -459,25 +469,25 @@ function(func_process_deps input_file) search_library(${item} PKG_SEARCHDIRS item_full_path) set(is_a_symlink FALSE) set(item_target_file) - if(PKG_DEBUG) - message("item0=${item_full_path}") - endif() func_is_file_a_symbolic_link("${item_full_path}" is_a_symlink item_target_file) if(is_a_symlink) - set(${item}_RESOLVED TRUE CACHE INTERNAL "") - set(item ${item_target_file}) + set(${item}_RESOLVED TRUE CACHE INTERNAL "") + set(item ${item_target_file}) endif() if(PKG_DEBUG) - message("running func_process_deps on '${item}'") + message("${bn_name} depends on '${item}'. So we now process '${item}'") # [ ${item}_USED=${${item}_USED} ${item}_RESOLVED=${${item}_RESOLVED}]") endif() func_process_deps(${item}) - endforeach() -endif() - -set(${bn_name}_RESOLVED TRUE CACHE INTERNAL "") + endforeach() + endif() -pkg_install_rule(${input_file_full_path}) + set(${bn_name}_RESOLVED TRUE CACHE INTERNAL "") + if(PKG_DEBUG) + message("All dependencies of ${bn_name} are processed. Install file and set ${bn_name}_RESOLVED=${${bn_name}_RESOLVED}") + endif() + #Install the file with pkg_install_rule. This function has specific rules to decide wheather install file or not + pkg_install_rule(${input_file_full_path}) endfunction() #function(func_process_deps infile) diff --git a/SuperBuild/Packaging/PackageMacros.cmake b/SuperBuild/Packaging/PackageMacros.cmake index c5c975eb912ab369f6b57071855371cb5630af35..6a5ac835872e7ec892d6a82ed2984deb0b0bf2e3 100755 --- a/SuperBuild/Packaging/PackageMacros.cmake +++ b/SuperBuild/Packaging/PackageMacros.cmake @@ -55,7 +55,7 @@ function(search_library input_file pkg_searchdirs result) if(EXISTS ${pkg_searchdir}/${input_file} ) if(PKG_DEBUG) - message("searching for '${input_file}' in '${pkg_searchdir}'") + message("Found '${pkg_searchdir}/${input_file}' (return)") endif() set(${result} "${pkg_searchdir}/${input_file}" PARENT_SCOPE) return() @@ -115,9 +115,7 @@ function(is_file_executable2 file_var result_var) set(${result_var} 0 PARENT_SCOPE) get_filename_component(file_full "${${file_var}}" ABSOLUTE) - set(${file_var} "${file_full}" PARENT_SCOPE) string(TOLOWER "${file_full}" file_full_lower) - # If file name ends in .exe on Windows, *assume* executable: # if(WIN32 AND NOT UNIX) @@ -137,7 +135,12 @@ function(is_file_executable2 file_var result_var) message("Resolving '${file_full}' to '${file_full_target}") get_filename_component(file_full_path "${file_full}" PATH) set(file_full "${file_full_path}/${file_full_target}") - set(${file_var} "${file_full}" PARENT_SCOPE) + if( EXISTS "${file_full}") + set(${file_var} "${file_full}" PARENT_SCOPE) + else() + message(FATAL_ERROR "${file_full} does not exists. Cannot continue") + endif() + string(TOLOWER "${file_full}" file_full_lower) endif() diff --git a/SuperBuild/patches/QT4/qt4-4-mantis1334-qpoint-initialization-all.diff b/SuperBuild/patches/QT4/qt4-4-mantis1334-qpoint-initialization-all.diff new file mode 100644 index 0000000000000000000000000000000000000000..d37eb1f13220801e1d35446b5c12d638774326b5 --- /dev/null +++ b/SuperBuild/patches/QT4/qt4-4-mantis1334-qpoint-initialization-all.diff @@ -0,0 +1,30 @@ +--- qt-everywhere-opensource-src-4.8.7.orig/src/gui/itemviews/qtreeview.cpp 2015-05-07 16:14:43.000000000 +0200 ++++ qt-everywhere-opensource-src-4.8.7/src/gui/itemviews/qtreeview.cpp 2017-02-07 15:30:57.463689900 +0100 +@@ -2261,10 +2261,23 @@ + return; + + d->executePostedLayout(); +- QPoint tl(isRightToLeft() ? qMax(rect.left(), rect.right()) +- : qMin(rect.left(), rect.right()), qMin(rect.top(), rect.bottom())); +- QPoint br(isRightToLeft() ? qMin(rect.left(), rect.right()) : +- qMax(rect.left(), rect.right()), qMax(rect.top(), rect.bottom())); ++ QPoint tl(rect.left(),rect.top()); ++ QPoint br(rect.right(),rect.bottom()); ++ if (isRightToLeft()) { ++ if (rect.left() < rect.right()) { ++ tl.setX(rect.right()); ++ br.setX(rect.left()); ++ } ++ } else { ++ if (rect.left() > rect.right()) { ++ tl.setX(rect.right()); ++ br.setX(rect.left()); ++ } ++ } ++ if (rect.bottom() < rect.top()) { ++ tl.setY(rect.bottom()); ++ br.setY(rect.top()); ++ } + QModelIndex topLeft = indexAt(tl); + QModelIndex bottomRight = indexAt(br); + if (!topLeft.isValid() && !bottomRight.isValid()) { diff --git a/Utilities/Data/Icons/layer-delete.png b/Utilities/Data/Icons/layer-delete.png new file mode 100644 index 0000000000000000000000000000000000000000..7d6aaf6f257bee75a76325181f7a39b4b903034a Binary files /dev/null and b/Utilities/Data/Icons/layer-delete.png differ diff --git a/Utilities/Data/Icons/layer-delete_24x24.png b/Utilities/Data/Icons/layer-delete_24x24.png deleted file mode 100644 index bf57b112d72f6d8276168ff1ef39a2c0e7b63034..0000000000000000000000000000000000000000 Binary files a/Utilities/Data/Icons/layer-delete_24x24.png and /dev/null differ diff --git a/Utilities/Data/Icons/layers-remove_24x24.png b/Utilities/Data/Icons/layers-remove_24x24.png index 8e2713096c7071e7b38aa0bcfee465724e014780..2e2a29e433ed2b895c00fd32fb1dce53541efe1f 100644 Binary files a/Utilities/Data/Icons/layers-remove_24x24.png and b/Utilities/Data/Icons/layers-remove_24x24.png differ diff --git a/Utilities/Data/monteverdi.desktop b/Utilities/Data/monteverdi.desktop.in similarity index 70% rename from Utilities/Data/monteverdi.desktop rename to Utilities/Data/monteverdi.desktop.in index 2e791673b964a8fac739bdafbf2ca275a2a6e64e..ee8b5f1a2b74f5af426f794e7e6c9a2964795d3b 100644 --- a/Utilities/Data/monteverdi.desktop +++ b/Utilities/Data/monteverdi.desktop.in @@ -4,8 +4,8 @@ Name=Monteverdi Name[fr_FR]=Monteverdi GenericName=Image processing Comment=Remote sensing image processing application based on OrfeoToolbox -TryExec=/usr/bin/monteverdi -Exec=/usr/bin/monteverdi %F +TryExec=@CMAKE_INSTALL_PREFIX@/bin/monteverdi +Exec=env OTB_APPLICATION_PATH=@CMAKE_INSTALL_PREFIX@/@OTB_INSTALL_APP_DIR@ @CMAKE_INSTALL_PREFIX@/bin/monteverdi %F Terminal=false StartupNotify=false Icon=monteverdi diff --git a/i18n/fr_FR.ts b/i18n/fr_FR.ts index 3127cae92a120fc18d8369046efbb674cdb7cc47..1779a7ffbc860d921008dd0964a8fe7a195e7ae5 100644 --- a/i18n/fr_FR.ts +++ b/i18n/fr_FR.ts @@ -213,6 +213,46 @@ Veuillez, s'il vous plait, supprimer votre répertoire de cache Monteverdi. <source>512</source> <translation>512</translation> </message> + <message> + <source>Lookup table (jet)</source> + <translation>Table de couleur (jet)</translation> + </message> + <message> + <source>Local lookup table (jet)</source> + <translation>Table de couleur locale (jet)</translation> + </message> + <message> + <source>Lookup table (hot)</source> + <translation>Table de couleur (hot)</translation> + </message> + <message> + <source>Local lookup table (hot)</source> + <translation>Table de couleur locale (hot)</translation> + </message> + <message> + <source>Lookup table (winter)</source> + <translation>Table de couleur (winter)</translation> + </message> + <message> + <source>Local lookup table (winter)</source> + <translation>Table de couleur locale (winter)</translation> + </message> + <message> + <source>Lookup table (summer)</source> + <translation>Table de couleur (summer)</translation> + </message> + <message> + <source>Local lookup table (summer)</source> + <translation>Table de couleur locale (summer)</translation> + </message> + <message> + <source>Lookup table (cool)</source> + <translation>Table de couleur (cool)</translation> + </message> + <message> + <source>Local lookup table (cool)</source> + <translation>Table de couleur locale (cool)</translation> + </message> </context> <context> <name>mvd::AboutDialog</name> @@ -621,6 +661,10 @@ Veuillez, s'il vous plait, supprimer votre répertoire de cache Monteverdi. <source>Gamma: </source> <translation>Gamma : </translation> </message> + <message> + <source>Reset value to 1.</source> + <translation>Réinitialiser à 1.</translation> + </message> </context> <context> <name>mvd::ColorSetupController</name> @@ -1027,7 +1071,7 @@ Veuillez, s'il vous plait, supprimer votre répertoire de cache Monteverdi. </message> <message> <source>Zero relevant pixels found when computing histogram (probably because of no-data settings)</source> - <translation>Aucun pixel utilisable lors du calcul d'histogramme (probablement à cause des réglages no-data)</translation> + <translation>Aucun pixel utilisable lors du calcul d'histogramme (probablement à cause des réglages no-data)</translation> </message> </context> <context> @@ -1262,7 +1306,7 @@ Veuillez, s'il vous plait, supprimer votre répertoire de cache Monteverdi. </message> <message> <source>Cannot access settings file.</source> - <translation>Impossible d'accéder au fichiers des paramètres</translation> + <translation>Impossible d'accéder au fichiers des paramètres</translation> </message> <message> <source>Bad settings file format.</source> @@ -3614,11 +3658,11 @@ p, li { white-space: pre-wrap; } </message> <message> <source>I</source> - <translation>I</translation> + <translation type="obsolete">I</translation> </message> <message> <source>J</source> - <translation>J</translation> + <translation type="obsolete">J</translation> </message> <message> <source>Red</source> @@ -3640,6 +3684,14 @@ p, li { white-space: pre-wrap; } <source>Y</source> <translation>Y</translation> </message> + <message> + <source>Column</source> + <translation>Colonne</translation> + </message> + <message> + <source>Line</source> + <translation>Ligne</translation> + </message> </context> <context> <name>mvd::LayerStackWidget</name> @@ -3688,6 +3740,10 @@ p, li { white-space: pre-wrap; } <comment>Necessary for lupdate to be aware of C++ namespaces. Context comment for translator.</comment> <translation></translation> </message> + <message> + <source>Reset all layer effects to Normal</source> + <translation>Réinitialiser tous les effets à Normal</translation> + </message> </context> <context> <name>mvd::MainWindow</name> @@ -4080,6 +4136,14 @@ Charger '%1' provoquera l'affichage des couches dans une vue non <source>Ctrl+P</source> <translation>Ctrl+P</translation> </message> + <message> + <source>OpenGL texture</source> + <translation>Texture OpenGL</translation> + </message> + <message> + <source>Use OpenGL Shading Language (GLSL)</source> + <translation>Utiliser OpenGL Shading Language (GLSL)</translation> + </message> </context> <context> <name>mvd::MainWindowTitleLoader</name> @@ -4637,7 +4701,7 @@ Merci d'en sélectionner un autre.</translation> </message> <message> <source>mvd</source> - <translation>mvd</translation> + <translation type="obsolete">mvd</translation> </message> <message> <source>Rendering effects have been disabled because OpenGL Shading Language minimal requirements have not been met while running on this system.</source> @@ -4753,11 +4817,11 @@ Merci d'en sélectionner un autre.</translation> </message> <message> <source>Read tag '%1' does not match expected tag '%2'.</source> - <translation>L'étiquette lue '%1' ne correspond pas à l'étiquette attendue '%2'.</translation> + <translation>L'étiquette lue '%1' ne correspond pas à l'étiquette attendue '%2'.</translation> </message> <message> <source>Invalid tag name '%1'.</source> - <translation>Nom d'étiquette invalide '%1'.</translation> + <translation>Nom d'étiquette invalide '%1'.</translation> </message> <message> <source>Array dimension (%1) does not match expected dimension (%2).</source> @@ -4765,31 +4829,31 @@ Merci d'en sélectionner un autre.</translation> </message> <message> <source>Histogram sample count (%1) does not match written sample count (%2).</source> - <translation>Le nombre d'échantillons dans l'histrogramme (%1) ne correspond pas au nombre d'échantillons écrits (%2).</translation> + <translation>Le nombre d'échantillons dans l'histrogramme (%1) ne correspond pas au nombre d'échantillons écrits (%2).</translation> </message> <message> <source>Histogram mins dimension (%1) does not match expected dimension (%2).</source> - <translation>La taille des minima d'histogramme (%1) ne correspond pas à la taille attendue (%2).</translation> + <translation>La taille des minima d'histogramme (%1) ne correspond pas à la taille attendue (%2).</translation> </message> <message> <source>Histogram maxs dimension (%1) does not match expected dimension (%2).</source> - <translation>La taille des maxima d'histogramme (%1) ne correspond pas à la taille attendue (%2).</translation> + <translation>La taille des maxima d'histogramme (%1) ne correspond pas à la taille attendue (%2).</translation> </message> <message> <source>Histogram dimension (%1) does not match expected dimension (%2).</source> - <translation>La taille de l'histogramme (%1) ne correspond pas à la taille attendue (%2).</translation> + <translation>La taille de l'histogramme (%1) ne correspond pas à la taille attendue (%2).</translation> </message> <message> <source>Histogram bin count (%1) does not match expected bin count (%2).</source> - <translation>Le nombre de barres dans l'histogramme (%1) ne correspond pas à la valeur attendue (%2).</translation> + <translation>Le nombre de barres dans l'histogramme (%1) ne correspond pas à la valeur attendue (%2).</translation> </message> <message> <source>Histogram sample count (%1) does not match expected sample count (%2).</source> - <translation>Le nombre d'échantillons dans l'histogramme (%1) ne correspond pas à la valeur attendue (%2).</translation> + <translation>Le nombre d'échantillons dans l'histogramme (%1) ne correspond pas à la valeur attendue (%2).</translation> </message> <message> <source>Read sample count (histogram) (%1) does not match written sample count (%2).</source> - <translation>Le nombre d'échantillons lus (histrogramme) (%1) ne correspond pas au nombre d'échantillons écrits (%2).</translation> + <translation>Le nombre d'échantillons lus (histrogramme) (%1) ne correspond pas au nombre d'échantillons écrits (%2).</translation> </message> </context> <context>