From d2458cd0bc421a65d8cde90225581fa32eac47ce Mon Sep 17 00:00:00 2001
From: Guillaume Pasero <guillaume.pasero@c-s.fr>
Date: Mon, 19 Feb 2018 15:34:57 +0100
Subject: [PATCH] ENH: replace Empty by Bool parameter in Applications

---
 .../otbClassificationMapRegularization.cxx    |  8 +++---
 .../app/otbDSFuzzyModelEstimation.cxx         |  5 ++--
 .../app/otbKMeansClassification.cxx           |  7 ++---
 .../app/otbTrainImagesClassifier.cxx          |  2 +-
 .../app/otbTrainVectorClassifier.cxx          |  2 +-
 .../app/otbVectorClassifier.cxx               |  7 ++---
 .../include/otbTrainDecisionTree.txx          |  8 +++---
 .../include/otbTrainImagesBase.txx            |  5 ++--
 .../include/otbTrainLibSVM.txx                | 17 ++++-------
 .../AppClassification/include/otbTrainSVM.txx |  8 ++----
 .../include/otbTrainVectorBase.txx            |  5 ++--
 .../app/otbHomologousPointsExtraction.cxx     | 14 ++++------
 .../app/otbDimensionalityReduction.cxx        |  5 ++--
 .../app/otbDomainTransform.cxx                |  4 +--
 .../AppEdge/app/otbLineSegmentDetection.cxx   |  5 ++--
 .../app/otbContrastEnhancement.cxx            |  8 +++---
 .../AppImageUtils/app/otbManageNoData.cxx     |  8 ++----
 .../app/otbMultiResolutionPyramid.cxx         |  5 ++--
 .../app/otbOpticalCalibration.cxx             | 17 +++++------
 .../app/otbOrthoRectification.cxx             |  6 ++--
 .../app/otbSARCalibration.cxx                 | 16 ++---------
 .../app/otbLSMSSegmentation.cxx               |  9 +++---
 .../app/otbLargeScaleMeanShift.cxx            |  5 ++--
 .../app/otbMeanShiftSmoothing.cxx             |  8 ++----
 .../AppSegmentation/app/otbSegmentation.cxx   | 14 ++++------
 .../AppStereo/app/otbBlockMatching.cxx        |  4 +--
 .../AppStereo/app/otbStereoFramework.cxx      | 28 ++++++++-----------
 .../AppTest/app/otbTestApplication.cxx        |  3 +-
 .../AppVectorUtils/app/otbOSMDownloader.cxx   | 15 +++++-----
 29 files changed, 100 insertions(+), 148 deletions(-)

diff --git a/Modules/Applications/AppClassification/app/otbClassificationMapRegularization.cxx b/Modules/Applications/AppClassification/app/otbClassificationMapRegularization.cxx
index c5b0262be4..269a6f5bf5 100644
--- a/Modules/Applications/AppClassification/app/otbClassificationMapRegularization.cxx
+++ b/Modules/Applications/AppClassification/app/otbClassificationMapRegularization.cxx
@@ -92,7 +92,7 @@ private:
     SetParameterDescription("ip.radius", "The radius of the ball shaped structuring element (expressed in pixels). By default, 'ip.radius = 1 pixel'.");
     SetDefaultParameterInt("ip.radius", 1.0);
 
-    AddParameter(ParameterType_Empty, "ip.suvbool", "Multiple majority: Undecided(X)/Original");
+    AddParameter(ParameterType_Bool, "ip.suvbool", "Multiple majority: Undecided(X)/Original");
     SetParameterDescription("ip.suvbool", "Pixels with more than 1 majority class are marked as Undecided if this parameter is checked (true), or keep their Original labels otherwise (false). Please note that the Undecided value must be different from existing labels in the input labeled image. By default, 'ip.suvbool = false'.");
 
     AddParameter(ParameterType_Int, "ip.nodatalabel", "Label for the NoData class");
@@ -103,7 +103,7 @@ private:
     SetParameterDescription("ip.undecidedlabel", "Label for the Undecided class. By default, 'ip.undecidedlabel = 0'.");
     SetDefaultParameterInt("ip.undecidedlabel", 0.0);
 
-    AddParameter(ParameterType_Empty, "ip.onlyisolatedpixels", "Process isolated pixels only");
+    AddParameter(ParameterType_Bool, "ip.onlyisolatedpixels", "Process isolated pixels only");
     SetParameterDescription("ip.onlyisolatedpixels", "Only pixels whose label is unique in the neighbordhood will be processed. By default, 'ip.onlyisolatedpixels = false'.");
 
     AddParameter(ParameterType_Int, "ip.isolatedthreshold", "Threshold for isolated pixels");
@@ -153,7 +153,7 @@ private:
     m_NeighMajVotingFilter->SetLabelForUndecidedPixels(GetParameterInt("ip.undecidedlabel"));
 
     // Set to Undecided label if NOT unique Majority Voting
-    if (IsParameterEnabled("ip.suvbool"))
+    if (GetParameterInt("ip.suvbool"))
       {
       m_NeighMajVotingFilter->SetKeepOriginalLabelBool(false);
       }
@@ -164,7 +164,7 @@ private:
       }
 
     // Process isolated pixels only
-    if (IsParameterEnabled("ip.onlyisolatedpixels"))
+    if (GetParameterInt("ip.onlyisolatedpixels"))
       {
       m_NeighMajVotingFilter->SetOnlyIsolatedPixels(true);
       m_NeighMajVotingFilter->SetIsolatedThreshold(GetParameterInt("ip.isolatedthreshold"));
diff --git a/Modules/Applications/AppClassification/app/otbDSFuzzyModelEstimation.cxx b/Modules/Applications/AppClassification/app/otbDSFuzzyModelEstimation.cxx
index e6343bf4b9..3e19be7a51 100644
--- a/Modules/Applications/AppClassification/app/otbDSFuzzyModelEstimation.cxx
+++ b/Modules/Applications/AppClassification/app/otbDSFuzzyModelEstimation.cxx
@@ -164,9 +164,8 @@ private:
     SetParameterDescription("maxnbit","Maximum number of optimizer iteration (default 200)");
     SetParameterInt("maxnbit",200, false);
 
-    AddParameter(ParameterType_Empty,"optobs","Optimizer Observer");
+    AddParameter(ParameterType_Bool,"optobs","Optimizer Observer");
     SetParameterDescription("optobs","Activate the optimizer observer");
-    MandatoryOff("optobs");
 
     AddParameter(ParameterType_OutputFilename,"out","Output filename");
     SetParameterDescription("out","Output model file name (xml file) contains the optimal model to perform information fusion.");
@@ -405,7 +404,7 @@ private:
 
     // Create the Command observer and register it with the optimizer.
     CommandIterationUpdate::Pointer observer = CommandIterationUpdate::New();
-    if (IsParameterEnabled("optobs"))
+    if (GetParameterInt("optobs"))
       {
       m_Optimizer->AddObserver(itk::IterationEvent(), observer);
       }
diff --git a/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx b/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx
index a5067bf9cd..67b86ac30e 100644
--- a/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx
+++ b/Modules/Applications/AppClassification/app/otbKMeansClassification.cxx
@@ -59,11 +59,10 @@ protected:
     InitKMClassification();
 
     // init at the end cleanup
-    AddParameter( ParameterType_Empty, "cleanup", "Temporary files cleaning" );
-    EnableParameter( "cleanup" );
+    AddParameter( ParameterType_Bool, "cleanup", "Temporary files cleaning" );
     SetParameterDescription( "cleanup",
                            "If activated, the application will try to clean all temporary files it created" );
-    MandatoryOff( "cleanup" );
+    SetParameterInt("cleanup", 1);
   }
 
   void InitKMSampling()
@@ -497,7 +496,7 @@ private:
     Superclass::CreateOutMeansFile(GetParameterImage("in"), fileNames.modelFile, GetParameterInt("nc"));
 
     // Remove all tempory files
-    if( IsParameterEnabled( "cleanup" ) )
+    if( GetParameterInt( "cleanup" ) )
       {
       otbAppLogINFO( <<"Final clean-up ..." );
       fileNames.clear();
diff --git a/Modules/Applications/AppClassification/app/otbTrainImagesClassifier.cxx b/Modules/Applications/AppClassification/app/otbTrainImagesClassifier.cxx
index a76f81dce7..bb8b14c639 100644
--- a/Modules/Applications/AppClassification/app/otbTrainImagesClassifier.cxx
+++ b/Modules/Applications/AppClassification/app/otbTrainImagesClassifier.cxx
@@ -205,7 +205,7 @@ public:
     TrainModel( imageList, fileNames.sampleTrainOutputs, fileNames.sampleValidOutputs );
 
     // cleanup
-    if( IsParameterEnabled( "cleanup" ) )
+    if( GetParameterInt( "cleanup" ) )
       {
       otbAppLogINFO( <<"Final clean-up ..." );
       fileNames.clear();
diff --git a/Modules/Applications/AppClassification/app/otbTrainVectorClassifier.cxx b/Modules/Applications/AppClassification/app/otbTrainVectorClassifier.cxx
index f37eb3020f..c1f6a9456d 100644
--- a/Modules/Applications/AppClassification/app/otbTrainVectorClassifier.cxx
+++ b/Modules/Applications/AppClassification/app/otbTrainVectorClassifier.cxx
@@ -112,7 +112,7 @@ protected:
     contingencyTableCalculator->Compute(performanceLabeledListSample->Begin(),
                                         performanceLabeledListSample->End(),predictedListSample->Begin(), predictedListSample->End());
 
-    if(IsParameterEnabled("v"))
+    if(GetParameterInt("v"))
     {
       otbAppLogINFO( "Training performances:" );
       otbAppLogINFO(<<"Contingency table: reference labels (rows) vs. produced labels (cols)\n"
diff --git a/Modules/Applications/AppClassification/app/otbVectorClassifier.cxx b/Modules/Applications/AppClassification/app/otbVectorClassifier.cxx
index b8ecd88713..9b996ed189 100644
--- a/Modules/Applications/AppClassification/app/otbVectorClassifier.cxx
+++ b/Modules/Applications/AppClassification/app/otbVectorClassifier.cxx
@@ -130,7 +130,7 @@ private:
     SetParameterDescription("feat","List of field names in the input vector data used as features for training. "
       "Put the same field names as the TrainVectorClassifier application.");
 
-    AddParameter(ParameterType_Empty, "confmap",  "Confidence map");
+    AddParameter(ParameterType_Bool, "confmap",  "Confidence map");
     SetParameterDescription( "confmap", "Confidence map of the produced classification. "
       "The confidence index depends on the model : \n"
       "  - LibSVM : difference between the two highest probabilities "
@@ -145,7 +145,6 @@ private:
       "    * RandomForest : Confidence (proportion of votes for the majority class). "
              "Margin (normalized difference of the votes of the 2 majority classes) is not available for now.\n"
       "    * SVM : distance to margin (only works for 2-class models).\n");
-    MandatoryOff("confmap");
 
     AddParameter(ParameterType_OutputFilename, "out", "Output vector data file containing class labels");
     SetParameterDescription("out","Output vector data file storing sample values (OGR format)."
@@ -271,10 +270,10 @@ private:
 
     ConfidenceListSampleType::Pointer quality;
 
-    bool computeConfidenceMap(IsParameterEnabled("confmap") && m_Model->HasConfidenceIndex() 
+    bool computeConfidenceMap(GetParameterInt("confmap") && m_Model->HasConfidenceIndex() 
                               && !m_Model->GetRegressionMode());
 
-    if (!m_Model->HasConfidenceIndex() && IsParameterEnabled("confmap"))
+    if (!m_Model->HasConfidenceIndex() && GetParameterInt("confmap"))
       {
       otbAppLogWARNING("Confidence map requested but the classifier doesn't support it!");
       }
diff --git a/Modules/Applications/AppClassification/include/otbTrainDecisionTree.txx b/Modules/Applications/AppClassification/include/otbTrainDecisionTree.txx
index 9803a91a7a..0de1daea60 100644
--- a/Modules/Applications/AppClassification/include/otbTrainDecisionTree.txx
+++ b/Modules/Applications/AppClassification/include/otbTrainDecisionTree.txx
@@ -90,13 +90,13 @@ LearningApplicationBase<TInputValue,TOutputValue>
     "is equal to cv_folds.");
 
   //Use1seRule
-  AddParameter(ParameterType_Empty, "classifier.dt.r", "Set Use1seRule flag to false");
+  AddParameter(ParameterType_Bool, "classifier.dt.r", "Set Use1seRule flag to false");
   SetParameterDescription("classifier.dt.r",
       "If true, then a pruning will be harsher. This will make a tree more compact and more "
       "resistant to the training data noise but a bit less accurate.");
 
   //TruncatePrunedTree
-  AddParameter(ParameterType_Empty, "classifier.dt.t", "Set TruncatePrunedTree flag to false");
+  AddParameter(ParameterType_Bool, "classifier.dt.t", "Set TruncatePrunedTree flag to false");
   SetParameterDescription("classifier.dt.t",
     "If true, then pruned branches are physically removed from the tree.");
 
@@ -121,11 +121,11 @@ LearningApplicationBase<TInputValue,TOutputValue>
   classifier->SetRegressionAccuracy(GetParameterFloat("classifier.dt.ra"));
   classifier->SetMaxCategories(GetParameterInt("classifier.dt.cat"));
   classifier->SetCVFolds(GetParameterInt("classifier.dt.f"));
-  if (IsParameterEnabled("classifier.dt.r"))
+  if (GetParameterInt("classifier.dt.r"))
     {
     classifier->SetUse1seRule(false);
     }
-  if (IsParameterEnabled("classifier.dt.t"))
+  if (GetParameterInt("classifier.dt.t"))
     {
     classifier->SetTruncatePrunedTree(false);
     }
diff --git a/Modules/Applications/AppClassification/include/otbTrainImagesBase.txx b/Modules/Applications/AppClassification/include/otbTrainImagesBase.txx
index a646cea953..2c8f60ee0d 100644
--- a/Modules/Applications/AppClassification/include/otbTrainImagesBase.txx
+++ b/Modules/Applications/AppClassification/include/otbTrainImagesBase.txx
@@ -39,11 +39,10 @@ void TrainImagesBase::InitIO()
   SetParameterDescription( "io.vd", "A list of vector data to select the training samples." );
   MandatoryOn( "io.vd" );
 
-  AddParameter( ParameterType_Empty, "cleanup", "Temporary files cleaning" );
-  EnableParameter( "cleanup" );
+  AddParameter( ParameterType_Bool, "cleanup", "Temporary files cleaning" );
   SetParameterDescription( "cleanup",
                            "If activated, the application will try to clean all temporary files it created" );
-  MandatoryOff( "cleanup" );
+  SetParameterInt( "cleanup", 1);
 }
 
 void TrainImagesBase::InitSampling()
diff --git a/Modules/Applications/AppClassification/include/otbTrainLibSVM.txx b/Modules/Applications/AppClassification/include/otbTrainLibSVM.txx
index 18b9f4d39a..6ffd5faccc 100644
--- a/Modules/Applications/AppClassification/include/otbTrainLibSVM.txx
+++ b/Modules/Applications/AppClassification/include/otbTrainLibSVM.txx
@@ -105,11 +105,10 @@ namespace Wrapper
         "the smoother the decision.");
 
     // It seems that it miss a nu parameter for the nu-SVM use. 
-    AddParameter(ParameterType_Empty, "classifier.libsvm.opt", "Parameters optimization");
-    MandatoryOff("classifier.libsvm.opt");
+    AddParameter(ParameterType_Bool, "classifier.libsvm.opt", "Parameters optimization");
     SetParameterDescription("classifier.libsvm.opt", "SVM parameters optimization flag.");
-    AddParameter(ParameterType_Empty, "classifier.libsvm.prob", "Probability estimation");
-    MandatoryOff("classifier.libsvm.prob");
+
+    AddParameter(ParameterType_Bool, "classifier.libsvm.prob", "Probability estimation");
     SetParameterDescription("classifier.libsvm.prob", "Probability estimation flag.");
 
     if (this->m_RegressionFlag)
@@ -137,14 +136,8 @@ namespace Wrapper
     libSVMClassifier->SetTargetListSample(trainingLabeledListSample);
     //SVM Option
     //TODO : Add other options ?
-    if (IsParameterEnabled("classifier.libsvm.opt"))
-      {
-      libSVMClassifier->SetParameterOptimization(true);
-      }
-    if (IsParameterEnabled("classifier.libsvm.prob"))
-      {
-      libSVMClassifier->SetDoProbabilityEstimates(true);
-      }
+    libSVMClassifier->SetParameterOptimization(GetParameterInt("classifier.libsvm.opt"));
+    libSVMClassifier->SetDoProbabilityEstimates(GetParameterInt("classifier.libsvm.prob"));
     libSVMClassifier->SetNu(GetParameterFloat("classifier.libsvm.nu"));
     libSVMClassifier->SetC(GetParameterFloat("classifier.libsvm.c"));
 
diff --git a/Modules/Applications/AppClassification/include/otbTrainSVM.txx b/Modules/Applications/AppClassification/include/otbTrainSVM.txx
index ac9524faa2..8a748e4997 100644
--- a/Modules/Applications/AppClassification/include/otbTrainSVM.txx
+++ b/Modules/Applications/AppClassification/include/otbTrainSVM.txx
@@ -112,9 +112,8 @@ namespace Wrapper
     SetParameterFloat("classifier.svm.degree",1.0, false);
     SetParameterDescription("classifier.svm.degree", 
       "Parameter degree of a kernel function (POLY).");
-    AddParameter(ParameterType_Empty, "classifier.svm.opt", 
+    AddParameter(ParameterType_Bool, "classifier.svm.opt", 
       "Parameters optimization");
-    MandatoryOff("classifier.svm.opt");
     SetParameterDescription("classifier.svm.opt", "SVM parameters optimization flag.\n"
       "-If set to True, then the optimal SVM parameters will be estimated. "
       "Parameters are considered optimal by OpenCV when the cross-validation estimate of "
@@ -229,10 +228,7 @@ namespace Wrapper
     SVMClassifier->SetCoef0(GetParameterFloat("classifier.svm.coef0"));
     SVMClassifier->SetGamma(GetParameterFloat("classifier.svm.gamma"));
     SVMClassifier->SetDegree(GetParameterFloat("classifier.svm.degree"));
-    if (IsParameterEnabled("classifier.svm.opt"))
-    {
-      SVMClassifier->SetParameterOptimization(true);
-    }
+    SVMClassifier->SetParameterOptimization(GetParameterInt("classifier.svm.opt"));
     SVMClassifier->Train();
     SVMClassifier->Save(modelPath);
 
diff --git a/Modules/Applications/AppClassification/include/otbTrainVectorBase.txx b/Modules/Applications/AppClassification/include/otbTrainVectorBase.txx
index 2c3575c2ea..453db3f3f0 100644
--- a/Modules/Applications/AppClassification/include/otbTrainVectorBase.txx
+++ b/Modules/Applications/AppClassification/include/otbTrainVectorBase.txx
@@ -91,10 +91,9 @@ void TrainVectorBase::DoInit()
     "The contingency table is output when we unsupervised algorithms is used otherwise the confusion matrix is output." );
   MandatoryOff( "io.confmatout" );
 
-  AddParameter(ParameterType_Empty, "v", "Verbose mode");
-  EnableParameter("v");
+  AddParameter(ParameterType_Bool, "v", "Verbose mode");
   SetParameterDescription("v", "Verbose mode, display the contingency table result.");
-  MandatoryOff("v");
+  SetParameterInt("v", 1);
 
   // Doc example parameter settings
   SetDocExampleParameterValue( "io.vd", "vectorData.shp" );
diff --git a/Modules/Applications/AppDescriptors/app/otbHomologousPointsExtraction.cxx b/Modules/Applications/AppDescriptors/app/otbHomologousPointsExtraction.cxx
index 073e53727f..04cf50df4d 100644
--- a/Modules/Applications/AppDescriptors/app/otbHomologousPointsExtraction.cxx
+++ b/Modules/Applications/AppDescriptors/app/otbHomologousPointsExtraction.cxx
@@ -135,10 +135,8 @@ private:
     SetMinimumParameterFloatValue("threshold",0.0);
     SetDefaultParameterFloat("threshold",0.6);
 
-    AddParameter(ParameterType_Empty,"backmatching","Use back-matching to filter matches.");
+    AddParameter(ParameterType_Bool,"backmatching","Use back-matching to filter matches.");
     SetParameterDescription("backmatching","If set to true, matches should be consistent in both ways.");
-    MandatoryOff("backmatching");
-    DisableParameter("backmatching");
 
     AddParameter(ParameterType_Choice,"mode","Keypoints search mode");
 
@@ -177,10 +175,10 @@ private:
     SetParameterDescription("precision","Estimated precision of the colocalisation function in pixels");
     SetDefaultParameterFloat("precision",0.);
 
-    AddParameter(ParameterType_Empty,"mfilter","Filter points according to geographical or sensor based colocalisation");
+    AddParameter(ParameterType_Bool,"mfilter","Filter points according to geographical or sensor based colocalisation");
     SetParameterDescription("mfilter","If enabled, this option allows one to filter matches according to colocalisation from sensor or geographical information, using the given tolerancy expressed in pixels");
 
-    AddParameter(ParameterType_Empty,"2wgs84","If enabled, points from second image will be exported in WGS84");
+    AddParameter(ParameterType_Bool,"2wgs84","If enabled, points from second image will be exported in WGS84");
 
     // Elevation
     ElevationParametersHandler::AddElevationParameters(this, "elev");
@@ -251,7 +249,7 @@ private:
       matchingFilter->SetInput1(surf1->GetOutput());
       matchingFilter->SetInput2(surf2->GetOutput());
       matchingFilter->SetDistanceThreshold(GetParameterFloat("threshold"));
-      matchingFilter->SetUseBackMatching(IsParameterEnabled("backmatching"));
+      matchingFilter->SetUseBackMatching(GetParameterInt("backmatching"));
       }
 
     try
@@ -276,7 +274,7 @@ private:
 
         bool filtered = false;
 
-        if(IsParameterEnabled("mfilter"))
+        if(GetParameterInt("mfilter"))
           {
           pprime1 = rsTransform->TransformPoint(point1);
           error = vcl_sqrt((point2[0]-pprime1[0])*(point2[0]-pprime1[0])+(point2[1]-pprime1[1])*(point2[1]-pprime1[1]));
@@ -289,7 +287,7 @@ private:
 
         if(!filtered)
           {
-          if(IsParameterEnabled("2wgs84"))
+          if(GetParameterInt("2wgs84"))
             {
             pprime2 = rsTransform2ToWGS84->TransformPoint(point2);
 
diff --git a/Modules/Applications/AppDimensionalityReduction/app/otbDimensionalityReduction.cxx b/Modules/Applications/AppDimensionalityReduction/app/otbDimensionalityReduction.cxx
index 686b78bb4c..1bf27acc11 100644
--- a/Modules/Applications/AppDimensionalityReduction/app/otbDimensionalityReduction.cxx
+++ b/Modules/Applications/AppDimensionalityReduction/app/otbDimensionalityReduction.cxx
@@ -164,9 +164,8 @@ private:
     MandatoryOff("nbcomp");
     SetMinimumParameterIntValue("nbcomp", 0);
 
-    AddParameter(ParameterType_Empty, "normalize", "Normalize.");
+    AddParameter(ParameterType_Bool, "normalize", "Normalize.");
     SetParameterDescription("normalize", "center AND reduce data before Dimensionality reduction.");
-    MandatoryOff("normalize");
 
     AddParameter(ParameterType_OutputFilename, "outmatrix", "Transformation matrix output (text format)");
     SetParameterDescription("outmatrix", "Filename to store the transformation matrix (csv format)");
@@ -237,7 +236,7 @@ private:
 
     // Get Parameters
     int nbComp = GetParameterInt("nbcomp");
-    bool normalize = IsParameterEnabled("normalize");
+    bool normalize = GetParameterInt("normalize");
     bool rescale = IsParameterEnabled("rescale");
 
     bool invTransform = HasValue("outinv") && IsParameterEnabled("outinv");
diff --git a/Modules/Applications/AppDomainTransform/app/otbDomainTransform.cxx b/Modules/Applications/AppDomainTransform/app/otbDomainTransform.cxx
index 54dbe894f6..dbe4c4bce0 100644
--- a/Modules/Applications/AppDomainTransform/app/otbDomainTransform.cxx
+++ b/Modules/Applications/AppDomainTransform/app/otbDomainTransform.cxx
@@ -134,7 +134,7 @@ private:
     AddChoice("mode.fft", "FFT transform");
     SetParameterDescription("mode.fft", "FFT transform");
 
-    AddParameter(ParameterType_Empty, "mode.fft.shift", "Shift fft transform");
+    AddParameter(ParameterType_Bool, "mode.fft.shift", "Shift fft transform");
     SetParameterDescription("mode.fft.shift", "Shift transform of fft filter");
 
     AddChoice("mode.wavelet", "Wavelet");
@@ -263,7 +263,7 @@ private:
     else
       {
       // fft ttransform
-      bool shift = IsParameterEnabled( "mode.fft.shift");
+      bool shift = GetParameterInt( "mode.fft.shift");
       typedef otb::Image< std::complex<OutputPixelType> >          ComplexOutputImageType;
 
       if (dir == 0 )
diff --git a/Modules/Applications/AppEdge/app/otbLineSegmentDetection.cxx b/Modules/Applications/AppEdge/app/otbLineSegmentDetection.cxx
index 45bc66c51d..588e8e1ff6 100644
--- a/Modules/Applications/AppEdge/app/otbLineSegmentDetection.cxx
+++ b/Modules/Applications/AppEdge/app/otbLineSegmentDetection.cxx
@@ -85,11 +85,10 @@ private:
     // Elevation
     ElevationParametersHandler::AddElevationParameters(this, "elev");
 
-    AddParameter(ParameterType_Empty, "norescale", "No rescaling in [0, 255]");
+    AddParameter(ParameterType_Bool, "norescale", "No rescaling in [0, 255]");
     SetParameterDescription("norescale",
       "By default, the input image amplitude is rescaled between [0,255]."
       " Turn on this parameter to skip rescaling");
-    MandatoryOff("norescale");
 
     AddRAMParameter();
 
@@ -132,7 +131,7 @@ private:
       = ShiftScaleImageFilterType::New();
 
     // Default behavior is to do the rescaling
-    if ( !IsParameterEnabled("norescale") )
+    if ( !GetParameterInt("norescale") )
       {
       stats->SetInput(amplitudeConverter->GetOutput());
       stats->GetStreamer()->SetAutomaticAdaptativeStreaming(GetParameterInt("ram"));
diff --git a/Modules/Applications/AppFiltering/app/otbContrastEnhancement.cxx b/Modules/Applications/AppFiltering/app/otbContrastEnhancement.cxx
index 3c55bf6efa..0ec0c56286 100644
--- a/Modules/Applications/AppFiltering/app/otbContrastEnhancement.cxx
+++ b/Modules/Applications/AppFiltering/app/otbContrastEnhancement.cxx
@@ -229,7 +229,7 @@ private:
     SetParameterDescription("minmax.auto" , "Minimum and maximum value will "
       "be computed on the image (nodata value won't be taken "
       "into account) . Each band will have a minimum and a maximum.");
-    AddParameter(ParameterType_Empty, "minmax.auto.global", "Global");
+    AddParameter(ParameterType_Bool, "minmax.auto.global", "Global");
     SetParameterDescription("minmax.auto.global" , "Automatic"
       "Min/max computation will result in the same minimum and maximum for "
       "all the bands.");
@@ -488,7 +488,7 @@ private:
     if ( m_MinMaxMode == "auto" )
       {
       oss << "automatic";
-      if ( IsParameterEnabled( "minmax.auto.global" ) )
+      if ( GetParameterInt( "minmax.auto.global" ) )
         { 
         oss << " and global";
         }
@@ -584,7 +584,7 @@ private:
       statFilter->Update();
       min = statFilter->GetMinimum();
       max = statFilter->GetMaximum();
-      if ( IsParameterEnabled("minmax.auto.global") )
+      if ( GetParameterInt("minmax.auto.global") )
         {
         float temp(min[0]);
         for ( unsigned int i = 1 ; i < min.GetSize() ; i++ )
@@ -602,7 +602,7 @@ private:
       }
     std::ostringstream oss;
     oss<<"Minimum and maximum are for each channel : ";
-    if ( IsParameterEnabled("minmax.auto.global") || 
+    if ( GetParameterInt("minmax.auto.global") || 
           m_MinMaxMode == "manuel" )
       {
       oss<<std::endl<<min[0]<<" and "<<max[0];
diff --git a/Modules/Applications/AppImageUtils/app/otbManageNoData.cxx b/Modules/Applications/AppImageUtils/app/otbManageNoData.cxx
index 439ba05590..744d8f049e 100644
--- a/Modules/Applications/AppImageUtils/app/otbManageNoData.cxx
+++ b/Modules/Applications/AppImageUtils/app/otbManageNoData.cxx
@@ -79,10 +79,8 @@ private:
     AddParameter(ParameterType_OutputImage, "out",  "Output Image");
     SetParameterDescription("out", "Output image");
 
-    AddParameter(ParameterType_Empty,"usenan", "Consider NaN as no-data");
+    AddParameter(ParameterType_Bool,"usenan", "Consider NaN as no-data");
     SetParameterDescription("usenan","If active, the application will consider NaN as no-data values as well");
-    MandatoryOff("usenan");
-    DisableParameter("usenan");
    
     AddParameter(ParameterType_Choice,"mode","No-data handling mode");
     SetParameterDescription("mode","Allows choosing between different no-data handling options");
@@ -138,12 +136,12 @@ private:
     m_Filter = FilterType::New();
     m_Filter->SetInsideValue(this->GetParameterFloat("mode.buildmask.inv"));
     m_Filter->SetOutsideValue(this->GetParameterFloat("mode.buildmask.outv"));
-    m_Filter->SetNaNIsNoData(IsParameterEnabled("usenan"));
+    m_Filter->SetNaNIsNoData(GetParameterInt("usenan"));
     m_Filter->SetInput(inputPtr);
 
     m_ChangeNoDataFilter = ChangeNoDataFilterType::New();
     m_ChangeNoDataFilter->SetInput(inputPtr);
-    m_ChangeNoDataFilter->SetNaNIsNoData(IsParameterEnabled("usenan"));
+    m_ChangeNoDataFilter->SetNaNIsNoData(GetParameterInt("usenan"));
 
     std::vector<double> newNoData(inputPtr->GetNumberOfComponentsPerPixel(),GetParameterFloat("mode.changevalue.newv"));
 
diff --git a/Modules/Applications/AppImageUtils/app/otbMultiResolutionPyramid.cxx b/Modules/Applications/AppImageUtils/app/otbMultiResolutionPyramid.cxx
index d94f67b260..8117e4c165 100644
--- a/Modules/Applications/AppImageUtils/app/otbMultiResolutionPyramid.cxx
+++ b/Modules/Applications/AppImageUtils/app/otbMultiResolutionPyramid.cxx
@@ -96,12 +96,11 @@ private:
     SetParameterDescription( "vfactor", "Variance factor use in smoothing. It is multiplied by the subsampling factor of each level in the  pyramid (default is 0.6).");
 
     // Boolean Fast scheme
-    AddParameter(ParameterType_Empty, "fast", "Use Fast Scheme");
+    AddParameter(ParameterType_Bool, "fast", "Use Fast Scheme");
     std::ostringstream desc;
     desc<<"If used, this option allows one to speed-up computation by iteratively"
         <<" subsampling previous level of pyramid instead of processing the full input.";
     SetParameterDescription("fast", desc.str());
-    MandatoryOff("fast");
 
     // Doc example parameter settings
     SetDocExampleParameterValue("in", "QB_Toulouse_Ortho_XS.tif");
@@ -132,7 +131,7 @@ private:
     unsigned int shrinkFactor = GetParameterInt("sfactor");
     double varianceFactor     = GetParameterFloat("vfactor");
 
-    bool fastScheme = IsParameterEnabled("fast");
+    bool fastScheme = GetParameterInt("fast");
 
     // Get the input image
     FloatVectorImageType::Pointer inImage = GetParameterImage("in");
diff --git a/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx b/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx
index 87e7dc310f..7b7e5ef1e2 100644
--- a/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx
+++ b/Modules/Applications/AppOpticalCalibration/app/otbOpticalCalibration.cxx
@@ -199,16 +199,13 @@ private:
     AddChoice("level.toc",     "Image to Top Of Canopy reflectance (atmospheric corrections)");
     SetParameterString("level", "toa", false);
 
-    AddParameter(ParameterType_Empty, "milli", "Convert to milli reflectance");
+    AddParameter(ParameterType_Bool, "milli", "Convert to milli reflectance");
     SetParameterDescription("milli", "Flag to use milli-reflectance instead of reflectance.\n"
                             "This allows saving the image with integer pixel type (in the range [0, 1000]  instead of floating point in the range [0, 1]. In order to do that, use this option and set the output pixel type (-out filename double for example)");
-    DisableParameter("milli");
-    MandatoryOff("milli");
 
-    AddParameter(ParameterType_Empty, "clamp", "Clamp of reflectivity values between [0, 1]");
+    AddParameter(ParameterType_Bool, "clamp", "Clamp of reflectivity values between [0, 1]");
     SetParameterDescription("clamp", "Clamping in the range [0, 1]. It can be useful to preserve area with specular reflectance.");
-    EnableParameter("clamp");
-    MandatoryOff("clamp");
+    SetParameterInt("clamp",1);
 
     //Acquisition parameters
     AddParameter(ParameterType_Group,"acqui","Acquisition parameters");
@@ -751,12 +748,12 @@ private:
         m_ImageToRadianceFilter->SetInput(inImage);
         m_RadianceToReflectanceFilter->SetInput(m_ImageToRadianceFilter->GetOutput());
 
-        if (IsParameterEnabled("clamp"))
+        if (GetParameterInt("clamp"))
           {
           GetLogger()->Info("Clamp values between [0, 100]\n");
           }
 
-        m_RadianceToReflectanceFilter->SetUseClamp(IsParameterEnabled("clamp"));
+        m_RadianceToReflectanceFilter->SetUseClamp(GetParameterInt("clamp"));
         m_RadianceToReflectanceFilter->UpdateOutputInformation();
         m_ScaleFilter->SetInput(m_RadianceToReflectanceFilter->GetOutput());
       }
@@ -894,7 +891,7 @@ private:
         }
 
         //Rescale the surface reflectance in milli-reflectance
-        if (!IsParameterEnabled("clamp"))
+        if (!GetParameterInt("clamp"))
         {
           if (!adjComputation)
             m_ScaleFilter->SetInput(m_ReflectanceToSurfaceReflectanceFilter->GetOutput());
@@ -920,7 +917,7 @@ private:
     // Output Image
     double scale = 1.;
 
-    if (IsParameterEnabled("milli"))
+    if (GetParameterInt("milli"))
     {
     GetLogger()->Info("Use milli-reflectance\n");
       if ( (GetParameterInt("level") == Level_IM_TOA) || (GetParameterInt("level") == Level_TOC) )
diff --git a/Modules/Applications/AppProjection/app/otbOrthoRectification.cxx b/Modules/Applications/AppProjection/app/otbOrthoRectification.cxx
index 3c91403e47..0ebf9ba058 100644
--- a/Modules/Applications/AppProjection/app/otbOrthoRectification.cxx
+++ b/Modules/Applications/AppProjection/app/otbOrthoRectification.cxx
@@ -177,13 +177,13 @@ private:
     MandatoryOff("outputs.lry");
     MandatoryOff("outputs.ortho");
 
-    AddParameter(ParameterType_Empty,"outputs.isotropic","Force isotropic spacing by default");
+    AddParameter(ParameterType_Bool,"outputs.isotropic","Force isotropic spacing by default");
     std::ostringstream isotropOss;
     isotropOss << "Default spacing (pixel size) values are estimated from the sensor modeling of the image. It can therefore result in a non-isotropic spacing. ";
     isotropOss << "This option allows you to force default values to be isotropic (in this case, the minimum of spacing in both direction is applied. ";
     isotropOss << "Values overridden by user are not affected by this option.";
     SetParameterDescription("outputs.isotropic", isotropOss.str());
-    EnableParameter("outputs.isotropic");
+    SetParameterInt("outputs.isotropic", 1);
 
     AddParameter(ParameterType_Float, "outputs.default", "Default pixel value");
     SetParameterDescription("outputs.default","Default value to write when outside of input image.");
@@ -259,7 +259,7 @@ private:
       typedef otb::ImageToGenericRSOutputParameters<FloatVectorImageType> OutputParametersEstimatorType;
       OutputParametersEstimatorType::Pointer genericRSEstimator = OutputParametersEstimatorType::New();
 
-      if(IsParameterEnabled("outputs.isotropic"))
+      if(GetParameterInt("outputs.isotropic"))
         {
         genericRSEstimator->EstimateIsotropicSpacingOn();
         }
diff --git a/Modules/Applications/AppSARCalibration/app/otbSARCalibration.cxx b/Modules/Applications/AppSARCalibration/app/otbSARCalibration.cxx
index 4a91dda2f5..07f4e0dadc 100644
--- a/Modules/Applications/AppSARCalibration/app/otbSARCalibration.cxx
+++ b/Modules/Applications/AppSARCalibration/app/otbSARCalibration.cxx
@@ -68,9 +68,8 @@ private:
 
     AddRAMParameter();
 
-    AddParameter(ParameterType_Empty, "noise", "Disable Noise");
+    AddParameter(ParameterType_Bool, "noise", "Disable Noise");
     SetParameterDescription("noise", "Flag to disable noise. For 5.2.0 release, the noise values are only read by TerraSARX product.");
-    MandatoryOff("noise");
 
     AddParameter(ParameterType_Choice, "lut", "Lookup table sigma /gamma/ beta/ DN.");
     SetParameterDescription("lut", "Lookup table values are not available with all SAR products. Products that provide lookup table with metadata are: Sentinel1, Radarsat2.");
@@ -104,17 +103,8 @@ private:
     // Set the filer input
     m_CalibrationFilter = CalibrationFilterType::New();
     m_CalibrationFilter->SetInput(floatComplexImage);
-
-    if (IsParameterEnabled("noise"))
-      {
-      m_CalibrationFilter->SetEnableNoise(false);
-      }
-
-    short lut = 0;
-
-    lut = GetParameterInt("lut");
-
-    m_CalibrationFilter->SetLookupSelected(lut);
+    m_CalibrationFilter->SetEnableNoise( !bool(GetParameterInt("noise")) );
+    m_CalibrationFilter->SetLookupSelected(GetParameterInt("lut"));
 
     // Set the output image
     SetParameterOutputImage("out", m_CalibrationFilter->GetOutput());
diff --git a/Modules/Applications/AppSegmentation/app/otbLSMSSegmentation.cxx b/Modules/Applications/AppSegmentation/app/otbLSMSSegmentation.cxx
index 93694cc420..280faee001 100644
--- a/Modules/Applications/AppSegmentation/app/otbLSMSSegmentation.cxx
+++ b/Modules/Applications/AppSegmentation/app/otbLSMSSegmentation.cxx
@@ -139,7 +139,7 @@ private:
   void RemoveFile(std::string tile)
   {
     // Cleanup
-    if(IsParameterEnabled("cleanup"))
+    if(GetParameterInt("cleanup"))
       {
         // Try to remove the geom file if existing
       std::string geomfile = tile.substr(0,tile.size() - itksys::SystemTools::GetFilenameExtension(tile.c_str()).size()).append(".geom");
@@ -302,10 +302,9 @@ private:
     MandatoryOff("tmpdir");
     DisableParameter("tmpdir");
 
-    AddParameter(ParameterType_Empty,"cleanup","Temporary files cleaning");
-    EnableParameter("cleanup");
+    AddParameter(ParameterType_Bool,"cleanup","Temporary files cleaning");
     SetParameterDescription("cleanup","If activated, the application will try to remove all temporary files it created.");
-    MandatoryOff("cleanup");
+    SetParameterInt("cleanup",1);
 
     // Doc example parameter settings
     SetDocExampleParameterValue("in","smooth.tif");
@@ -724,7 +723,7 @@ private:
     // Release input files
     m_FinalReader = ITK_NULLPTR;
 
-    if(IsParameterEnabled("cleanup"))
+    if(GetParameterInt("cleanup"))
       {
       otbAppLogINFO(<<"Final clean-up ...");
 
diff --git a/Modules/Applications/AppSegmentation/app/otbLargeScaleMeanShift.cxx b/Modules/Applications/AppSegmentation/app/otbLargeScaleMeanShift.cxx
index 27f8da8377..05ca673b64 100644
--- a/Modules/Applications/AppSegmentation/app/otbLargeScaleMeanShift.cxx
+++ b/Modules/Applications/AppSegmentation/app/otbLargeScaleMeanShift.cxx
@@ -120,11 +120,10 @@ private:
       "The output raster image",
       "It corresponds to the output of the small region merging step.");
 
-    AddParameter( ParameterType_Empty, "cleanup", "Temporary files cleaning" );
-    EnableParameter( "cleanup" );
+    AddParameter( ParameterType_Bool, "cleanup", "Temporary files cleaning" );
     SetParameterDescription( "cleanup",
       "If activated, the application will try to clean all temporary files it created" );
-    MandatoryOff( "cleanup" );
+    SetParameterInt("cleanup",1);
 
     // Setup RAM
     ShareParameter("ram","smoothing.ram");
diff --git a/Modules/Applications/AppSegmentation/app/otbMeanShiftSmoothing.cxx b/Modules/Applications/AppSegmentation/app/otbMeanShiftSmoothing.cxx
index 8f63bf13ef..d8980392b0 100644
--- a/Modules/Applications/AppSegmentation/app/otbMeanShiftSmoothing.cxx
+++ b/Modules/Applications/AppSegmentation/app/otbMeanShiftSmoothing.cxx
@@ -159,10 +159,8 @@ private:
     SetMinimumParameterFloatValue("rangeramp", 0);
     MandatoryOff("rangeramp");
 
-    AddParameter(ParameterType_Empty, "modesearch", "Mode search.");
+    AddParameter(ParameterType_Bool, "modesearch", "Mode search.");
     SetParameterDescription("modesearch", "If activated pixel iterative convergence is stopped if the path crosses an already converged pixel. Be careful, with this option, the result will slightly depend on thread number and the results will not be stable (see [4] for more details).");
-    DisableParameter("modesearch");
-
 
     // Doc example parameter settings
     SetDocExampleParameterValue("in", "maur_rgb.png");
@@ -192,7 +190,7 @@ private:
     m_Filter->SetThreshold(GetParameterFloat("thres"));
     m_Filter->SetMaxIterationNumber(GetParameterInt("maxiter"));
     m_Filter->SetRangeBandwidthRamp(GetParameterFloat("rangeramp"));
-    m_Filter->SetModeSearch(IsParameterEnabled("modesearch"));
+    m_Filter->SetModeSearch(GetParameterInt("modesearch"));
 
     //Compute the margin used to ensure exact results (tile wise smoothing)
     //This margin is valid for the default uniform kernel used by the
@@ -211,7 +209,7 @@ private:
       {
       SetParameterOutputImage("foutpos", m_Filter->GetSpatialOutput());
       }
-    if(!IsParameterEnabled("modesearch"))
+    if(!GetParameterInt("modesearch"))
       {
       otbAppLogINFO(<<"Mode Search is disabled." << std::endl);
       }
diff --git a/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx b/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx
index 5b3bfd2361..cbb1c0b959 100644
--- a/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx
+++ b/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx
@@ -282,17 +282,13 @@ private:
     SetParameterDescription("mode.vector.inmask", "Only pixels whose mask value is strictly positive will be segmented.");
     MandatoryOff("mode.vector.inmask");
 
-    AddParameter(ParameterType_Empty, "mode.vector.neighbor", "8-neighbor connectivity");
+    AddParameter(ParameterType_Bool, "mode.vector.neighbor", "8-neighbor connectivity");
     SetParameterDescription("mode.vector.neighbor",
                             "Activate 8-Neighborhood connectivity (default is 4).");
-    MandatoryOff("mode.vector.neighbor");
-    DisableParameter("mode.vector.neighbor");
 
-
-    AddParameter(ParameterType_Empty,"mode.vector.stitch","Stitch polygons");
+    AddParameter(ParameterType_Bool,"mode.vector.stitch","Stitch polygons");
     SetParameterDescription("mode.vector.stitch", "Scan polygons on each side of tiles and stitch polygons which connect by more than one pixel.");
-    MandatoryOff("mode.vector.stitch");
-    EnableParameter("mode.vector.stitch");
+    SetParameterInt("mode.vector.stitch",1);
 
     AddParameter(ParameterType_Int, "mode.vector.minsize", "Minimum object size");
     SetParameterDescription("mode.vector.minsize",
@@ -365,7 +361,7 @@ private:
     // Retrieve tile size parameter
     const unsigned int tileSize = static_cast<unsigned int> (this->GetParameterInt("mode.vector.tilesize"));
     // Retrieve the 8-connected option
-    bool use8connected = IsParameterEnabled("mode.vector.neighbor");
+    bool use8connected = GetParameterInt("mode.vector.neighbor");
     // Retrieve min object size parameter
     const unsigned int minSize = static_cast<unsigned int> (this->GetParameterInt("mode.vector.minsize"));
 
@@ -673,7 +669,7 @@ private:
       ogrDS->SyncToDisk();
 
       // Stitching mode
-      if (IsParameterEnabled("mode.vector.stitch"))
+      if (GetParameterInt("mode.vector.stitch"))
         {
         otbAppLogINFO(<<"Segmentation done, stiching polygons ...");
 
diff --git a/Modules/Applications/AppStereo/app/otbBlockMatching.cxx b/Modules/Applications/AppStereo/app/otbBlockMatching.cxx
index 2ec8f7e63a..41c9257ac0 100644
--- a/Modules/Applications/AppStereo/app/otbBlockMatching.cxx
+++ b/Modules/Applications/AppStereo/app/otbBlockMatching.cxx
@@ -202,7 +202,7 @@ private:
     DisableParameter("io.outmask");
     MandatoryOff("io.outmask");
 
-    AddParameter(ParameterType_Empty,"io.outmetric","Flag to output optimal "
+    AddParameter(ParameterType_Bool,"io.outmetric","Flag to output optimal "
       "metric values as well");
     SetParameterDescription("io.outmetric","If enabled, the output image will "
       "have a third component with metric optimal values");
@@ -847,7 +847,7 @@ private:
     m_OutputImageList->PushBack(hdispImage);
     m_OutputImageList->PushBack(vdispImage);
 
-    if(IsParameterEnabled("io.outmetric"))
+    if(GetParameterInt("io.outmetric"))
       {
       m_OutputImageList->PushBack(metricImage);
       }
diff --git a/Modules/Applications/AppStereo/app/otbStereoFramework.cxx b/Modules/Applications/AppStereo/app/otbStereoFramework.cxx
index 279c09ad2f..ee462306f8 100644
--- a/Modules/Applications/AppStereo/app/otbStereoFramework.cxx
+++ b/Modules/Applications/AppStereo/app/otbStereoFramework.cxx
@@ -525,20 +525,16 @@ private:
     AddParameter(ParameterType_Group,"postproc","Postprocessing parameters");
     SetParameterDescription("postproc","This group of parameters allow use optional filters.");
 
-    AddParameter(ParameterType_Empty,"postproc.bij","Use bijection consistency"
+    AddParameter(ParameterType_Bool,"postproc.bij","Use bijection consistency"
       " in block matching strategy");
     SetParameterDescription("postproc.bij","Use bijection consistency. "
       "Right to Left correlation is computed to validate Left to Right "
       "disparities. If bijection is not found, the disparity is rejected.");
-    MandatoryOff("postproc.bij");
-    EnableParameter("postproc.bij");
+    SetParameterInt("postproc.bij", 1);
 
-    AddParameter(ParameterType_Empty,"postproc.med","Use median disparities filtering");
+    AddParameter(ParameterType_Bool,"postproc.med","Use median disparities filtering");
     SetParameterDescription("postproc.med","Disparity map can be filtered using"
       " median post filtering (disabled by default).");
-    MandatoryOff("postproc.med");
-    DisableParameter("postproc.med");
-
 
     AddParameter(ParameterType_Float,"postproc.metrict","Correlation metric threshold");
     SetParameterDescription("postproc.metrict","Use block matching metric "
@@ -624,7 +620,7 @@ private:
       }
     else blockMatcherFilter->MinimizeOff();
 
-    if (IsParameterEnabled("postproc.bij"))
+    if (GetParameterInt("postproc.bij"))
       {
       invBlockMatcherFilter->SetLeftInput(rightImage);
       invBlockMatcherFilter->SetRightInput(leftImage);
@@ -947,7 +943,7 @@ private:
       m_Filters.push_back(lBandMathFilter.GetPointer());
 
       BandMathFilterType::Pointer finalMaskFilter;
-      if (IsParameterEnabled("postproc.bij"))
+      if (GetParameterInt("postproc.bij"))
         {
         finalMaskFilter = BandMathFilterType::New();
         finalMaskFilter->SetNthInput(0, lBandMathFilter->GetOutput(), "inmask");
@@ -992,7 +988,7 @@ private:
           blockMatcherFilterPointer = SSDDivMeanBlockMatcherFilter.GetPointer();
           m_Filters.push_back(blockMatcherFilterPointer);
 
-          if (IsParameterEnabled("postproc.bij"))
+          if (GetParameterInt("postproc.bij"))
             {
             //Reverse correlation
             invSSDDivMeanBlockMatcherFilter = SSDDivMeanBlockMatchingFilterType::New();
@@ -1025,7 +1021,7 @@ private:
           blockMatcherFilterPointer = SSDBlockMatcherFilter.GetPointer();
           m_Filters.push_back(blockMatcherFilterPointer);
 
-          if (IsParameterEnabled("postproc.bij"))
+          if (GetParameterInt("postproc.bij"))
             {
             //Reverse correlation
             invSSDBlockMatcherFilter = SSDBlockMatchingFilterType::New();
@@ -1056,7 +1052,7 @@ private:
           blockMatcherFilterPointer = NCCBlockMatcherFilter.GetPointer();
           m_Filters.push_back(blockMatcherFilterPointer);
 
-          if (IsParameterEnabled("postproc.bij"))
+          if (GetParameterInt("postproc.bij"))
             {
             //Reverse correlation
             invNCCBlockMatcherFilter = NCCBlockMatchingFilterType::New();
@@ -1090,7 +1086,7 @@ private:
           blockMatcherFilterPointer = LPBlockMatcherFilter.GetPointer();
           m_Filters.push_back(blockMatcherFilterPointer);
 
-          if (IsParameterEnabled("postproc.bij"))
+          if (GetParameterInt("postproc.bij"))
             {
             //Reverse correlation
             invLPBlockMatcherFilter = LPBlockMatchingFilterType::New();
@@ -1119,7 +1115,7 @@ private:
           break;
         }
 
-       if (IsParameterEnabled("postproc.bij"))
+       if (GetParameterInt("postproc.bij"))
         {
         otbAppLogINFO(<<"Using reverse block-matching to filter incoherent disparity values.");
         bijectFilter = BijectionFilterType::New();
@@ -1149,7 +1145,7 @@ private:
 
      FloatImageType::Pointer hDispOutput = subPixelFilterPointer->GetOutput(0);
       FloatImageType::Pointer finalMaskImage=finalMaskFilter->GetOutput();
-      if (IsParameterEnabled("postproc.med"))
+      if (GetParameterInt("postproc.med"))
         {
         MedianFilterType::Pointer hMedianFilter = MedianFilterType::New();
         hMedianFilter->SetInput(subPixelFilterPointer->GetOutput(0));
@@ -1183,7 +1179,7 @@ private:
       FloatImageType::Pointer hDispOutput2 = disparityTranslateFilter->GetHorizontalDisparityMapOutput();
       FloatImageType::Pointer vDispOutput2 = disparityTranslateFilter->GetVerticalDisparityMapOutput();
       FloatImageType::Pointer translatedMaskImage =  dispTranslateMaskFilter->GetOutput();
-      if (IsParameterEnabled("postproc.med"))
+      if (GetParameterInt("postproc.med"))
         {
         MedianFilterType::Pointer hMedianFilter2 = MedianFilterType::New();
         MedianFilterType::Pointer vMedianFilter2 = MedianFilterType::New();
diff --git a/Modules/Applications/AppTest/app/otbTestApplication.cxx b/Modules/Applications/AppTest/app/otbTestApplication.cxx
index a2e9ee940d..4407d76ed3 100644
--- a/Modules/Applications/AppTest/app/otbTestApplication.cxx
+++ b/Modules/Applications/AppTest/app/otbTestApplication.cxx
@@ -56,7 +56,8 @@ private:
     AddDocTag("Test");
 
     //std::cout << "TestApplication::DoInit" << std::endl;
-    AddParameter(ParameterType_Empty, "boolean", "Boolean");
+    AddParameter(ParameterType_Empty, "empty", "Boolean (old impl.)");
+    AddParameter(ParameterType_Bool, "boolean", "Boolean");
     AddParameter(ParameterType_Int, "int", "Integer");
     MandatoryOff("int");
     AddParameter(ParameterType_Float, "float", "Float");
diff --git a/Modules/Applications/AppVectorUtils/app/otbOSMDownloader.cxx b/Modules/Applications/AppVectorUtils/app/otbOSMDownloader.cxx
index d55626ed0b..ba625b5f48 100644
--- a/Modules/Applications/AppVectorUtils/app/otbOSMDownloader.cxx
+++ b/Modules/Applications/AppVectorUtils/app/otbOSMDownloader.cxx
@@ -98,11 +98,10 @@ private:
     // Elevation
     ElevationParametersHandler::AddElevationParameters(this, "elev");
 
-    AddParameter(ParameterType_Empty, "printclasses", "Displays available key/value classes");
+    AddParameter(ParameterType_Bool, "printclasses", "Displays available key/value classes");
     SetParameterDescription("printclasses","Print the key/value classes "
       "available for the selected support image. If enabled, the OSM tag Key "
       "(-key) and the output (-out) become optional" );
-    MandatoryOff("printclasses");
 
     // Doc example parameter settings
     SetDocExampleParameterValue("support", "qb_RoadExtract.tif");
@@ -118,15 +117,15 @@ private:
     // CASE:  when the -print option is not required and the User
     // does not set the option OSMKey or the option Output or does not
     // set both of them
-    if ( !this->HasValue("printclasses") )
+    if ( GetParameterInt("printclasses") )
       {
-      MandatoryOn("out");
-      MandatoryOn("key");
+      MandatoryOff("out");
+      MandatoryOff("key");
       }
     else
       {
-      MandatoryOff("out");
-      MandatoryOff("key");
+      MandatoryOn("out");
+      MandatoryOn("key");
       }
   }
 
@@ -178,7 +177,7 @@ private:
 
   // If the user wants to print the Key/Values present in the XML file
   // downloaded  :
-  if ( this->HasValue("printclasses"))
+  if ( GetParameterInt("printclasses"))
     {
     // Print the classes
     VectorDataProviderType::KeyMapType  keymap = m_VdOSMGenerator->GetKeysMap();
-- 
GitLab