Commit 5da24b09 authored by Otmane Lahlou's avatar Otmane Lahlou

ENH: use the method SetDefaultParameter{Int,Float} when setting default values

parent a067c357
......@@ -100,19 +100,19 @@ private:
SetParameterDescription("vm","Validity mask. Only non-zero pixels will be used to estimate KMeans modes.");
AddParameter(ParameterType_Int, "ts", "Training set size");
SetParameterDescription("ts", "Size of the training set.");
SetParameterInt("ts", 100);
SetDefaultParameterInt("ts", 100);
AddParameter(ParameterType_Float, "tp", "Training set sample selection probability");
SetParameterDescription("tp", "Probability for a sample to be selected in the training set.");
SetParameterFloat("tp", 0.5);
SetDefaultParameterFloat("tp", 0.5);
AddParameter(ParameterType_Int, "nc", "Number of classes");
SetParameterDescription("nc","number of modes, which will be used to generate class membership.");
SetParameterInt("nc", 3);
SetDefaultParameterInt("nc", 3);
AddParameter(ParameterType_Float, "cp", "Initial class centroid probability");
SetParameterDescription("cp", "Probability for a pixel to be selected as an initial class centroid");
SetParameterFloat("cp", 0.8);
SetDefaultParameterFloat("cp", 0.8);
AddParameter(ParameterType_Int, "sl", "Number of lines for each streaming block");
SetParameterDescription("sl","input image will be divided into sl lines.");
SetParameterInt("sl", 1000);
SetDefaultParameterInt("sl", 1000);
}
void DoUpdateParameters()
......
......@@ -183,11 +183,11 @@ private:
SetParameterDescription("k", "SVM Kernel Type.");
AddParameter(ParameterType_Int, "mt", "Maximum training sample size");
MandatoryOff("mt");
SetParameterInt("mt", -1);
SetDefaultParameterInt("mt", -1);
SetParameterDescription("mt", "Maximum size of the training sample (default = -1).");
AddParameter(ParameterType_Int, "mv", "Maximum validation sample size");
MandatoryOff("mv");
SetParameterInt("mv", -1);
SetDefaultParameterInt("mv", -1);
SetParameterDescription("mv", "Maximum size of the validation sample (default = -1)");
AddParameter(ParameterType_Float, "vtr", "training and validation sample ratio");
SetParameterDescription("vtr",
......
......@@ -131,7 +131,7 @@ private:
MandatoryOff("dr");
AddParameter(ParameterType_Int, "ne", "Number of endmembers");
SetParameterInt("ne", 1);
SetDefaultParameterInt("ne", 1);
MandatoryOff("ne");
AddParameter(ParameterType_Choice, "de", "Dimensionnality estimation");
......
......@@ -112,10 +112,10 @@ private:
SetParameterDescription("channels", "Channels selection");
AddParameter(ParameterType_Int, "channels.red", "Red Channel");
SetParameterDescription("channels.red", "Red channel index");
SetParameterInt("channels.red", 3);
SetDefaultParameterInt("channels.red", 3);
AddParameter(ParameterType_Int, "channels.nir", "NIR Channel");
SetParameterDescription("channels.nir", "NIR channel index");
SetParameterInt("channels.nir", 4);
SetDefaultParameterInt("channels.nir", 4);
AddParameter(ParameterType_Group, "index", "Indices selection");
SetParameterDescription("index", "List of available radiometric indices");
......
......@@ -131,11 +131,11 @@ private:
AddParameter(ParameterType_Float, "atmo", "Atmospheric Pressure");
AddParameter(ParameterType_Float, "opt", "Aerosol Optical");
SetParameterFloat("oz", 0.);
SetParameterFloat("wa", 2.5);
SetParameterFloat("atmo", 1030.);
SetDefaultParameterFloat("oz", 0.);
SetDefaultParameterFloat("wa", 2.5);
SetDefaultParameterFloat("atmo", 1030.);
SetParameterFloat("opt", 0.2);
SetDefaultParameterFloat("opt", 0.2);
MandatoryOff("oz");
MandatoryOff("wa");
MandatoryOff("atmo");
......
......@@ -80,10 +80,10 @@ private:
AddParameter(ParameterType_Float, "ranger", "Range radius");
AddParameter(ParameterType_Int, "minsize", "Min region size");
AddParameter(ParameterType_Float, "scale", "Scale");
SetParameterInt("spatialr", 5);
SetParameterFloat("ranger", 15.0);
SetParameterInt("minsize", 100);
SetParameterFloat("scale", 100000.);
SetDefaultParameterInt("spatialr", 5);
SetDefaultParameterFloat("ranger", 15.0);
SetDefaultParameterInt("minsize", 100);
SetDefaultParameterFloat("scale", 100000.);
}
void DoUpdateParameters()
......
......@@ -77,12 +77,12 @@ private:
AddChoice("choice.choice2", "Choice 2");
AddChoice("choice.choice3", "Choice 3");
AddParameter(ParameterType_Float, "choice.choice1.floatchoice1", "Float of choice1");
SetParameterFloat("choice.choice1.floatchoice1", 0.125);
SetDefaultParameterFloat("choice.choice1.floatchoice1", 0.125);
// Test a choice without associated parameter
// AddParameter(ParameterType_Float, "choice.choice2.floatchoice2", "Float of choice2");
// SetParameterFloat("choice.choice2.floatchoice2", 1.0);
AddParameter(ParameterType_Float, "choice.choice3.floatchoice3", "Float of choice3");
SetParameterFloat("choice.choice3.floatchoice3", 5.0);
SetDefaultParameterFloat("choice.choice3.floatchoice3", 5.0);
AddParameter(ParameterType_Group, "ingroup", "Input Group");
......
......@@ -81,11 +81,11 @@ private:
SetParameterDescription("sizex","size along x in pixels.");
AddParameter(ParameterType_Int, "sizey", "Size Y");
SetParameterDescription("sizey","size along y in pixels.");
// Default values
SetParameterInt("startx", 0);
SetParameterInt("starty", 0);
SetParameterInt("sizex", 0);
SetParameterInt("sizey", 0);
// // Default values
// SetDefaultParameterInt("startx", 0);
// SetDefaultParameterInt("starty", 0);
// SetDefaultParameterInt("sizex", 0);
// SetDefaultParameterInt("sizey", 0);
// Channelist Parameters
AddParameter(ParameterType_ListView, "cl", "Output Image channels");
......
......@@ -85,14 +85,14 @@ private:
SetParameterRole("out",Role_Output);
AddParameter(ParameterType_Int, "level", "Number Of Levels");
SetParameterInt("level", 1);
SetDefaultParameterInt("level", 1);
SetParameterDescription( "level", "Number of levels in the pyramid (default is 1).");
AddParameter(ParameterType_Int, "sfactor", "Subsampling factor");
SetParameterInt("sfactor", 2);
SetDefaultParameterInt("sfactor", 2);
AddParameter(ParameterType_Float, "vfactor", "Subsampling factor");
SetParameterFloat("vfactor", 0.6);
SetDefaultParameterFloat("vfactor", 0.6);
// Boolean Fast scheme
AddParameter(ParameterType_Empty, "fast", "Use Fast Scheme");
......
......@@ -74,9 +74,9 @@ private:
SetParameterDescription( "out" , "The rescaled image filename." );
AddParameter(ParameterType_Float, "outmin", "Output min value");
AddParameter(ParameterType_Float, "outmax", "Output max value");
SetParameterFloat("outmin", 0.0);
SetDefaultParameterFloat("outmin", 0.0);
SetParameterDescription( "outmin", "Minimum value of the output image." );
SetParameterFloat("outmax", 255.0);
SetDefaultParameterFloat("outmax", 255.0);
SetParameterDescription( "outmax", "Maximum value of the output image." );
MandatoryOff("outmin");
......
......@@ -83,18 +83,18 @@ private:
SetParameterDescription("type", "smoothing kernel to apply : mean, gaussian, anisotropric diffusion.");
AddChoice("type.mean", "Mean");
AddParameter(ParameterType_Radius, "type.mean.radius", "Radius");
SetParameterInt("type.mean.radius", 2);
SetDefaultParameterInt("type.mean.radius", 2);
AddChoice("type.gaussian", "Gaussian");
AddParameter(ParameterType_Radius, "type.gaussian.radius", "Radius");
SetParameterInt("type.gaussian.radius", 2);
SetDefaultParameterInt("type.gaussian.radius", 2);
AddChoice("type.anidif", "Anisotropic Diffusion");
AddParameter(ParameterType_Float, "type.anidif.timestep", "Time Step");
AddParameter(ParameterType_Int, "type.anidif.nbiter", "Nb Iterations");
SetParameterFloat("type.anidif.timestep", 0.125);
SetParameterInt("type.anidif.nbiter", 10);
SetDefaultParameterFloat("type.anidif.timestep", 0.125);
SetDefaultParameterInt("type.anidif.nbiter", 10);
SetParameterString("type", "anidif");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment