From f226633374810453df8c6bfc15aa2ec79782be8c Mon Sep 17 00:00:00 2001 From: Guillaume Pasero <guillaume.pasero@c-s.fr> Date: Mon, 12 Feb 2018 17:18:37 +0100 Subject: [PATCH] ENH: remove user flag in SetParameterXXX calls (not needed anymore) --- .../app/otbDSFuzzyModelEstimation.cxx | 8 +- .../app/otbKMeansClassification.cxx | 42 +++---- .../app/otbMultiImageSamplingRate.cxx | 2 +- .../app/otbOGRLayerClassifier.cxx | 2 +- .../app/otbSampleExtraction.cxx | 2 +- .../app/otbSampleSelection.cxx | 2 +- .../app/otbTrainImagesClassifier.cxx | 2 +- .../app/otbTrainRegression.cxx | 2 +- .../app/otbVectorClassifier.cxx | 2 +- .../app/otbVectorDataDSValidation.cxx | 4 +- .../include/otbTrainBoost.txx | 8 +- .../include/otbTrainDecisionTree.txx | 14 +-- .../include/otbTrainGradientBoostedTree.txx | 8 +- .../include/otbTrainImagesBase.txx | 52 ++++----- .../AppClassification/include/otbTrainKNN.txx | 2 +- .../include/otbTrainLibSVM.txx | 12 +- .../include/otbTrainNeuralNetwork.txx | 22 ++-- .../include/otbTrainRandomForests.txx | 14 +-- .../AppClassification/include/otbTrainSVM.txx | 34 +++--- .../include/otbTrainSharkRandomForests.txx | 8 +- .../app/otbDimensionalityReduction.cxx | 8 +- .../app/otbDomainTransform.cxx | 4 +- .../AppFiltering/app/otbSmoothing.cxx | 2 +- .../app/otbHyperspectralUnmixing.cxx | 2 +- .../app/otbVertexComponentAnalysis.cxx | 2 +- .../AppImageUtils/app/otbColorMapping.cxx | 14 +-- .../AppImageUtils/app/otbCompareImages.cxx | 8 +- .../AppImageUtils/app/otbConvert.cxx | 2 +- .../AppImageUtils/app/otbDynamicConvert.cxx | 2 +- .../AppImageUtils/app/otbExtractROI.cxx | 108 +++++++++--------- .../AppImageUtils/app/otbManageNoData.cxx | 2 +- .../AppImageUtils/app/otbPixelValue.cxx | 2 +- .../AppImageUtils/app/otbQuicklook.cxx | 16 +-- .../AppImageUtils/app/otbReadImageInfo.cxx | 74 ++++++------ .../AppMathParserX/app/otbBandMathX.cxx | 2 +- .../app/otbOpticalCalibration.cxx | 20 ++-- .../app/otbConvertCartoToGeoPoint.cxx | 4 +- .../app/otbConvertSensorToGeoPoint.cxx | 8 +- .../app/otbGridBasedImageResampling.cxx | 2 +- .../app/otbObtainUTMZoneFromGeoPoint.cxx | 2 +- .../app/otbOrthoRectification.cxx | 60 +++++----- .../app/otbRigidTransformResample.cxx | 2 +- .../AppProjection/app/otbSuperimpose.cxx | 2 +- .../app/otbHooverCompareSegmentation.cxx | 8 +- .../AppSegmentation/app/otbSegmentation.cxx | 4 +- .../AppStereo/app/otbStereoFramework.cxx | 4 +- .../app/otbRasterization.cxx | 2 +- 47 files changed, 304 insertions(+), 304 deletions(-) diff --git a/Modules/Applications/AppClassification/app/otbDSFuzzyModelEstimation.cxx b/Modules/Applications/AppClassification/app/otbDSFuzzyModelEstimation.cxx index e6343bf4b9..ed07d2baf5 100644 --- a/Modules/Applications/AppClassification/app/otbDSFuzzyModelEstimation.cxx +++ b/Modules/Applications/AppClassification/app/otbDSFuzzyModelEstimation.cxx @@ -143,12 +143,12 @@ private: AddParameter(ParameterType_String, "cri", "Criterion"); SetParameterDescription("cri", "Dempster Shafer criterion (by default (belief+plausibility)/2)"); MandatoryOff("cri"); - SetParameterString("cri","((Belief + Plausibility)/2.)", false); + SetParameterString("cri","((Belief + Plausibility)/2.)"); 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, false); + SetParameterFloat("wgt",0.5); 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)"); @@ -157,12 +157,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","", false); + SetParameterString("desclist",""); AddParameter(ParameterType_Int,"maxnbit","Maximum number of iterations"); MandatoryOff("maxnbit"); SetParameterDescription("maxnbit","Maximum number of optimizer iteration (default 200)"); - SetParameterInt("maxnbit",200, false); + SetParameterInt("maxnbit",200); 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 a5067bf9cd..2c7fe5c840 100644 --- a/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx +++ b/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx @@ -148,7 +148,7 @@ protected: void ComputeImageEnvelope(const std::string &vectorFileName) { - GetInternalApplication("imgenvelop")->SetParameterString("out", vectorFileName, false); + GetInternalApplication("imgenvelop")->SetParameterString("out", vectorFileName); GetInternalApplication("imgenvelop")->ExecuteAndWriteOutput(); } @@ -187,8 +187,8 @@ protected: { std::vector<std::string> fieldList = {fieldName}; - GetInternalApplication("polystats")->SetParameterStringList("field", fieldList, false); - GetInternalApplication("polystats")->SetParameterString("out", statisticsFileName, false); + GetInternalApplication("polystats")->SetParameterStringList("field", fieldList); + GetInternalApplication("polystats")->SetParameterString("out", statisticsFileName); ExecuteInternal("polystats"); } @@ -199,17 +199,17 @@ protected: int NBSamples) { /* SampleSelection */ - GetInternalApplication("select")->SetParameterString("out", sampleFileName, false); + GetInternalApplication("select")->SetParameterString("out", sampleFileName); UpdateInternalParameters("select"); - GetInternalApplication("select")->SetParameterString("instats", statisticsFileName, false); - GetInternalApplication("select")->SetParameterString("field", fieldName, false); + GetInternalApplication("select")->SetParameterString("instats", statisticsFileName); + GetInternalApplication("select")->SetParameterString("field", fieldName); - GetInternalApplication("select")->SetParameterString("strategy", "constant", false); - GetInternalApplication("select")->SetParameterInt("strategy.constant.nb", NBSamples, false); + GetInternalApplication("select")->SetParameterString("strategy", "constant"); + GetInternalApplication("select")->SetParameterInt("strategy.constant.nb", NBSamples); if( IsParameterEnabled("rand")) - GetInternalApplication("select")->SetParameterInt("rand", GetParameterInt("rand"), false); + GetInternalApplication("select")->SetParameterInt("rand", GetParameterInt("rand")); // select sample positions ExecuteInternal("select"); @@ -217,8 +217,8 @@ protected: /* SampleExtraction */ UpdateInternalParameters("extraction"); - GetInternalApplication("extraction")->SetParameterString("outfield", "prefix", false); - GetInternalApplication("extraction")->SetParameterString("outfield.prefix.name", "value_", false); + GetInternalApplication("extraction")->SetParameterString("outfield", "prefix"); + GetInternalApplication("extraction")->SetParameterString("outfield.prefix.name", "value_"); // extract sample descriptors GetInternalApplication("extraction")->ExecuteAndWriteOutput(); @@ -229,7 +229,7 @@ protected: const std::string &modelFileName) { std::vector<std::string> extractOutputList = {sampleTrainFileName}; - GetInternalApplication("training")->SetParameterStringList("io.vd", extractOutputList, false); + GetInternalApplication("training")->SetParameterStringList("io.vd", extractOutputList); UpdateInternalParameters("training"); // set field names @@ -242,19 +242,19 @@ protected: oss << i; selectedNames.push_back( selectPrefix + oss.str() ); } - GetInternalApplication("training")->SetParameterStringList("feat", selectedNames, false); + GetInternalApplication("training")->SetParameterStringList("feat", selectedNames); - GetInternalApplication("training")->SetParameterString("classifier", "sharkkm", false); + GetInternalApplication("training")->SetParameterString("classifier", "sharkkm"); GetInternalApplication("training")->SetParameterInt("classifier.sharkkm.maxiter", - GetParameterInt("maxit"), false); + GetParameterInt("maxit")); GetInternalApplication("training")->SetParameterInt("classifier.sharkkm.k", - GetParameterInt("nc"), false); + GetParameterInt("nc")); if( IsParameterEnabled("rand")) - GetInternalApplication("training")->SetParameterInt("rand", GetParameterInt("rand"), false); + GetInternalApplication("training")->SetParameterInt("rand", GetParameterInt("rand")); GetInternalApplication("training")->GetParameterByKey("v")->SetActive(false); - GetInternalApplication("training")->SetParameterString("io.out", modelFileName, false); + GetInternalApplication("training")->SetParameterString("io.out", modelFileName); ExecuteInternal( "training" ); otbAppLogINFO("output model : " << GetInternalApplication("training")->GetParameterString("io.out")); @@ -264,8 +264,8 @@ protected: const std::string &imagesStatsFileName) { std::vector<std::string> imageFileNameList = {imageFileName}; - GetInternalApplication("imgstats")->SetParameterStringList("il", imageFileNameList, false); - GetInternalApplication("imgstats")->SetParameterString("out", imagesStatsFileName, false); + GetInternalApplication("imgstats")->SetParameterStringList("il", imageFileNameList); + GetInternalApplication("imgstats")->SetParameterString("out", imagesStatsFileName); ExecuteInternal( "imgstats" ); otbAppLogINFO("image statistics file : " << GetInternalApplication("imgstats")->GetParameterString("out")); @@ -506,7 +506,7 @@ private: void UpdateKMPolygonClassStatisticsParameters(const std::string &vectorFileName) { - GetInternalApplication( "polystats" )->SetParameterString( "vec", vectorFileName, false ); + GetInternalApplication( "polystats" )->SetParameterString( "vec", vectorFileName); UpdateInternalParameters( "polystats" ); } diff --git a/Modules/Applications/AppClassification/app/otbMultiImageSamplingRate.cxx b/Modules/Applications/AppClassification/app/otbMultiImageSamplingRate.cxx index 889e909cc5..85bed4e53b 100644 --- a/Modules/Applications/AppClassification/app/otbMultiImageSamplingRate.cxx +++ b/Modules/Applications/AppClassification/app/otbMultiImageSamplingRate.cxx @@ -164,7 +164,7 @@ private: SetParameterDescription("strategy.all","Take all samples"); // Default strategy : smallest - SetParameterString("strategy","smallest", false); + SetParameterString("strategy","smallest"); AddParameter(ParameterType_Choice, "mim", "Multi-Image Mode"); diff --git a/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx b/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx index eb58a7e0ac..a29b0bc527 100644 --- a/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx +++ b/Modules/Applications/AppClassification/app/otbOGRLayerClassifier.cxx @@ -82,7 +82,7 @@ private: AddParameter(ParameterType_String,"cfield","Field containing the predicted class."); SetParameterDescription("cfield","Field containing the predicted class"); - SetParameterString("cfield","predicted", false); + SetParameterString("cfield","predicted"); // 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 a9c2b07fbd..4c3d40b560 100644 --- a/Modules/Applications/AppClassification/app/otbSampleExtraction.cxx +++ b/Modules/Applications/AppClassification/app/otbSampleExtraction.cxx @@ -89,7 +89,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_", false); + SetParameterString("outfield.prefix.name", "value_"); 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 b41f20470f..cd3542db8e 100644 --- a/Modules/Applications/AppClassification/app/otbSampleSelection.cxx +++ b/Modules/Applications/AppClassification/app/otbSampleSelection.cxx @@ -200,7 +200,7 @@ private: SetParameterDescription("strategy.all","Take all samples"); // Default strategy : smallest - SetParameterString("strategy","smallest", false); + SetParameterString("strategy","smallest"); 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 a76f81dce7..e17a4adb4e 100644 --- a/Modules/Applications/AppClassification/app/otbTrainImagesClassifier.cxx +++ b/Modules/Applications/AppClassification/app/otbTrainImagesClassifier.cxx @@ -217,7 +217,7 @@ private : void UpdatePolygonClassStatisticsParameters() { std::vector<std::string> vectorFileList = GetParameterStringList( "io.vd" ); - GetInternalApplication( "polystat" )->SetParameterString( "vec", vectorFileList[0], false ); + GetInternalApplication( "polystat" )->SetParameterString( "vec", vectorFileList[0]); UpdateInternalParameters( "polystat" ); } diff --git a/Modules/Applications/AppClassification/app/otbTrainRegression.cxx b/Modules/Applications/AppClassification/app/otbTrainRegression.cxx index 690d03da1d..9d22eb9d1a 100644 --- a/Modules/Applications/AppClassification/app/otbTrainRegression.cxx +++ b/Modules/Applications/AppClassification/app/otbTrainRegression.cxx @@ -183,7 +183,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 , false ); + SetParameterFloat( "sample.vtr" , 0.5); Superclass::DoInit(); diff --git a/Modules/Applications/AppClassification/app/otbVectorClassifier.cxx b/Modules/Applications/AppClassification/app/otbVectorClassifier.cxx index b8ecd88713..1a4d91215a 100644 --- a/Modules/Applications/AppClassification/app/otbVectorClassifier.cxx +++ b/Modules/Applications/AppClassification/app/otbVectorClassifier.cxx @@ -124,7 +124,7 @@ private: "Only geometries with this field available will be taken into account.\n" "The field is added either in the input file (if 'out' off) or in the output file.\n" "Caution, the 'cfield' must not exist in the input file if you are updating the file."); - SetParameterString("cfield","predicted", false); + SetParameterString("cfield","predicted"); AddParameter(ParameterType_ListView, "feat", "Field names to be calculated."); SetParameterDescription("feat","List of field names in the input vector data used as features for training. " diff --git a/Modules/Applications/AppClassification/app/otbVectorDataDSValidation.cxx b/Modules/Applications/AppClassification/app/otbVectorDataDSValidation.cxx index 11e75421ae..05ddb93a05 100644 --- a/Modules/Applications/AppClassification/app/otbVectorDataDSValidation.cxx +++ b/Modules/Applications/AppClassification/app/otbVectorDataDSValidation.cxx @@ -87,12 +87,12 @@ private: AddParameter(ParameterType_String, "cri", "Criterion"); SetParameterDescription("cri", "Dempster Shafer criterion (by default (belief+plausibility)/2)"); MandatoryOff("cri"); - SetParameterString("cri", "((Belief + Plausibility)/2.)", false); + SetParameterString("cri", "((Belief + Plausibility)/2.)"); AddParameter(ParameterType_Float, "thd", "Criterion threshold"); SetParameterDescription("thd", "Criterion threshold (default 0.5)"); MandatoryOff("thd"); - SetParameterFloat("thd",0.5, false); + SetParameterFloat("thd",0.5); 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 46cbbbd125..f971a2a629 100644 --- a/Modules/Applications/AppClassification/include/otbTrainBoost.txx +++ b/Modules/Applications/AppClassification/include/otbTrainBoost.txx @@ -61,16 +61,16 @@ namespace Wrapper SetParameterDescription("classifier.boost.t.gentle", "A modified version of the Real Adaboost algorithm, using Newton stepping " "rather than exact optimization at each step."); - SetParameterString("classifier.boost.t", "real", false); + SetParameterString("classifier.boost.t", "real"); 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, false); + SetParameterInt("classifier.boost.w",100); 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, false); + SetParameterFloat("classifier.boost.r",0.95); 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" @@ -78,7 +78,7 @@ namespace Wrapper "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, false); + SetParameterInt("classifier.boost.m",1); 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 9803a91a7a..bfedec3306 100644 --- a/Modules/Applications/AppClassification/include/otbTrainDecisionTree.txx +++ b/Modules/Applications/AppClassification/include/otbTrainDecisionTree.txx @@ -40,9 +40,9 @@ LearningApplicationBase<TInputValue,TOutputValue> //MaxDepth AddParameter(ParameterType_Int, "classifier.dt.max", "Maximum depth of the tree"); #ifdef OTB_OPENCV_3 - SetParameterInt("classifier.dt.max",10, false); + SetParameterInt("classifier.dt.max",10); #else - SetParameterInt("classifier.dt.max",65535, false); + SetParameterInt("classifier.dt.max",65535); #endif SetParameterDescription("classifier.dt.max", "The training algorithm attempts to split each node while its depth is smaller " @@ -51,14 +51,14 @@ LearningApplicationBase<TInputValue,TOutputValue> //MinSampleCount AddParameter(ParameterType_Int, "classifier.dt.min", "Minimum number of samples in each node"); - SetParameterInt("classifier.dt.min",10, false); + SetParameterInt("classifier.dt.min",10); 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, false); + SetParameterFloat("classifier.dt.ra",0.01); SetParameterDescription("classifier.dt.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 " @@ -72,7 +72,7 @@ LearningApplicationBase<TInputValue,TOutputValue> 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, false); + SetParameterInt("classifier.dt.cat",10); SetParameterDescription("classifier.dt.cat", "Cluster possible values of a categorical variable into K <= cat clusters to find a " "suboptimal split."); @@ -81,9 +81,9 @@ LearningApplicationBase<TInputValue,TOutputValue> AddParameter(ParameterType_Int, "classifier.dt.f", "K-fold cross-validations"); #ifdef OTB_OPENCV_3 // disable cross validation by default (crash in opencv 3.2) - SetParameterInt("classifier.dt.f",0, false); + SetParameterInt("classifier.dt.f",0); #else - SetParameterInt("classifier.dt.f",10, false); + SetParameterInt("classifier.dt.f",10); #endif SetParameterDescription("classifier.dt.f", "If cv_folds > 1, then it prunes a tree with K-fold cross-validation where K " diff --git a/Modules/Applications/AppClassification/include/otbTrainGradientBoostedTree.txx b/Modules/Applications/AppClassification/include/otbTrainGradientBoostedTree.txx index 7f69ac9338..30a3fde157 100644 --- a/Modules/Applications/AppClassification/include/otbTrainGradientBoostedTree.txx +++ b/Modules/Applications/AppClassification/include/otbTrainGradientBoostedTree.txx @@ -52,7 +52,7 @@ LearningApplicationBase<TInputValue,TOutputValue> //WeakCount AddParameter(ParameterType_Int, "classifier.gbt.w", "Number of boosting algorithm iterations"); - SetParameterInt("classifier.gbt.w",200, false); + SetParameterInt("classifier.gbt.w",200); SetParameterDescription( "classifier.gbt.w", "Number \"w\" of boosting algorithm iterations, with w*K being the total number of trees in " @@ -60,20 +60,20 @@ LearningApplicationBase<TInputValue,TOutputValue> //Shrinkage AddParameter(ParameterType_Float, "classifier.gbt.s", "Regularization parameter"); - SetParameterFloat("classifier.gbt.s",0.01, false); + SetParameterFloat("classifier.gbt.s",0.01); 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, false); + SetParameterFloat("classifier.gbt.p",0.8); 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, false); + SetParameterInt("classifier.gbt.max",3); 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/otbTrainImagesBase.txx b/Modules/Applications/AppClassification/include/otbTrainImagesBase.txx index a646cea953..a1f4ca1c23 100644 --- a/Modules/Applications/AppClassification/include/otbTrainImagesBase.txx +++ b/Modules/Applications/AppClassification/include/otbTrainImagesBase.txx @@ -79,7 +79,7 @@ void TrainImagesBase::InitSampling() 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, false ); + SetParameterFloat( "sample.vtr", 0.5); SetMaximumParameterFloatValue( "sample.vtr", 1.0 ); SetMinimumParameterFloatValue( "sample.vtr", 0.0 ); @@ -160,8 +160,8 @@ void TrainImagesBase::ComputePolygonStatistics(FloatVectorImageListType *imageLi for( unsigned int i = 0; i < nbImages; i++ ) { GetInternalApplication( "polystat" )->SetParameterInputImage( "in", imageList->GetNthElement( i ) ); - GetInternalApplication( "polystat" )->SetParameterString( "vec", vectorFileNames[i], false ); - GetInternalApplication( "polystat" )->SetParameterString( "out", statisticsFileNames[i], false ); + GetInternalApplication( "polystat" )->SetParameterString( "vec", vectorFileNames[i]); + GetInternalApplication( "polystat" )->SetParameterString( "out", statisticsFileNames[i]); ExecuteInternal( "polystat" ); } } @@ -170,7 +170,7 @@ void TrainImagesBase::ComputePolygonStatistics(FloatVectorImageListType *imageLi TrainImagesBase::SamplingRates TrainImagesBase::ComputeFinalMaximumSamplingRates(bool dedicatedValidation) { SamplingRates rates; - GetInternalApplication( "rates" )->SetParameterString( "mim", "proportional", false ); + GetInternalApplication( "rates" )->SetParameterString( "mim", "proportional"); double vtr = GetParameterFloat( "sample.vtr" ); long mt = GetParameterInt( "sample.mt" ); long mv = GetParameterInt( "sample.mv" ); @@ -224,11 +224,11 @@ void TrainImagesBase::ComputeSamplingRate(const std::vector<std::string> &statis const std::string &ratesFileName, long maximum) { // Sampling rates - GetInternalApplication( "rates" )->SetParameterStringList( "il", statisticsFileNames, false ); - GetInternalApplication( "rates" )->SetParameterString( "out", ratesFileName, false ); + GetInternalApplication( "rates" )->SetParameterStringList( "il", statisticsFileNames); + GetInternalApplication( "rates" )->SetParameterString( "out", ratesFileName); if( GetParameterInt( "sample.bm" ) != 0 ) { - GetInternalApplication( "rates" )->SetParameterString( "strategy", "smallest", false ); + GetInternalApplication( "rates" )->SetParameterString( "strategy", "smallest"); } else { @@ -236,12 +236,12 @@ void TrainImagesBase::ComputeSamplingRate(const std::vector<std::string> &statis { std::ostringstream oss; oss << maximum; - GetInternalApplication( "rates" )->SetParameterString( "strategy", "constant", false ); - GetInternalApplication( "rates" )->SetParameterString( "strategy.constant.nb", oss.str(), false ); + GetInternalApplication( "rates" )->SetParameterString( "strategy", "constant"); + GetInternalApplication( "rates" )->SetParameterString( "strategy.constant.nb", oss.str()); } else { - GetInternalApplication( "rates" )->SetParameterString( "strategy", "all", false ); + GetInternalApplication( "rates" )->SetParameterString( "strategy", "all"); } } ExecuteInternal( "rates" ); @@ -251,9 +251,9 @@ void TrainImagesBase::TrainModel(FloatVectorImageListType *imageList, const std::vector<std::string> &sampleTrainFileNames, const std::vector<std::string> &sampleValidationFileNames) { - GetInternalApplication( "training" )->SetParameterStringList( "io.vd", sampleTrainFileNames, false ); + GetInternalApplication( "training" )->SetParameterStringList( "io.vd", sampleTrainFileNames); if( !sampleValidationFileNames.empty() ) - GetInternalApplication( "training" )->SetParameterStringList( "valid.vd", sampleValidationFileNames, false ); + GetInternalApplication( "training" )->SetParameterStringList( "valid.vd", sampleValidationFileNames); UpdateInternalParameters( "training" ); // set field names @@ -266,7 +266,7 @@ TrainImagesBase::TrainModel(FloatVectorImageListType *imageList, const std::vect oss << i; selectedNames.push_back( "value_" + oss.str() ); } - GetInternalApplication( "training" )->SetParameterStringList( "feat", selectedNames, false ); + GetInternalApplication( "training" )->SetParameterStringList( "feat", selectedNames); ExecuteInternal( "training" ); } @@ -276,38 +276,38 @@ void TrainImagesBase::SelectAndExtractSamples(FloatVectorImageType *image, std:: std::string selectedField) { GetInternalApplication( "select" )->SetParameterInputImage( "in", image ); - GetInternalApplication( "select" )->SetParameterString( "out", sampleFileName, false ); + GetInternalApplication( "select" )->SetParameterString( "out", sampleFileName); // Change the selection strategy based on selected sampling strategy switch( strategy ) { // case GEOMETRIC: -// GetInternalApplication( "select" )->SetParameterString( "sampler", "random", false ); -// GetInternalApplication( "select" )->SetParameterString( "strategy", "percent", false ); +// GetInternalApplication( "select" )->SetParameterString( "sampler", "random"); +// GetInternalApplication( "select" )->SetParameterString( "strategy", "percent"); // GetInternalApplication( "select" )->SetParameterFloat( "strategy.percent.p", -// GetParameterFloat( "sample.percent" ), false ); +// GetParameterFloat( "sample.percent" )); // break; case CLASS: default: - GetInternalApplication( "select" )->SetParameterString( "vec", vectorFileName, false ); - GetInternalApplication( "select" )->SetParameterString( "instats", statisticsFileName, false ); - GetInternalApplication( "select" )->SetParameterString( "sampler", "periodic", false ); + GetInternalApplication( "select" )->SetParameterString( "vec", vectorFileName); + GetInternalApplication( "select" )->SetParameterString( "instats", statisticsFileName); + GetInternalApplication( "select" )->SetParameterString( "sampler", "periodic"); GetInternalApplication( "select" )->SetParameterInt( "sampler.periodic.jitter", 50 ); - GetInternalApplication( "select" )->SetParameterString( "strategy", "byclass", false ); - GetInternalApplication( "select" )->SetParameterString( "strategy.byclass.in", ratesFileName, false ); + GetInternalApplication( "select" )->SetParameterString( "strategy", "byclass"); + GetInternalApplication( "select" )->SetParameterString( "strategy.byclass.in", ratesFileName); break; } // select sample positions ExecuteInternal( "select" ); - GetInternalApplication( "extraction" )->SetParameterString( "vec", sampleFileName, false ); + GetInternalApplication( "extraction" )->SetParameterString( "vec", sampleFileName); UpdateInternalParameters( "extraction" ); if( !selectedField.empty() ) - GetInternalApplication( "extraction" )->SetParameterString( "field", selectedField, false ); + GetInternalApplication( "extraction" )->SetParameterString( "field", selectedField); - GetInternalApplication( "extraction" )->SetParameterString( "outfield", "prefix", false ); - GetInternalApplication( "extraction" )->SetParameterString( "outfield.prefix.name", "value_", false ); + GetInternalApplication( "extraction" )->SetParameterString( "outfield", "prefix"); + GetInternalApplication( "extraction" )->SetParameterString( "outfield.prefix.name", "value_"); // extract sample descriptors ExecuteInternal( "extraction" ); diff --git a/Modules/Applications/AppClassification/include/otbTrainKNN.txx b/Modules/Applications/AppClassification/include/otbTrainKNN.txx index 2ff93632bc..71e02215db 100644 --- a/Modules/Applications/AppClassification/include/otbTrainKNN.txx +++ b/Modules/Applications/AppClassification/include/otbTrainKNN.txx @@ -39,7 +39,7 @@ namespace Wrapper //K parameter AddParameter(ParameterType_Int, "classifier.knn.k", "Number of Neighbors"); - SetParameterInt("classifier.knn.k",32, false); + SetParameterInt("classifier.knn.k",32); 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 18b9f4d39a..e0ebcea32c 100644 --- a/Modules/Applications/AppClassification/include/otbTrainLibSVM.txx +++ b/Modules/Applications/AppClassification/include/otbTrainLibSVM.txx @@ -54,7 +54,7 @@ namespace Wrapper SetParameterDescription("classifier.libsvm.k.sigmoid", "The kernel is a hyperbolic tangente function of the vectors."); - SetParameterString("classifier.libsvm.k", "linear", false); + SetParameterString("classifier.libsvm.k", "linear"); SetParameterDescription("classifier.libsvm.k", "SVM Kernel Type."); AddParameter(ParameterType_Choice, "classifier.libsvm.m", "SVM Model Type"); SetParameterDescription("classifier.libsvm.m", "Type of SVM formulation."); @@ -67,7 +67,7 @@ namespace Wrapper "multiplier C is used "); AddChoice("classifier.libsvm.m.nusvr", "Nu Support Vector Regression"); - SetParameterString("classifier.libsvm.m", "epssvr", false); + SetParameterString("classifier.libsvm.m", "epssvr"); SetParameterDescription("classifier.libsvm.m.nusvr", "Same as the epsilon regression except that this time the bounded " "parameter nu is used instead of epsilon"); @@ -89,17 +89,17 @@ namespace Wrapper SetParameterDescription("classifier.libsvm.m.oneclass", "All the training data are from the same class, SVM builds a boundary " "that separates the class from the rest of the feature space."); - SetParameterString("classifier.libsvm.m", "csvc", false); + SetParameterString("classifier.libsvm.m", "csvc"); } AddParameter(ParameterType_Float, "classifier.libsvm.c", "Cost parameter C"); - SetParameterFloat("classifier.libsvm.c",1.0, false); + SetParameterFloat("classifier.libsvm.c",1.0); 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."); AddParameter(ParameterType_Float, "classifier.libsvm.nu", "Cost parameter Nu"); - SetParameterFloat("classifier.libsvm.nu",0.5, false); + SetParameterFloat("classifier.libsvm.nu",0.5); SetParameterDescription("classifier.libsvm.nu", "Cost parameter Nu, in the range 0..1, the larger the value, " "the smoother the decision."); @@ -115,7 +115,7 @@ namespace Wrapper if (this->m_RegressionFlag) { AddParameter(ParameterType_Float, "classifier.libsvm.eps", "Epsilon"); - SetParameterFloat("classifier.libsvm.eps",1e-3, false); + SetParameterFloat("classifier.libsvm.eps",1e-3); SetParameterDescription("classifier.libsvm.eps", "The distance between feature vectors from the training set and " "the fitting hyper-plane must be less than Epsilon. For outliers" diff --git a/Modules/Applications/AppClassification/include/otbTrainNeuralNetwork.txx b/Modules/Applications/AppClassification/include/otbTrainNeuralNetwork.txx index 4081034a5f..33a4930ac4 100644 --- a/Modules/Applications/AppClassification/include/otbTrainNeuralNetwork.txx +++ b/Modules/Applications/AppClassification/include/otbTrainNeuralNetwork.txx @@ -52,7 +52,7 @@ LearningApplicationBase<TInputValue,TOutputValue> "take into account the magnitude of the partial derivative (coordinate " "of the gradient) but only its sign."); - SetParameterString("classifier.ann.t", "reg", false); + SetParameterString("classifier.ann.t", "reg"); SetParameterDescription("classifier.ann.t", "Type of training method for the multilayer perceptron (MLP) neural network."); @@ -73,7 +73,7 @@ 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", false); + SetParameterString("classifier.ann.f", "sig"); SetParameterDescription("classifier.ann.f", "This function determine whether the output of the node is positive or not " "depending on the output of the transfert function."); @@ -81,21 +81,21 @@ LearningApplicationBase<TInputValue,TOutputValue> //Alpha AddParameter(ParameterType_Float, "classifier.ann.a", "Alpha parameter of the activation function"); - SetParameterFloat("classifier.ann.a",1., false); + SetParameterFloat("classifier.ann.a",1.); 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., false); + SetParameterFloat("classifier.ann.b",1.); 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, false); + SetParameterFloat("classifier.ann.bpdw",0.1); SetParameterDescription("classifier.ann.bpdw", "Strength of the weight gradient term in the BACKPROP method. The " "recommended value is about 0.1."); @@ -103,7 +103,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, false); + SetParameterFloat("classifier.ann.bpms",0.1); SetParameterDescription("classifier.ann.bpms", "Strength of the momentum term (the difference between weights on the 2 previous " "iterations). This parameter provides some inertia to smooth the random " @@ -113,14 +113,14 @@ 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, false); + SetParameterFloat("classifier.ann.rdw",0.1); 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, false); + SetParameterFloat("classifier.ann.rdwm",1e-7); SetParameterDescription("classifier.ann.rdwm", "Update-values lower limit Delta_{min} in RPROP method. It must be positive " "(default = 1e-7)."); @@ -139,20 +139,20 @@ LearningApplicationBase<TInputValue,TOutputValue> AddChoice("classifier.ann.term.all", "Max. iterations + Epsilon"); SetParameterDescription("classifier.ann.term.all", "Both termination criteria are used. Training stop at the first reached"); - SetParameterString("classifier.ann.term", "all", false); + SetParameterString("classifier.ann.term", "all"); 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, false); + SetParameterFloat("classifier.ann.eps",0.01); 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, false); + SetParameterInt("classifier.ann.iter",1000); 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 f557731207..e19777a686 100644 --- a/Modules/Applications/AppClassification/include/otbTrainRandomForests.txx +++ b/Modules/Applications/AppClassification/include/otbTrainRandomForests.txx @@ -39,7 +39,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, false); + SetParameterInt("classifier.rf.max",5); SetParameterDescription( "classifier.rf.max", "The depth of the tree. A low value will likely underfit and conversely a high value will likely overfit. " @@ -47,14 +47,14 @@ LearningApplicationBase<TInputValue,TOutputValue> //MinSampleCount AddParameter(ParameterType_Int, "classifier.rf.min", "Minimum number of samples in each node"); - SetParameterInt("classifier.rf.min",10, false); + SetParameterInt("classifier.rf.min",10); 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., false); + SetParameterFloat("classifier.rf.ra",0.); 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."); @@ -66,7 +66,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, false); + SetParameterInt("classifier.rf.cat",10); SetParameterDescription( "classifier.rf.cat", "Cluster possible values of a categorical variable into K <= cat clusters to find a suboptimal split."); @@ -78,7 +78,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, false); + SetParameterInt("classifier.rf.var",0); 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). " @@ -87,7 +87,7 @@ LearningApplicationBase<TInputValue,TOutputValue> //MaxNumberOfTrees AddParameter(ParameterType_Int, "classifier.rf.nbtrees", "Maximum number of trees in the forest"); - SetParameterInt("classifier.rf.nbtrees",100, false); + SetParameterInt("classifier.rf.nbtrees",100); SetParameterDescription( "classifier.rf.nbtrees", "The maximum number of trees in the forest. Typically, the more trees you have, the better the accuracy. " @@ -97,7 +97,7 @@ LearningApplicationBase<TInputValue,TOutputValue> //ForestAccuracy AddParameter(ParameterType_Float, "classifier.rf.acc", "Sufficient accuracy (OOB error)"); - SetParameterFloat("classifier.rf.acc",0.01, false); + SetParameterFloat("classifier.rf.acc",0.01); 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 ac9524faa2..71e1f38adf 100644 --- a/Modules/Applications/AppClassification/include/otbTrainSVM.txx +++ b/Modules/Applications/AppClassification/include/otbTrainSVM.txx @@ -42,14 +42,14 @@ 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", false); + SetParameterString("classifier.svm.m", "epssvr"); } 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", false); + SetParameterString("classifier.svm.m", "csvc"); } AddParameter(ParameterType_Choice, "classifier.svm.k", "SVM Kernel Type"); AddChoice("classifier.svm.k.linear", "Linear"); @@ -57,22 +57,22 @@ namespace Wrapper 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", false); + SetParameterString("classifier.svm.k", "linear"); SetParameterDescription("classifier.svm.k", "SVM Kernel Type."); AddParameter(ParameterType_Float, "classifier.svm.c", "Cost parameter C"); - SetParameterFloat("classifier.svm.c",1.0, false); + SetParameterFloat("classifier.svm.c",1.0); 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, false); + SetParameterFloat("classifier.svm.nu",0.0); 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, false); + SetParameterFloat("classifier.svm.p",1.0); SetParameterDescription("classifier.svm.p", "Parameter epsilon of a SVM optimization problem (EPS_SVR)."); AddParameter(ParameterType_Choice, @@ -87,29 +87,29 @@ namespace Wrapper "Stops when either iteration or epsilon criteria is true"); AddParameter(ParameterType_Float, "classifier.svm.iter", "Maximum iteration"); - SetParameterFloat("classifier.svm.iter",1000, false); + SetParameterFloat("classifier.svm.iter",1000); 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, false); + SetParameterFloat("classifier.svm.eps",FLT_EPSILON); 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, false); + SetParameterFloat("classifier.svm.coef0",0.0); 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, false); + SetParameterFloat("classifier.svm.gamma",1.0); 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, false); + SetParameterFloat("classifier.svm.degree",1.0); SetParameterDescription("classifier.svm.degree", "Parameter degree of a kernel function (POLY)."); AddParameter(ParameterType_Empty, "classifier.svm.opt", @@ -237,15 +237,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()), false); - SetParameterFloat("classifier.svm.nu",static_cast<float> (SVMClassifier->GetOutputNu()), false); + SetParameterFloat("classifier.svm.c",static_cast<float> (SVMClassifier->GetOutputC())); + SetParameterFloat("classifier.svm.nu",static_cast<float> (SVMClassifier->GetOutputNu())); if (this->m_RegressionFlag) { - SetParameterFloat("classifier.svm.p",static_cast<float> (SVMClassifier->GetOutputP()), false); + SetParameterFloat("classifier.svm.p",static_cast<float> (SVMClassifier->GetOutputP())); } - 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); + 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())); } } //end namespace wrapper diff --git a/Modules/Applications/AppClassification/include/otbTrainSharkRandomForests.txx b/Modules/Applications/AppClassification/include/otbTrainSharkRandomForests.txx index f2c2f97dc2..fa7ef6646a 100644 --- a/Modules/Applications/AppClassification/include/otbTrainSharkRandomForests.txx +++ b/Modules/Applications/AppClassification/include/otbTrainSharkRandomForests.txx @@ -43,7 +43,7 @@ LearningApplicationBase<TInputValue,TOutputValue> //MaxNumberOfTrees AddParameter(ParameterType_Int, "classifier.sharkrf.nbtrees", "Maximum number of trees in the forest"); - SetParameterInt("classifier.sharkrf.nbtrees",100, false); + SetParameterInt("classifier.sharkrf.nbtrees",100); SetParameterDescription( "classifier.sharkrf.nbtrees", "The maximum number of trees in the forest. Typically, the more trees you have, the better the accuracy. " @@ -53,7 +53,7 @@ LearningApplicationBase<TInputValue,TOutputValue> //NodeSize AddParameter(ParameterType_Int, "classifier.sharkrf.nodesize", "Min size of the node for a split"); - SetParameterInt("classifier.sharkrf.nodesize",25, false); + SetParameterInt("classifier.sharkrf.nodesize",25); SetParameterDescription( "classifier.sharkrf.nodesize", "If the number of samples in a node is smaller than this parameter, " @@ -61,7 +61,7 @@ LearningApplicationBase<TInputValue,TOutputValue> //MTry AddParameter(ParameterType_Int, "classifier.sharkrf.mtry", "Number of features tested at each node"); - SetParameterInt("classifier.sharkrf.mtry",0, false); + SetParameterInt("classifier.sharkrf.mtry",0); SetParameterDescription( "classifier.sharkrf.mtry", "The number of features (variables) which will be tested at each node in " @@ -71,7 +71,7 @@ LearningApplicationBase<TInputValue,TOutputValue> //OOB Ratio AddParameter(ParameterType_Float, "classifier.sharkrf.oobr", "Out of bound ratio"); - SetParameterFloat("classifier.sharkrf.oobr",0.66, false); + SetParameterFloat("classifier.sharkrf.oobr",0.66); 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 686b78bb4c..c876a6983c 100644 --- a/Modules/Applications/AppDimensionalityReduction/app/otbDimensionalityReduction.cxx +++ b/Modules/Applications/AppDimensionalityReduction/app/otbDimensionalityReduction.cxx @@ -196,7 +196,7 @@ private: unsigned int nbComp = static_cast<unsigned int> (GetParameterInt("nbcomp")); if (nbComp > nbComponents) { - SetParameterInt("nbcomp",nbComponents, false); + SetParameterInt("nbcomp",nbComponents); otbAppLogINFO( << "number of selected components can't exceed image dimension : "<<nbComponents ); } @@ -206,14 +206,14 @@ private: if (this->GetParameterString("outinv").size()!= 0) { otbAppLogWARNING(<<"This application only provides the forward transform for the MAF method."); - this->SetParameterString("outinv", "", false); + this->SetParameterString("outinv", ""); } this->DisableParameter("outinv"); if (this->GetParameterString("outmatrix").size()!= 0) { otbAppLogWARNING(<<"No transformation matrix available for MAF method."); - this->SetParameterString("outmatrix", "", false); + this->SetParameterString("outmatrix", ""); } this->DisableParameter("outmatrix"); @@ -225,7 +225,7 @@ private: unsigned int nbComp = static_cast<unsigned int> (GetParameterInt("nbcomp")); if ((nbComp != 0) && (nbComp != nbComponents)) { - SetParameterInt("nbcomp",nbComponents, false); + SetParameterInt("nbcomp",nbComponents); 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 54dbe894f6..8aa359eca3 100644 --- a/Modules/Applications/AppDomainTransform/app/otbDomainTransform.cxx +++ b/Modules/Applications/AppDomainTransform/app/otbDomainTransform.cxx @@ -152,8 +152,8 @@ private: AddChoice("mode.wavelet.form.sym8", "SYMLET8"); // Default values for mode - SetParameterString("mode", "wavelet", false); - SetParameterString("mode.wavelet.form", "haar", false); + SetParameterString("mode", "wavelet"); + SetParameterString("mode.wavelet.form", "haar"); AddParameter(ParameterType_Choice,"direction", "Direction"); AddChoice("direction.forward", "Forward"); diff --git a/Modules/Applications/AppFiltering/app/otbSmoothing.cxx b/Modules/Applications/AppFiltering/app/otbSmoothing.cxx index a31dc93388..5f93a6b871 100644 --- a/Modules/Applications/AppFiltering/app/otbSmoothing.cxx +++ b/Modules/Applications/AppFiltering/app/otbSmoothing.cxx @@ -116,7 +116,7 @@ private: SetDefaultParameterInt( "type.anidif.nbiter" , 10 ); SetDefaultParameterInt( "type.anidif.conductance" , 1. ); - SetParameterString( "type" , "anidif" , false ); + SetParameterString( "type" , "anidif"); // Doc example parameter settings SetExampleComment( "Image smoothing using a mean filter." , 0 ); diff --git a/Modules/Applications/AppHyperspectral/app/otbHyperspectralUnmixing.cxx b/Modules/Applications/AppHyperspectral/app/otbHyperspectralUnmixing.cxx index 8d510460a6..3a5032af1f 100644 --- a/Modules/Applications/AppHyperspectral/app/otbHyperspectralUnmixing.cxx +++ b/Modules/Applications/AppHyperspectral/app/otbHyperspectralUnmixing.cxx @@ -144,7 +144,7 @@ private: AddChoice("ua.mdmdnmf", "MDMDNMF"); SetParameterDescription("ua.mdmdnmf", "Minimum Dispersion Constrained Non Negative Matrix Factorization"); - SetParameterString("ua", "ucls", false); + SetParameterString("ua", "ucls"); // 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 c3b04df6a9..1dc286bb9c 100644 --- a/Modules/Applications/AppHyperspectral/app/otbVertexComponentAnalysis.cxx +++ b/Modules/Applications/AppHyperspectral/app/otbVertexComponentAnalysis.cxx @@ -80,7 +80,7 @@ private: AddParameter(ParameterType_Int, "ne", "Number of endmembers"); SetParameterDescription("ne","The number of endmembers to extract from the hyperspectral image."); - SetParameterInt("ne",1, false); + SetParameterInt("ne",1); 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 ad8c68b614..d687767169 100644 --- a/Modules/Applications/AppImageUtils/app/otbColorMapping.cxx +++ b/Modules/Applications/AppImageUtils/app/otbColorMapping.cxx @@ -346,11 +346,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., false); + SetParameterFloat("method.continuous.min",0.); 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., false); + SetParameterFloat("method.continuous.max",255.); // Optimal LUT AddChoice("method.optimal","Compute an optimized look-up table"); @@ -359,7 +359,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, false); + SetParameterInt("method.optimal.background",0); SetMinimumParameterIntValue("method.optimal.background", 0); SetMaximumParameterIntValue("method.optimal.background", 255); @@ -371,18 +371,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, false); + SetParameterFloat("method.image.nodatavalue",0); 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, false); + SetParameterInt("method.image.low",2); 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, false); + SetParameterInt("method.image.up",2); SetMinimumParameterIntValue("method.image.up", 0); SetMaximumParameterIntValue("method.image.up", 100); @@ -406,7 +406,7 @@ private: if (GetParameterInt("method")==1 || GetParameterInt("method")==3) { otbAppLogWARNING("Override method : use optimal"); - SetParameterInt("method",2, false); + SetParameterInt("method",2); } } } diff --git a/Modules/Applications/AppImageUtils/app/otbCompareImages.cxx b/Modules/Applications/AppImageUtils/app/otbCompareImages.cxx index 2d0d54c83c..d376e56b5c 100644 --- a/Modules/Applications/AppImageUtils/app/otbCompareImages.cxx +++ b/Modules/Applications/AppImageUtils/app/otbCompareImages.cxx @@ -225,10 +225,10 @@ private: otbAppLogINFO( << "PSNR: " << m_CompareFilter->GetPSNR() ); otbAppLogINFO( << "Number of Pixel different: " << 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); + SetParameterFloat( "mse",m_CompareFilter->GetMSE()); + SetParameterFloat( "mae",m_CompareFilter->GetMAE()); + SetParameterFloat( "psnr",m_CompareFilter->GetPSNR()); + SetParameterFloat( "count",m_CompareFilter->GetDiffCount()); } diff --git a/Modules/Applications/AppImageUtils/app/otbConvert.cxx b/Modules/Applications/AppImageUtils/app/otbConvert.cxx index 621d48adb3..2a553a7680 100644 --- a/Modules/Applications/AppImageUtils/app/otbConvert.cxx +++ b/Modules/Applications/AppImageUtils/app/otbConvert.cxx @@ -120,7 +120,7 @@ private: AddChoice("type.none", "None"); AddChoice("type.linear", "Linear"); AddChoice("type.log2", "Log2"); - SetParameterString("type", "none", false); + SetParameterString("type", "none"); AddParameter(ParameterType_Float,"type.linear.gamma","Gamma correction factor"); SetParameterDescription("type.linear.gamma","Gamma correction factor"); diff --git a/Modules/Applications/AppImageUtils/app/otbDynamicConvert.cxx b/Modules/Applications/AppImageUtils/app/otbDynamicConvert.cxx index fa8b76c501..28d51f406e 100644 --- a/Modules/Applications/AppImageUtils/app/otbDynamicConvert.cxx +++ b/Modules/Applications/AppImageUtils/app/otbDynamicConvert.cxx @@ -124,7 +124,7 @@ private: SetParameterDescription("type", "Transfer function for the rescaling"); AddChoice("type.linear", "Linear"); AddChoice("type.log2", "Log2"); - SetParameterString("type", "linear", false); + SetParameterString("type", "linear"); AddParameter(ParameterType_Float,"type.linear.gamma", "Gamma correction factor"); diff --git a/Modules/Applications/AppImageUtils/app/otbExtractROI.cxx b/Modules/Applications/AppImageUtils/app/otbExtractROI.cxx index bd6a8d1583..6bbd121c89 100644 --- a/Modules/Applications/AppImageUtils/app/otbExtractROI.cxx +++ b/Modules/Applications/AppImageUtils/app/otbExtractROI.cxx @@ -267,8 +267,8 @@ private: // Update the sizes only if the user has not defined a size if (!HasUserValue("sizex") && !HasUserValue("sizey") ) { - SetParameterInt("sizex",largestRegion.GetSize()[0], false); - SetParameterInt("sizey",largestRegion.GetSize()[1], false); + SetParameterInt("sizex",largestRegion.GetSize()[0]); + SetParameterInt("sizey",largestRegion.GetSize()[1]); // Compute extent parameter with default sizex and sizey if ( GetParameterString( "mode" ) == "extent" && userExtent ) @@ -316,8 +316,8 @@ private: if(!this->CropRegionOfInterest()) { // Put the index of the ROI to origin and try to crop again - SetParameterInt("startx",0, false); - SetParameterInt("starty",0, false); + SetParameterInt("startx",0); + SetParameterInt("starty",0); this->CropRegionOfInterest(); } @@ -390,10 +390,10 @@ private: inImage->UpdateOutputInformation(); if (region.Crop(inImage->GetLargestPossibleRegion())) { - 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")); + SetParameterInt("sizex",region.GetSize(0)); + SetParameterInt("sizey",region.GetSize(1)); + SetParameterInt("startx",region.GetIndex(0)); + SetParameterInt("starty",region.GetIndex(1)); return true; } } @@ -409,15 +409,15 @@ private: if (GetParameterString( "mode.extent.unit" ) == "pxl" ) { pixelValue = std::round( GetParameterFloat( "mode.extent.ulx" ) ); - SetParameterInt( "startx", pixelValue , true ); + SetParameterInt( "startx", pixelValue); pixelValue = std::round( GetParameterFloat( "mode.extent.lrx" ) \ - pixelValue ) + 1 ; - SetParameterInt( "sizex", pixelValue , true ); + SetParameterInt( "sizex", pixelValue); pixelValue = std::round( GetParameterFloat( "mode.extent.uly" ) ); - SetParameterInt( "starty", pixelValue , true ); + SetParameterInt( "starty", pixelValue); pixelValue = std::round( GetParameterFloat( "mode.extent.lry" ) \ - pixelValue ) + 1 ; - SetParameterInt( "sizey", pixelValue , true ); + SetParameterInt( "sizey", pixelValue); } else if( GetParameterString( "mode.extent.unit" ) == "phy" ) { @@ -432,11 +432,11 @@ private: inImage->TransformPhysicalPointToIndex(ulp,uli); inImage->TransformPhysicalPointToIndex(lrp,lri); - SetParameterInt( "startx", uli[0] , true ); - SetParameterInt( "starty", uli[1] , true ); + SetParameterInt( "startx", uli[0]); + SetParameterInt( "starty", uli[1]); - SetParameterInt( "sizex", lri[0] - uli[0] + 1, true ); - SetParameterInt( "sizey", lri[1] - uli[1] + 1, true ); + SetParameterInt( "sizex", lri[0] - uli[0] + 1); + SetParameterInt( "sizey", lri[1] - uli[1] + 1); } else if( GetParameterString( "mode.extent.unit" ) == "lonlat" ) @@ -458,11 +458,11 @@ private: inImage->TransformPhysicalPointToIndex(ulp_out,uli_out); inImage->TransformPhysicalPointToIndex(lrp_out,lri_out); - SetParameterInt( "startx", uli_out[0] , true ); - SetParameterInt( "starty", uli_out[1] , true ); + SetParameterInt( "startx", uli_out[0]); + SetParameterInt( "starty", uli_out[1]); - SetParameterInt( "sizex", lri_out[0] - uli_out[0] + 1, true ); - SetParameterInt( "sizey", lri_out[1] - uli_out[1] + 1, true ); + SetParameterInt( "sizex", lri_out[0] - uli_out[0] + 1); + SetParameterInt( "sizey", lri_out[1] - uli_out[1] + 1); } this->CropRegionOfInterest(); } @@ -477,22 +477,22 @@ private: lri[ 1 ] = largestRegion.GetSize()[1]; if ( GetParameterString( "mode.extent.unit" ) == "pxl" ) { - SetParameterFloat("mode.extent.ulx", uli[0] , false); - SetParameterFloat("mode.extent.uly", uli[1] , false); - SetParameterFloat("mode.extent.lrx", lri[0] , false); - SetParameterFloat("mode.extent.lry", lri[1] , false); + SetParameterFloat("mode.extent.ulx", uli[0]); + SetParameterFloat("mode.extent.uly", uli[1]); + SetParameterFloat("mode.extent.lrx", lri[0]); + SetParameterFloat("mode.extent.lry", lri[1]); } else if ( GetParameterString( "mode.extent.unit" ) == "phy" ) { itk::Point<float, 2> ulp, lrp; input->TransformIndexToPhysicalPoint(uli,ulp); - SetParameterFloat("mode.extent.ulx",ulp[0], false); - SetParameterFloat("mode.extent.uly",ulp[1], false); + SetParameterFloat("mode.extent.ulx",ulp[0]); + SetParameterFloat("mode.extent.uly",ulp[1]); input->TransformIndexToPhysicalPoint(lri,lrp); - SetParameterFloat("mode.extent.lrx",lrp[0], false); - SetParameterFloat("mode.extent.lry",lrp[1], false); + SetParameterFloat("mode.extent.lrx",lrp[0]); + SetParameterFloat("mode.extent.lry",lrp[1]); } else if ( GetParameterString( "mode.extent.unit" ) == "lonlat" ) { @@ -503,13 +503,13 @@ private: itk::Point<float, 2> ulp_in, lrp_in , ulp_out , lrp_out; input->TransformIndexToPhysicalPoint(uli,ulp_in); ulp_out = rsTransform->TransformPoint( ulp_in ); - SetParameterFloat( "mode.extent.ulx" , ulp_out[ 0 ] , false ); - SetParameterFloat( "mode.extent.uly" , ulp_out[ 1 ] , false ); + SetParameterFloat( "mode.extent.ulx" , ulp_out[ 0 ]); + SetParameterFloat( "mode.extent.uly" , ulp_out[ 1 ]); input->TransformIndexToPhysicalPoint( lri , lrp_in ); lrp_out = rsTransform->TransformPoint( lrp_in ); - SetParameterFloat( "mode.extent.lrx" , lrp_out[ 0 ] , false ); - SetParameterFloat( "mode.extent.lry" , lrp_out[ 1 ] , false ); + SetParameterFloat( "mode.extent.lrx" , lrp_out[ 0 ]); + SetParameterFloat( "mode.extent.lry" , lrp_out[ 1 ]); } } @@ -524,8 +524,8 @@ private: if ( GetParameterString( "mode.radius.unitr" ) == "pxl" ) { pixelValue = std::floor( 2 * GetParameterFloat( "mode.radius.r" ) ) + 1; - SetParameterInt( "sizey", pixelValue , true ); - SetParameterInt( "sizex", pixelValue , true ); + SetParameterInt( "sizey", pixelValue); + SetParameterInt( "sizex", pixelValue); } if ( GetParameterString( "mode.radius.unitr" ) == "phy" ) { @@ -564,8 +564,8 @@ private: { pixelValue = maxR; } - SetParameterInt( "sizey", 2 * pixelValue + 1 , true ); - SetParameterInt( "sizex", 2 * pixelValue + 1 , true ); + SetParameterInt( "sizey", 2 * pixelValue + 1); + SetParameterInt( "sizex", 2 * pixelValue + 1); } } @@ -579,9 +579,9 @@ private: if ( GetParameterString( "mode.radius.unitc" ) == "pxl" && size ) { pixelValue = std::round(GetParameterFloat( "mode.radius.cx" )); - SetParameterInt( "startx", pixelValue - radiusxi , true ); + SetParameterInt( "startx", pixelValue - radiusxi); pixelValue = std::round(GetParameterFloat( "mode.radius.cy" )); - SetParameterInt( "starty", pixelValue - radiusyi , true ); + SetParameterInt( "starty", pixelValue - radiusyi); } if ( GetParameterString( "mode.radius.unitc" ) == "phy" && size ) { @@ -593,8 +593,8 @@ private: bool isIn = inImage->TransformPhysicalPointToIndex( centerp , centeri ); if ( isIn ) { - SetParameterInt( "startx", centeri[0] - radiusxi , true ); - SetParameterInt( "starty", centeri[1] - radiusyi , true ); + SetParameterInt( "startx", centeri[0] - radiusxi); + SetParameterInt( "starty", centeri[1] - radiusyi); } } if ( GetParameterString( "mode.radius.unitc" ) == "lonlat" && size ) @@ -613,8 +613,8 @@ private: centeri_out ); if ( isIn ) { - SetParameterInt( "startx", centeri_out[0] - radiusxi , true ); - SetParameterInt( "starty", centeri_out[1] - radiusyi , true ); + SetParameterInt( "startx", centeri_out[0] - radiusxi); + SetParameterInt( "starty", centeri_out[1] - radiusyi); } } } @@ -636,7 +636,7 @@ private: if ( GetParameterString("mode.radius.unitr") == "pxl" ) { int rad = std::min( centeri[ 0 ], centeri[ 1 ] ); - SetParameterFloat( "mode.radius.r" , rad , false ); + SetParameterFloat( "mode.radius.r" , rad); } if ( GetParameterString("mode.radius.unitr") == "phy" ) { @@ -645,19 +645,19 @@ private: input->TransformIndexToPhysicalPoint(helpRxi,helpRxp); input->TransformIndexToPhysicalPoint(helpRyi,helpRyp); float rad = std::min( helpRxp[0] - helpRyp[0] , helpRyp[1] - helpRxp[1] ); - SetParameterFloat( "mode.radius.r" , rad , false ); + SetParameterFloat( "mode.radius.r" , rad); } if ( GetParameterString("mode.radius.unitc") == "pxl" ) { - SetParameterFloat( "mode.radius.cx" , centeri[0] , false ); - SetParameterFloat( "mode.radius.cy" , centeri[1] , false) ; + SetParameterFloat( "mode.radius.cx" , centeri[0]); + SetParameterFloat( "mode.radius.cy" , centeri[1]) ; } if ( GetParameterString("mode.radius.unitc") == "phy" ) { itk::Point<float, 2> centerp , helpRp; input->TransformIndexToPhysicalPoint(centeri,centerp); - SetParameterFloat( "mode.radius.cx" , centerp[0] , false ); - SetParameterFloat( "mode.radius.cy" , centerp[1] , false) ; + SetParameterFloat( "mode.radius.cx" , centerp[0]); + SetParameterFloat( "mode.radius.cy" , centerp[1]) ; } if ( GetParameterString("mode.radius.unitc") == "lonlat" ) { @@ -668,8 +668,8 @@ private: itk::Point<float, 2> centerp_in, centerp_out; input->TransformIndexToPhysicalPoint(centeri,centerp_in); centerp_out = rsTransform->TransformPoint( centerp_in ); - SetParameterFloat( "mode.radius.cx" , centerp_out[ 0 ] , false ); - SetParameterFloat( "mode.radius.cy" , centerp_out[ 1 ] , false ); + SetParameterFloat( "mode.radius.cx" , centerp_out[ 0 ]); + SetParameterFloat( "mode.radius.cy" , centerp_out[ 1 ]); } } @@ -755,10 +755,10 @@ private: lri[1] = std::max( std::max( uli_out[1] , uri_out[1] ) , std::max( lli_out[1] , lri_out[1] ) ); - SetParameterInt( "startx", uli[0] , false ); - SetParameterInt( "starty", uli[1] , false ); - SetParameterInt( "sizex", lri[0] - uli[0] , false ); - SetParameterInt( "sizey", lri[1] - uli[1] , false ); + SetParameterInt( "startx", uli[0]); + SetParameterInt( "starty", uli[1]); + SetParameterInt( "sizex", lri[0] - uli[0]); + SetParameterInt( "sizey", lri[1] - uli[1]); } } else if( HasValue( "mode.fit.im" ) && GetParameterString( "mode" ) == "fit" ) diff --git a/Modules/Applications/AppImageUtils/app/otbManageNoData.cxx b/Modules/Applications/AppImageUtils/app/otbManageNoData.cxx index 439ba05590..7a2c5820ba 100644 --- a/Modules/Applications/AppImageUtils/app/otbManageNoData.cxx +++ b/Modules/Applications/AppImageUtils/app/otbManageNoData.cxx @@ -112,7 +112,7 @@ private: SetParameterDescription("mode.apply.ndval","No Data value used according to the mask image"); SetDefaultParameterFloat("mode.apply.ndval", 0.0); - SetParameterString("mode","buildmask", false); + SetParameterString("mode","buildmask"); AddRAMParameter(); diff --git a/Modules/Applications/AppImageUtils/app/otbPixelValue.cxx b/Modules/Applications/AppImageUtils/app/otbPixelValue.cxx index 1bca9241ea..03f1351b8d 100644 --- a/Modules/Applications/AppImageUtils/app/otbPixelValue.cxx +++ b/Modules/Applications/AppImageUtils/app/otbPixelValue.cxx @@ -292,7 +292,7 @@ private: id.Fill(0); std::ostringstream oss; oss << extractor->GetOutput()->GetPixel(id); - SetParameterString("value", oss.str(), false); + SetParameterString("value", oss.str()); //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 dd7134c620..b3b12a6efd 100644 --- a/Modules/Applications/AppImageUtils/app/otbQuicklook.cxx +++ b/Modules/Applications/AppImageUtils/app/otbQuicklook.cxx @@ -146,8 +146,8 @@ private: if (!HasUserValue("rsx") && !HasUserValue("rsy") ) { - SetParameterInt("rsx",largestRegion.GetSize()[0], false); - SetParameterInt("rsy",largestRegion.GetSize()[1], false); + SetParameterInt("rsx",largestRegion.GetSize()[0]); + SetParameterInt("rsy",largestRegion.GetSize()[1]); } // Put the limit of the index and the size relative the image @@ -168,8 +168,8 @@ private: if(!this->CropRegionOfInterest()) { // Put the index of the ROI to origin and try to crop again - SetParameterInt("rox",0, false); - SetParameterInt("roy",0, false); + SetParameterInt("rox",0); + SetParameterInt("roy",0); this->CropRegionOfInterest(); } } @@ -188,10 +188,10 @@ bool CropRegionOfInterest() { if (region.Crop(GetParameterImage("in")->GetLargestPossibleRegion())) { - 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") ); + SetParameterInt( "rsx", region.GetSize(0)); + SetParameterInt( "rsy", region.GetSize(1)); + SetParameterInt( "rox", region.GetIndex(0)); + SetParameterInt( "roy", region.GetIndex(1)); return true; } } diff --git a/Modules/Applications/AppImageUtils/app/otbReadImageInfo.cxx b/Modules/Applications/AppImageUtils/app/otbReadImageInfo.cxx index 74bb9c42da..71960d8aca 100644 --- a/Modules/Applications/AppImageUtils/app/otbReadImageInfo.cxx +++ b/Modules/Applications/AppImageUtils/app/otbReadImageInfo.cxx @@ -267,7 +267,7 @@ private: ImageMetadataInterfaceType::Pointer metadataInterface = ImageMetadataInterfaceFactory::CreateIMI(inImage->GetMetaDataDictionary()); //Get number of bands - SetParameterInt("numberbands",inImage->GetNumberOfComponentsPerPixel(), false); + SetParameterInt("numberbands",inImage->GetNumberOfComponentsPerPixel()); ossOutput << "\tNumber of bands : " << GetParameterInt("numberbands") << std::endl; std::vector<bool> noDataValueAvailable; bool ret = itk::ExposeMetaData<std::vector<bool> >(inImage->GetMetaDataDictionary(),MetaDataKey::NoDataValueAvailable,noDataValueAvailable); @@ -298,26 +298,26 @@ private: ossOutput<<std::endl; //Get image size - SetParameterInt("indexx",inImage->GetLargestPossibleRegion().GetIndex()[0], false); - SetParameterInt("indexy",inImage->GetLargestPossibleRegion().GetIndex()[1], false); + SetParameterInt("indexx",inImage->GetLargestPossibleRegion().GetIndex()[0]); + SetParameterInt("indexy",inImage->GetLargestPossibleRegion().GetIndex()[1]); ossOutput << "\tStart index : [" << GetParameterInt("indexx") << "," << GetParameterInt("indexy") << "]" << std::endl; //Get image size - SetParameterInt("sizex",inImage->GetLargestPossibleRegion().GetSize()[0], false); - SetParameterInt("sizey",inImage->GetLargestPossibleRegion().GetSize()[1], false); + SetParameterInt("sizex",inImage->GetLargestPossibleRegion().GetSize()[0]); + SetParameterInt("sizey",inImage->GetLargestPossibleRegion().GetSize()[1]); ossOutput << "\tSize : [" << GetParameterInt("sizex") << "," << GetParameterInt("sizey") << "]" << std::endl; //Get image origin - SetParameterFloat("originx",inImage->GetOrigin()[0], false); - SetParameterFloat("originy",inImage->GetOrigin()[1], false); + SetParameterFloat("originx",inImage->GetOrigin()[0]); + SetParameterFloat("originy",inImage->GetOrigin()[1]); ossOutput << "\tOrigin : [" << GetParameterFloat("originx") << "," << GetParameterFloat("originy") << "]" << std::endl; //Get image spacing - SetParameterFloat("spacingx",inImage->GetSignedSpacing()[0], false); - SetParameterFloat("spacingy",inImage->GetSignedSpacing()[1], false); + SetParameterFloat("spacingx",inImage->GetSignedSpacing()[0]); + SetParameterFloat("spacingy",inImage->GetSignedSpacing()[1]); ossOutput << "\tSpacing : [" << GetParameterFloat("spacingx") << "," << GetParameterFloat("spacingy") << "]" << std::endl; //Estimate ground spacing @@ -336,14 +336,14 @@ private: approxGroundSpacing = groundSpacing->EvaluateAtIndex(index); //Get image estimated ground spacing (in m) - SetParameterFloat("estimatedgroundspacingx",approxGroundSpacing[0], false); - SetParameterFloat("estimatedgroundspacingy",approxGroundSpacing[1], false); + SetParameterFloat("estimatedgroundspacingx",approxGroundSpacing[0]); + SetParameterFloat("estimatedgroundspacingy",approxGroundSpacing[1]); ossOutput << "\tEstimated ground spacing (in meters): [" << GetParameterFloat("estimatedgroundspacingx") << "," << GetParameterFloat("estimatedgroundspacingy") << "]" << std::endl; ossOutput << std::endl << "Image acquisition information:" << std::endl; - SetParameterString("sensor", metadataInterface->GetSensorID(), false); + SetParameterString("sensor", metadataInterface->GetSensorID()); ossOutput << "\tSensor : "; if (!GetParameterString("sensor").empty()) ossOutput << GetParameterString("sensor"); @@ -353,11 +353,11 @@ private: ossOutput << "\tImage identification number: "; if (metadataInterface->GetImageKeywordlist().HasKey("image_id")) { - SetParameterString("id", metadataInterface->GetImageKeywordlist().GetMetadataByKey("image_id"), false); + SetParameterString("id", metadataInterface->GetImageKeywordlist().GetMetadataByKey("image_id")); ossOutput << GetParameterString("id"); } ossOutput << std::endl; - SetParameterString("projectionref", metadataInterface->GetProjectionRef(), false); + SetParameterString("projectionref", metadataInterface->GetProjectionRef()); if (!GetParameterString("projectionref").empty()) ossOutput << "\tImage projection : " << GetParameterString("projectionref") << std::endl; @@ -381,7 +381,7 @@ private: osstime<<"0"; osstime<<metadataInterface->GetMinute(); osstime<<":00"; - SetParameterString("time", osstime.str(), false); + SetParameterString("time", osstime.str()); ossOutput << "\tAcquisition time : " << GetParameterString("time") << std::endl; } @@ -410,29 +410,29 @@ private: if( !coord2name->GetCountryName().empty() ) { - SetParameterString("country", coord2name->GetCountryName(), false); + SetParameterString("country", coord2name->GetCountryName()); ossOutput << "\tCountry : " << GetParameterString("country") << std::endl; } else - SetParameterString("country", "Not available", false); + SetParameterString("country", "Not available"); if( !coord2name->GetPlaceName().empty() ) { - SetParameterString("town", coord2name->GetPlaceName(), false); + SetParameterString("town", coord2name->GetPlaceName()); ossOutput << "\tTown : " << GetParameterString("town") << std::endl; } else - SetParameterString("town", "Not available", false); + SetParameterString("town", "Not available"); // Retrieve footprint - 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); + SetParameterFloat("ullat",ullat); + SetParameterFloat("ullon",ullon); + SetParameterFloat("urlat",urlat); + SetParameterFloat("urlon",urlon); + SetParameterFloat("lrlat",lrlat); + SetParameterFloat("lrlon",lrlon); + SetParameterFloat("lllat",lllat); + SetParameterFloat("lllon",lllon); ossOutput << std::endl << "Image footprint coordinates:" << std::endl; ossOutput << "\tUpper left corner (latitude, longitude) = [" << GetParameterFloat("ullat") << "," << GetParameterFloat("ullon") << "]" << std::endl; @@ -444,15 +444,15 @@ private: { } - SetParameterInt("rgb.r",metadataInterface->GetDefaultDisplay()[0], false); - SetParameterInt("rgb.g",metadataInterface->GetDefaultDisplay()[1], false); - SetParameterInt("rgb.b",metadataInterface->GetDefaultDisplay()[2], false); + SetParameterInt("rgb.r",metadataInterface->GetDefaultDisplay()[0]); + SetParameterInt("rgb.g",metadataInterface->GetDefaultDisplay()[1]); + SetParameterInt("rgb.b",metadataInterface->GetDefaultDisplay()[2]); 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(), false); - SetParameterString("gcp.proj", metadataInterface->GetGCPProjection(), false); + SetParameterInt("gcp.count",metadataInterface->GetGCPCount()); + SetParameterString("gcp.proj", metadataInterface->GetGCPProjection()); ossOutput << std::endl << "Ground control points information:" << std::endl; ossOutput << "\tNumber of GCPs = " << GetParameterInt("gcp.count") << std::endl; @@ -481,16 +481,16 @@ private: ossOutput << "\t\tGround coordinates =" << gcp_geocoord.back() << std::endl; } - SetParameterStringList("gcp.ids", gcp_ids, false); - SetParameterStringList("gcp.imcoord", gcp_imcoord, false); - SetParameterStringList("gcp.geocoord", gcp_geocoord, false); - SetParameterStringList("gcp.info", gcp_infos, false); + SetParameterStringList("gcp.ids", gcp_ids); + SetParameterStringList("gcp.imcoord", gcp_imcoord); + SetParameterStringList("gcp.geocoord", gcp_geocoord); + SetParameterStringList("gcp.info", gcp_infos); if ( IsParameterEnabled("keywordlist") ) { std::ostringstream osskeywordlist; osskeywordlist<<metadataInterface->GetImageKeywordlist() << std::endl; - SetParameterString("keyword", osskeywordlist.str(), false); + SetParameterString("keyword", osskeywordlist.str()); ossOutput << std::endl << "Image OSSIM keywordlist (optional):" << std::endl; ossOutput << "\t" << GetParameterString("keyword") << std::endl; diff --git a/Modules/Applications/AppMathParserX/app/otbBandMathX.cxx b/Modules/Applications/AppMathParserX/app/otbBandMathX.cxx index 90a7f245a6..90be1a12b3 100644 --- a/Modules/Applications/AppMathParserX/app/otbBandMathX.cxx +++ b/Modules/Applications/AppMathParserX/app/otbBandMathX.cxx @@ -289,7 +289,7 @@ private: if (useContext) { // only set the first expression, 'ManyExpression' is disabled. - this->SetParameterString("exp",dummyFilter->GetExpression(0), false); + this->SetParameterString("exp",dummyFilter->GetExpression(0)); } } } diff --git a/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx b/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx index 87e7dc310f..e282f5b7b4 100644 --- a/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx +++ b/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx @@ -197,7 +197,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", false); + SetParameterString("level", "toa"); AddParameter(ParameterType_Empty, "milli", "Convert to milli reflectance"); SetParameterDescription("milli", "Flag to use milli-reflectance instead of reflectance.\n" @@ -429,21 +429,21 @@ private: ossOutput << "Acquisition Minute already set by user: no overload" <<std::endl; else { - SetParameterInt("acqui.minute",lImageMetadataInterface->GetMinute(), false); + SetParameterInt("acqui.minute",lImageMetadataInterface->GetMinute()); } if (HasUserValue("acqui.hour")) ossOutput << "Acquisition Hour already set by user: no overload" <<std::endl; else { - SetParameterInt("acqui.hour",lImageMetadataInterface->GetHour(), false); + SetParameterInt("acqui.hour",lImageMetadataInterface->GetHour()); } if (HasUserValue("acqui.day")) ossOutput << "Acquisition Day already set by user: no overload" <<std::endl; else { - SetParameterInt("acqui.day",lImageMetadataInterface->GetDay(), false); + SetParameterInt("acqui.day",lImageMetadataInterface->GetDay()); if (IsParameterEnabled("acqui.fluxnormcoeff")) DisableParameter("acqui.day"); } @@ -452,7 +452,7 @@ private: ossOutput << "Acquisition Month already set by user: no overload" <<std::endl; else { - SetParameterInt("acqui.month",lImageMetadataInterface->GetMonth(), false); + SetParameterInt("acqui.month",lImageMetadataInterface->GetMonth()); if (IsParameterEnabled("acqui.fluxnormcoeff")) DisableParameter("acqui.month"); } @@ -461,28 +461,28 @@ private: ossOutput << "Acquisition Year already set by user: no overload" <<std::endl; else { - SetParameterInt("acqui.year",lImageMetadataInterface->GetYear(), false); + SetParameterInt("acqui.year",lImageMetadataInterface->GetYear()); } 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(), false); + SetParameterFloat("acqui.sun.elev",lImageMetadataInterface->GetSunElevation()); 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(), false); + SetParameterFloat("acqui.sun.azim",lImageMetadataInterface->GetSunAzimuth()); 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(), false); + SetParameterFloat("acqui.view.elev",lImageMetadataInterface->GetSatElevation()); 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(), false); + SetParameterFloat("acqui.view.azim",lImageMetadataInterface->GetSatAzimuth()); // Set default value so that they are stored somewhere even if // they are overloaded by user values diff --git a/Modules/Applications/AppProjection/app/otbConvertCartoToGeoPoint.cxx b/Modules/Applications/AppProjection/app/otbConvertCartoToGeoPoint.cxx index dfecb742ea..088428ef66 100644 --- a/Modules/Applications/AppProjection/app/otbConvertCartoToGeoPoint.cxx +++ b/Modules/Applications/AppProjection/app/otbConvertCartoToGeoPoint.cxx @@ -122,8 +122,8 @@ private: otbAppLogINFO( << std::setprecision(10) << "Geographic Point (Long, Lat) : (" << geoPoint[0] << ", " << geoPoint[1] << ")" ); - SetParameterFloat( "long",geoPoint[0] , false); - SetParameterFloat( "lat",geoPoint[1] , false); + SetParameterFloat( "long",geoPoint[0]); + SetParameterFloat( "lat",geoPoint[1]); } }; diff --git a/Modules/Applications/AppProjection/app/otbConvertSensorToGeoPoint.cxx b/Modules/Applications/AppProjection/app/otbConvertSensorToGeoPoint.cxx index 384c892f14..c7e6ee3619 100644 --- a/Modules/Applications/AppProjection/app/otbConvertSensorToGeoPoint.cxx +++ b/Modules/Applications/AppProjection/app/otbConvertSensorToGeoPoint.cxx @@ -130,8 +130,8 @@ private: outputPoint = model->TransformPoint(point); // Set the value computed - SetParameterFloat("output.idx",outputPoint[0], false); - SetParameterFloat("output.idy",outputPoint[1], false); + SetParameterFloat("output.idx",outputPoint[0]); + SetParameterFloat("output.idy",outputPoint[1]); // Set the town and the neaerest city CoordinateToName::Pointer coord2name = CoordinateToName::New(); @@ -139,8 +139,8 @@ private: coord2name->SetLat(outputPoint[1]); coord2name->Evaluate(); - SetParameterString("output.town", coord2name->GetPlaceName(), false); - SetParameterString("output.country", coord2name->GetCountryName(), false); + SetParameterString("output.town", coord2name->GetPlaceName()); + SetParameterString("output.country", coord2name->GetCountryName()); } }; diff --git a/Modules/Applications/AppProjection/app/otbGridBasedImageResampling.cxx b/Modules/Applications/AppProjection/app/otbGridBasedImageResampling.cxx index 72c9073a53..750913f778 100644 --- a/Modules/Applications/AppProjection/app/otbGridBasedImageResampling.cxx +++ b/Modules/Applications/AppProjection/app/otbGridBasedImageResampling.cxx @@ -173,7 +173,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", false); + SetParameterString("interpolator","bco"); AddRAMParameter(); diff --git a/Modules/Applications/AppProjection/app/otbObtainUTMZoneFromGeoPoint.cxx b/Modules/Applications/AppProjection/app/otbObtainUTMZoneFromGeoPoint.cxx index 37d0ec7b74..0cfa820b26 100644 --- a/Modules/Applications/AppProjection/app/otbObtainUTMZoneFromGeoPoint.cxx +++ b/Modules/Applications/AppProjection/app/otbObtainUTMZoneFromGeoPoint.cxx @@ -93,7 +93,7 @@ private: { int utmZone = otb::Utils::GetZoneFromGeoPoint(GetParameterFloat("lon"), GetParameterFloat("lat")); - SetParameterInt("utm",utmZone, false); + SetParameterInt("utm",utmZone); } }; diff --git a/Modules/Applications/AppProjection/app/otbOrthoRectification.cxx b/Modules/Applications/AppProjection/app/otbOrthoRectification.cxx index 3c91403e47..4c69b25151 100644 --- a/Modules/Applications/AppProjection/app/otbOrthoRectification.cxx +++ b/Modules/Applications/AppProjection/app/otbOrthoRectification.cxx @@ -274,28 +274,28 @@ private: // Fill the Gui with the computed parameters if (!HasUserValue("outputs.sizex")) - SetParameterInt("outputs.sizex",genericRSEstimator->GetOutputSize()[0], false); + SetParameterInt("outputs.sizex",genericRSEstimator->GetOutputSize()[0]); if (!HasUserValue("outputs.sizey")) - SetParameterInt("outputs.sizey",genericRSEstimator->GetOutputSize()[1], false); + SetParameterInt("outputs.sizey",genericRSEstimator->GetOutputSize()[1]); if (!HasUserValue("outputs.spacingx")) - SetParameterFloat("outputs.spacingx",genericRSEstimator->GetOutputSpacing()[0], false); + SetParameterFloat("outputs.spacingx",genericRSEstimator->GetOutputSpacing()[0]); if (!HasUserValue("outputs.spacingy")) - SetParameterFloat("outputs.spacingy",genericRSEstimator->GetOutputSpacing()[1], false); + SetParameterFloat("outputs.spacingy",genericRSEstimator->GetOutputSpacing()[1]); if (!HasUserValue("outputs.ulx")) - SetParameterFloat("outputs.ulx",genericRSEstimator->GetOutputOrigin()[0] - 0.5 * genericRSEstimator->GetOutputSpacing()[0], false); + SetParameterFloat("outputs.ulx",genericRSEstimator->GetOutputOrigin()[0] - 0.5 * genericRSEstimator->GetOutputSpacing()[0]); if (!HasUserValue("outputs.uly")) - SetParameterFloat("outputs.uly",genericRSEstimator->GetOutputOrigin()[1] - 0.5 * genericRSEstimator->GetOutputSpacing()[1], false); + SetParameterFloat("outputs.uly",genericRSEstimator->GetOutputOrigin()[1] - 0.5 * genericRSEstimator->GetOutputSpacing()[1]); if (!HasUserValue("outputs.lrx")) - SetParameterFloat("outputs.lrx",GetParameterFloat("outputs.ulx") + GetParameterFloat("outputs.spacingx") * static_cast<double>(GetParameterInt("outputs.sizex")), false); + SetParameterFloat("outputs.lrx",GetParameterFloat("outputs.ulx") + GetParameterFloat("outputs.spacingx") * static_cast<double>(GetParameterInt("outputs.sizex"))); if (!HasUserValue("outputs.lry")) - SetParameterFloat("outputs.lry",GetParameterFloat("outputs.uly") + GetParameterFloat("outputs.spacingy") * static_cast<double>(GetParameterInt("outputs.sizey")), false); + SetParameterFloat("outputs.lry",GetParameterFloat("outputs.uly") + GetParameterFloat("outputs.spacingy") * static_cast<double>(GetParameterInt("outputs.sizey"))); // Handle the spacing and size field following the mode // chose by the user @@ -336,8 +336,8 @@ private: MandatoryOff("outputs.ortho"); // Update lower right - 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); + 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"))); } break; case Mode_AutomaticSize: @@ -382,16 +382,16 @@ private: genericRSEstimator->Compute(); // Set the processed size relative to this forced spacing - SetParameterInt("outputs.sizex",genericRSEstimator->GetOutputSize()[0], false); - SetParameterInt("outputs.sizey",genericRSEstimator->GetOutputSize()[1], false); + SetParameterInt("outputs.sizex",genericRSEstimator->GetOutputSize()[0]); + SetParameterInt("outputs.sizey",genericRSEstimator->GetOutputSize()[1]); // Reset Origin to default - SetParameterFloat("outputs.ulx",genericRSEstimator->GetOutputOrigin()[0] - 0.5 * genericRSEstimator->GetOutputSpacing()[0], false); - SetParameterFloat("outputs.uly",genericRSEstimator->GetOutputOrigin()[1] - 0.5 * genericRSEstimator->GetOutputSpacing()[1], false); + SetParameterFloat("outputs.ulx",genericRSEstimator->GetOutputOrigin()[0] - 0.5 * genericRSEstimator->GetOutputSpacing()[0]); + SetParameterFloat("outputs.uly",genericRSEstimator->GetOutputOrigin()[1] - 0.5 * genericRSEstimator->GetOutputSpacing()[1]); // Update lower right - 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); + 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"))); } break; case Mode_AutomaticSpacing: @@ -436,16 +436,16 @@ private: genericRSEstimator->Compute(); // Set the processed spacing relative to this forced size - SetParameterFloat("outputs.spacingx",genericRSEstimator->GetOutputSpacing()[0], false); - SetParameterFloat("outputs.spacingy",genericRSEstimator->GetOutputSpacing()[1], false); + SetParameterFloat("outputs.spacingx",genericRSEstimator->GetOutputSpacing()[0]); + SetParameterFloat("outputs.spacingy",genericRSEstimator->GetOutputSpacing()[1]); // Reset Origin to default - SetParameterFloat("outputs.ulx",genericRSEstimator->GetOutputOrigin()[0] - 0.5 * genericRSEstimator->GetOutputSpacing()[0], false); - SetParameterFloat("outputs.uly",genericRSEstimator->GetOutputOrigin()[1] - 0.5 * genericRSEstimator->GetOutputSpacing()[1], false); + SetParameterFloat("outputs.ulx",genericRSEstimator->GetOutputOrigin()[0] - 0.5 * genericRSEstimator->GetOutputSpacing()[0]); + SetParameterFloat("outputs.uly",genericRSEstimator->GetOutputOrigin()[1] - 0.5 * genericRSEstimator->GetOutputSpacing()[1]); // Update lower right - 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); + 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"))); } break; @@ -489,9 +489,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])), false); + SetParameterInt("outputs.sizex",static_cast<int>(vcl_ceil((GetParameterFloat("outputs.lrx")-GetParameterFloat("outputs.ulx"))/spacing[0]))); if (vcl_abs(spacing[1]) > 0.0) - SetParameterInt("outputs.sizey",static_cast<int>(vcl_ceil((GetParameterFloat("outputs.lry")-GetParameterFloat("outputs.uly"))/spacing[1])), false); + SetParameterInt("outputs.sizey",static_cast<int>(vcl_ceil((GetParameterFloat("outputs.lry")-GetParameterFloat("outputs.uly"))/spacing[1]))); } break; case Mode_OrthoFit: @@ -541,11 +541,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], false); - SetParameterFloat("outputs.uly",orig[1] - 0.5 * spacing[1], false); + SetParameterFloat("outputs.ulx",orig[0] - 0.5 * spacing[0]); + SetParameterFloat("outputs.uly",orig[1] - 0.5 * spacing[1]); // Update lower right - 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); + 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"))); } } break; @@ -591,11 +591,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, false); + SetParameterFloat("opt.gridspacing",optimalSpacing); } else // if (m_OutputProjectionRef == otb::GeoInformationConversion::ToWKT(4326)) { - SetParameterFloat("opt.gridspacing",DefaultGridSpacingMeter, false); + SetParameterFloat("opt.gridspacing",DefaultGridSpacingMeter); } // if (m_OutputProjectionRef == otb::GeoInformationConversion::ToWKT(4326)) } // if (!HasUserValue("opt.gridspacing")) } // if (HasValue("io.in")) diff --git a/Modules/Applications/AppProjection/app/otbRigidTransformResample.cxx b/Modules/Applications/AppProjection/app/otbRigidTransformResample.cxx index 7b6da7d245..01a9d01124 100644 --- a/Modules/Applications/AppProjection/app/otbRigidTransformResample.cxx +++ b/Modules/Applications/AppProjection/app/otbRigidTransformResample.cxx @@ -159,7 +159,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", false); + SetParameterString("interpolator","bco"); // RAM available AddRAMParameter("ram"); diff --git a/Modules/Applications/AppProjection/app/otbSuperimpose.cxx b/Modules/Applications/AppProjection/app/otbSuperimpose.cxx index 1d1018e8fc..2f5786587b 100644 --- a/Modules/Applications/AppProjection/app/otbSuperimpose.cxx +++ b/Modules/Applications/AppProjection/app/otbSuperimpose.cxx @@ -164,7 +164,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", false); + SetParameterString("mode","phr"); } } diff --git a/Modules/Applications/AppSegmentation/app/otbHooverCompareSegmentation.cxx b/Modules/Applications/AppSegmentation/app/otbHooverCompareSegmentation.cxx index 48dd57c2ad..7588f4eb87 100644 --- a/Modules/Applications/AppSegmentation/app/otbHooverCompareSegmentation.cxx +++ b/Modules/Applications/AppSegmentation/app/otbHooverCompareSegmentation.cxx @@ -297,10 +297,10 @@ private: m_InstanceFilter->Update(); - SetParameterFloat("rc",m_InstanceFilter->GetMeanRC(), false); - SetParameterFloat("rf",m_InstanceFilter->GetMeanRF(), false); - SetParameterFloat("ra",m_InstanceFilter->GetMeanRA(), false); - SetParameterFloat("rm",m_InstanceFilter->GetMeanRM(), false); + SetParameterFloat("rc",m_InstanceFilter->GetMeanRC()); + SetParameterFloat("rf",m_InstanceFilter->GetMeanRF()); + SetParameterFloat("ra",m_InstanceFilter->GetMeanRA()); + SetParameterFloat("rm",m_InstanceFilter->GetMeanRM()); } ImageToLabelMapFilterType::Pointer m_GTFilter; diff --git a/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx b/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx index 5b3bfd2361..059ed278ae 100644 --- a/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx +++ b/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx @@ -311,11 +311,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", false); + SetParameterString("mode.vector.layername", "layer"); 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", false); + SetParameterString("mode.vector.fieldname", "DN"); 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 279c09ad2f..a4f3705d58 100644 --- a/Modules/Applications/AppStereo/app/otbStereoFramework.cxx +++ b/Modules/Applications/AppStereo/app/otbStereoFramework.cxx @@ -368,7 +368,7 @@ private: "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","", false); + SetParameterString("input.co",""); DisableParameter("input.co"); AddParameter(ParameterType_Int, "input.channel", "Input Image channel"); @@ -385,7 +385,7 @@ private: // // Build the Output Map Projection // for custom map projection MapProjectionParametersHandler::AddMapProjectionParameters(this, "map"); - SetParameterString("map","wgs", false); + SetParameterString("map","wgs"); 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/AppVectorDataTranslation/app/otbRasterization.cxx b/Modules/Applications/AppVectorDataTranslation/app/otbRasterization.cxx index 748d8f27be..9ddef6c295 100644 --- a/Modules/Applications/AppVectorDataTranslation/app/otbRasterization.cxx +++ b/Modules/Applications/AppVectorDataTranslation/app/otbRasterization.cxx @@ -132,7 +132,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", false); + SetParameterString("mode.attribute.field","DN"); AddRAMParameter(); -- GitLab