Commit 6b7043fc authored by Julien Michel's avatar Julien Michel

Merge branch 'develop' into default_functor_filter

parents a004e492 c3fa194e
......@@ -115,8 +115,7 @@ def GenerateChoice(app,param,paramlist, count = 0):
return output
def GenerateParameterType(app,param):
if app.GetParameterType(param) == otbApplication.ParameterType_Empty \
or app.GetParameterType(param) == otbApplication.ParameterType_Bool:
if app.GetParameterType(param) == otbApplication.ParameterType_Bool:
return "Boolean"
if app.GetParameterType(param) == otbApplication.ParameterType_Int \
or app.GetParameterType(param) == otbApplication.ParameterType_Radius \
......@@ -367,9 +366,6 @@ def GetApplicationExamplePythonSnippet(app,idx,expand = False, inputpath="",outp
if paramtype == otbApplication.ParameterType_Choice:
#app.SetParameterString(param,value)
output+= "\t" + appname + ".SetParameterString(" + EncloseString(param) + "," + EncloseString(value) + ")" + linesep
if paramtype == otbApplication.ParameterType_Empty:
app.EnableParameter(param)
output+= "\t" + appname + ".EnableParameter("+EncloseString(param)+")" + linesep
if paramtype == otbApplication.ParameterType_Bool:
output+= "\t" + appname + ".SetParameterString("+EncloseString(param)+","+EncloseString(value)+")" + linesep
if paramtype == otbApplication.ParameterType_Int \
......
......@@ -375,41 +375,3 @@ that relate to geometry, projections, and also calibration.
Future developments will probably offer a more adapted structure to import and
export images between OTB and the Python world.
Setting of EmptyParameter
^^^^^^^^^^^^^^^^^^^^^^^^^
Most of the parameters are set using functions ``SetParameterXXX()``, except for
one type of parameter: the ``EmptyParameter``. This class was the first
implementation of a boolean. It is now **deprecated**, you should use ``BoolParameter``
instead.
Let's take an example with the application ``ReadImageInfo`` when it was still
using an ``EmptyParameter`` for parameter ``keywordlist``:
.. code-block:: python
import otbApplication as otb
app = otb.Registry.CreateApplication("ReadImageInfo")
If you want the get the state of parameter ``keywordlist``, a boolean, use:
.. code-block:: python
app.IsParameterEnabled("keywordlist")
To set this parameter ON/OFF, use the functions:
.. code-block:: python
app.EnableParameter("keywordlist")
app.DisableParameter("keywordlist")
Don't try to use other functions to set the state of a boolean. For instance,
try the following commands:
.. code-block:: python
app.SetParameterInt("keywordlist", 0)
app.IsParameterEnabled("keywordlist")
You will get a state ``True`` even if you asked the opposite.
......@@ -39,7 +39,7 @@ Open the \code{CMakeLists.txt} file and write in the few lines:
\begin{cmakecode}
PROJECT(Tutorials)
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.1.0)
FIND_PACKAGE(OTB)
IF(OTB_FOUND)
......@@ -102,7 +102,7 @@ Follow the following steps:
\begin{cmakecode}
project(MyFirstProcessing)
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.1.0)
find_package(OTB REQUIRED)
include(${OTB_USE_FILE})
......
......@@ -153,7 +153,7 @@ private:
AddParameter(ParameterType_OutputImage, "out", "Output Image");
AddParameter(ParameterType_Empty, "param1", "Example of boolean parameter");
AddParameter(ParameterType_Bool, "param1", "Example of boolean parameter");
MandatoryOff("param1");
AddParameter(ParameterType_Int, "param2", "Example of integer parameter");
......
......@@ -65,7 +65,6 @@ LearningApplicationBase<TInputValue,TOutputValue>
"regression accuracy parameter, then the node will not be split further.");
//UseSurrogates : don't need to be exposed !
//AddParameter(ParameterType_Empty, "classifier.dt.sur", "Surrogate splits will be built");
//SetParameterDescription("classifier.dt.sur","These splits allow working with missing data and compute variable importance correctly.");
//MaxCategories
......
......@@ -79,9 +79,6 @@ LearningApplicationBase<TInputValue,TOutputValue>
"possible depth of the tree. The actual depth may be smaller if the other termination criteria are met, and/or "
"if the tree is pruned.");
//UseSurrogates : don't need to be exposed !
//AddParameter(ParameterType_Empty, "classifier.gbt.sur", "Surrogate splits will be built");
//SetParameterDescription("classifier.gbt.sur","These splits allow working with missing data and compute variable importance correctly.");
#endif
}
......
......@@ -59,10 +59,6 @@ LearningApplicationBase<TInputValue,TOutputValue>
"and the values of the train samples in this node are smaller than this regression accuracy parameter, "
"then the node will not be split.");
//UseSurrogates : don't need to be exposed !
//AddParameter(ParameterType_Empty, "classifier.rf.sur", "Surrogate splits will be built");
//SetParameterDescription("classifier.rf.sur","These splits allow working with missing data and compute variable importance correctly.");
//MaxNumberOfCategories
AddParameter(ParameterType_Int, "classifier.rf.cat",
"Cluster possible values of a categorical variable into K <= cat clusters to find a suboptimal split");
......
......@@ -189,10 +189,6 @@ private:
SetParameterDescription("filter.meanshift.minsize", "Minimum size of a region (in pixel unit) in segmentation. Smaller clusters will be merged to the neighboring cluster with the closest radiometry."
" If set to 0 no pruning is done.");
//AddParameter(ParameterType_Empty, "filter.meanshift.useoptim", "use optimization");
//SetParameterDescription("filter.meanshift.useoptim", "Use mode optimization.");
//MandatoryOff("filter.meanshift.useoptim");
SetDefaultParameterInt("filter.meanshift.spatialr", 5);
SetDefaultParameterFloat("filter.meanshift.ranger", 15.0);
SetDefaultParameterFloat("filter.meanshift.thres", 0.1);
......
......@@ -56,7 +56,6 @@ private:
AddDocTag("Test");
//std::cout << "TestApplication::DoInit" << std::endl;
AddParameter(ParameterType_Empty, "empty", "Boolean (old impl.)");
AddParameter(ParameterType_Bool, "boolean", "Boolean");
AddParameter(ParameterType_Int, "int", "Integer");
MandatoryOff("int");
......
......@@ -90,6 +90,8 @@ int otbFourierMellinImageFilter(int itkNotUsed(argc), char* argv[])
imaginaryWriter->SetInput(imaginaryRescaler->GetOutput());
imaginaryWriter->Update();
// Hugly hack for cleaning fftw threads
#if defined( ITK_USE_FFTWF ) || defined( ITK_USE_FFTWD )
fftw_cleanup_threads();
#endif
return EXIT_SUCCESS;
}
......@@ -66,7 +66,7 @@ LibSVMMachineLearningModel<TInputValue,TOutputValue>
this->m_Problem.l = 0;
this->m_Problem.y = nullptr;
this->m_Problem.x = nullptr;
#ifndef NDEBUG
#ifdef NDEBUG
svm_set_print_string_function(&otb::Utils::PrintNothing);
#endif
}
......
......@@ -157,6 +157,8 @@ public:
unsigned long startLine;
TimeType azimuthStopTime;
unsigned long endLine;
unsigned long startSample;
unsigned long endSample;
friend std::ostream & operator<<(std::ostream & os, const BurstRecordType & v)
{
return os << "{ azimuthStartTime: " << v.azimuthStartTime
......@@ -454,6 +456,7 @@ protected:
static const double C;
static const unsigned int thePluginVersion; // version of the SarSensorModel plugin
static const unsigned int thePluginVersionMin; // minimal version required of the SarSensorModel plugin
private:
/** Disabled assignment operator. */
......
......@@ -61,6 +61,8 @@ namespace ossimplugins {
extern const std::string keyVelZ ;
extern const std::string keyStartLine ;
extern const std::string keyEndLine ;
extern const std::string keyStartSample ;
extern const std::string keyEndSample ;
extern const std::string keyAzimuthStartTime ;
extern const std::string keyAzimuthStopTime ;
} // ossimplugins namespace
......
......@@ -107,7 +107,8 @@ namespace ossimplugins
const double ossimSarSensorModel::C = 299792458;
const unsigned int ossimSarSensorModel::thePluginVersion = 2;
const unsigned int ossimSarSensorModel::thePluginVersion = 3;
const unsigned int ossimSarSensorModel::thePluginVersionMin = 2;
ossimSarSensorModel::ProductType::ProductType(string_view const& s)
{
......@@ -1166,7 +1167,22 @@ bool ossimSarSensorModel::worldToAzimuthRangeTime(const ossimGpt& worldPt, TimeT
ossimSarSensorModel::BurstRecordType burstRecord;
get(kwl, burstPrefix + keyStartLine, burstRecord.startLine);
get(kwl, burstPrefix + keyEndLine, burstRecord.endLine);
get(kwl, burstPrefix + keyAzimuthStartTime, burstRecord.azimuthStartTime);
try {
unsigned int version;
get(kwl, HEADER_PREFIX, "version", version);
// startSample and endSample since version 3
if (version >= 3)
{
get(kwl, burstPrefix + keyStartSample, burstRecord.startSample);
get(kwl, burstPrefix + keyEndSample, burstRecord.endSample);
}
}
catch (...) {
throw std::runtime_error("Geom file generated with previous version of ossim plugins");
}
get(kwl, burstPrefix + keyAzimuthStartTime, burstRecord.azimuthStartTime);
get(kwl, burstPrefix + keyAzimuthStopTime, burstRecord.azimuthStopTime);
burstRecords.push_back(burstRecord);
}
......@@ -1185,6 +1201,8 @@ bool ossimSarSensorModel::worldToAzimuthRangeTime(const ossimGpt& worldPt, TimeT
add(kwl, burstPrefix + keyStartLine, (ossim_uint32) burstRecords[burstId].startLine);
add(kwl, burstPrefix + keyEndLine, (ossim_uint32) burstRecords[burstId].endLine);
add(kwl, burstPrefix + keyStartSample, (ossim_uint32) burstRecords[burstId].startSample);
add(kwl, burstPrefix + keyEndSample, (ossim_uint32) burstRecords[burstId].endSample);
add(kwl, burstPrefix + keyAzimuthStartTime, burstRecords[burstId].azimuthStartTime);
add(kwl, burstPrefix + keyAzimuthStopTime, burstRecords[burstId].azimuthStopTime);
}
......@@ -1389,7 +1407,7 @@ bool ossimSarSensorModel::worldToAzimuthRangeTime(const ossimGpt& worldPt, TimeT
try {
unsigned int version;
get(kwl, HEADER_PREFIX, "version", version);
if (version < thePluginVersion) {
if (version < thePluginVersionMin) {
throw std::runtime_error("Geom file generated with previous version of ossim plugins");
}
} catch (...) {
......
......@@ -26,39 +26,41 @@
#include "ossim/ossimSarSensorModelPathsAndKeys.h"
namespace ossimplugins {
const std::string HEADER_PREFIX = "header.";
const std::string SUPPORT_DATA_PREFIX = "support_data.";
const std::string GEOM_PREFIX = "support_data.geom";
const std::string SRD_PREFIX = "support_data.geom.srd";
const std::string SR_PREFIX = "support_data.geom.srd.coords.sr";
const std::string GR_PREFIX = "support_data.geom.srd.coords.gr";
const std::string BURST_PREFIX = "support_data.geom.bursts.burst";
const std::string BURST_NUMBER_KEY = "support_data.geom.bursts.number";
const std::string ORBIT_PREFIX = "orbitList.orbit";
const std::string ORBIT_NUMBER_KEY = "orbitList.nb_orbits";
const std::string GCP_PREFIX = "support_data.geom.gcp";
const std::string GCP_NUMBER_KEY = "support_data.geom.gcp.number";
const std::string NUMBER_KEY = "number";
const std::string HEADER_PREFIX = "header.";
const std::string SUPPORT_DATA_PREFIX = "support_data.";
const std::string GEOM_PREFIX = "support_data.geom";
const std::string SRD_PREFIX = "support_data.geom.srd";
const std::string SR_PREFIX = "support_data.geom.srd.coords.sr";
const std::string GR_PREFIX = "support_data.geom.srd.coords.gr";
const std::string BURST_PREFIX = "support_data.geom.bursts.burst";
const std::string BURST_NUMBER_KEY = "support_data.geom.bursts.number";
const std::string ORBIT_PREFIX = "orbitList.orbit";
const std::string ORBIT_NUMBER_KEY = "orbitList.nb_orbits";
const std::string GCP_PREFIX = "support_data.geom.gcp";
const std::string GCP_NUMBER_KEY = "support_data.geom.gcp.number";
const std::string NUMBER_KEY = "number";
const std::string keySr0 = "sr0";
const std::string keyGr0 = "gr0";
const std::string keyAzimuthTime = "azimuthTime";
const std::string keySlantRangeTime = "slant_range_time";
const std::string keyImPtX = "im_pt.x";
const std::string keyImPtY = "im_pt.y";
const std::string keyWorldPtLat = "world_pt.lat";
const std::string keyWorldPtLon = "world_pt.lon";
const std::string keyWorldPtHgt = "world_pt.hgt";
const std::string keyTime = "time";
const std::string keyPosX = "x_pos";
const std::string keyPosY = "y_pos";
const std::string keyPosZ = "z_pos";
const std::string keyVelX = "x_vel";
const std::string keyVelY = "y_vel";
const std::string keyVelZ = "z_vel";
const std::string keyStartLine = "start_line";
const std::string keyEndLine = "end_line";
const std::string keyAzimuthStartTime = "azimuth_start_time";
const std::string keyAzimuthStopTime = "azimuth_stop_time";
const std::string keySr0 = "sr0";
const std::string keyGr0 = "gr0";
const std::string keyAzimuthTime = "azimuthTime";
const std::string keySlantRangeTime = "slant_range_time";
const std::string keyImPtX = "im_pt.x";
const std::string keyImPtY = "im_pt.y";
const std::string keyWorldPtLat = "world_pt.lat";
const std::string keyWorldPtLon = "world_pt.lon";
const std::string keyWorldPtHgt = "world_pt.hgt";
const std::string keyTime = "time";
const std::string keyPosX = "x_pos";
const std::string keyPosY = "y_pos";
const std::string keyPosZ = "z_pos";
const std::string keyVelX = "x_vel";
const std::string keyVelY = "y_vel";
const std::string keyVelZ = "z_vel";
const std::string keyStartLine = "start_line";
const std::string keyEndLine = "end_line";
const std::string keyStartSample = "start_sample";
const std::string keyEndSample = "end_sample";
const std::string keyAzimuthStartTime = "azimuth_start_time";
const std::string keyAzimuthStopTime = "azimuth_stop_time";
} // ossimplugins namespace
......@@ -163,6 +163,7 @@ namespace ossimplugins
void readGeoLocationGrid(ossimXmlNode const& productRoot);
void addOrbitStateVectors(ossimXmlNode const& orbitList);
void addDopplerCentroidCoefficients(ossimXmlNode const& dcEstimateList);
void addAzimuthFmRateCoefficients(ossimXmlNode const& aziFmRateList);
bool openMetadataFile(ossimXmlDocument& doc, ossimString const& file) const;
ossimFilename theManifestDirectory;
......
......@@ -30,6 +30,7 @@
namespace {// Anonymous namespace
const ossimString attAzimuthTime = "azimuthTime";
const ossimString attFirstValidSample = "firstValidSample";
const ossimString attLastValidSample = "lastValidSample";
const ossimString attGr0 = "gr0";
const ossimString attGrsrCoefficients = "grsrCoefficients";
const ossimString attHeight = "height";
......@@ -175,11 +176,16 @@ void ossimSentinel1SarSensorModel::readAnnotationFile(const std::string & annota
burstRecord.azimuthStopTime = getTimeFromFirstNode(xmlRoot,"imageAnnotation/imageInformation/productLastLineUtcTime");
burstRecord.endLine = getTextFromFirstNode(xmlRoot, "imageAnnotation/imageInformation/numberOfLines").toUInt16()-1;
burstRecord.startSample = 0;
burstRecord.endSample = getTextFromFirstNode(xmlRoot, "imageAnnotation/imageInformation/numberOfSamples").toUInt16()-1;;
theBurstRecords.push_back(burstRecord);
}
else
{
const unsigned int linesPerBurst = xmlRoot.findFirstNode("swathTiming/linesPerBurst")->getText().toUInt16();
const unsigned int samplesPerBurst = xmlRoot.findFirstNode("swathTiming/samplesPerBurst")->getText().toUInt16();
unsigned int burstId(0);
for(std::vector<ossimRefPtr<ossimXmlNode> >::iterator itNode = xnodes.begin(); itNode!=xnodes.end();++itNode,++burstId)
......@@ -188,10 +194,12 @@ void ossimSentinel1SarSensorModel::readAnnotationFile(const std::string & annota
const ossimSarSensorModel::TimeType azTime = getTimeFromFirstNode(**itNode, attAzimuthTime);
// Scan firstValidSample to define the first valid sample and valid lines
ossimString const& s = getTextFromFirstNode(**itNode, attFirstValidSample);
long first_valid(0), last_valid(0);
bool begin_found(false), end_found(false);
long first_sample_valid(0), last_sample_valid(samplesPerBurst-1);
std::vector<ossimString> ssp = s.split(" ");
......@@ -200,6 +208,7 @@ void ossimSentinel1SarSensorModel::readAnnotationFile(const std::string & annota
; ++sIt
)
{
// Find valid lines
if(!begin_found)
{
if(*sIt!="-1")
......@@ -224,14 +233,63 @@ void ossimSentinel1SarSensorModel::readAnnotationFile(const std::string & annota
++last_valid;
}
}
// Find first valid samples
if(*sIt!="-1")
{
int Fvs = samplesPerBurst;
try
{
Fvs = std::stoi(*sIt);
}
catch( ... )
{
// Throw an execption
throw std::runtime_error("Failed to convert firstValidSample value.");
}
if (Fvs > first_sample_valid && Fvs < samplesPerBurst)
{
first_sample_valid = Fvs;
}
}
}
// Scan lastValidSample to define the last valid sample
ossimString const& sLast = getTextFromFirstNode(**itNode, attLastValidSample);
std::vector<ossimString> sspLast = sLast.split(" ");
for (auto const& token : sspLast)
{
// Last first valid samples
if(token != "-1")
{
int Lvs = 0;
try
{
Lvs = std::stoi(token);
}
catch( ... )
{
// Throw an execption
throw std::runtime_error("Failed to convert lastValidSample value.");
}
if (Lvs < last_sample_valid && Lvs > 0)
{
last_sample_valid = Lvs;
}
}
}
burstRecord.startLine = burstId*linesPerBurst + first_valid;
burstRecord.endLine = burstId*linesPerBurst + last_valid;
burstRecord.azimuthStartTime = azTime + (first_valid*theAzimuthTimeInterval);
burstRecord.azimuthStopTime = azTime + (last_valid*theAzimuthTimeInterval);
burstRecord.startSample = first_sample_valid;
burstRecord.endSample = last_sample_valid;
theBurstRecords.push_back(burstRecord);
}
}
......
......@@ -190,10 +190,6 @@ public:
* or a value set externally by user */
bool HasValue(std::string paramKey) const;
/* Get active flag of parameter with key paramKey
*/
bool GetParameterEmpty(std::string paramKey);
/** Set HasUserValue flag of parameter with key paramKey
* Note that when this function is called from DoInit, DoUpdateParameters
* or DoExecute, it will always set this flag to false, because this is
......@@ -226,6 +222,7 @@ public:
*
* Can be called for types :
* \li ParameterType_Int
* \li ParameterType_Bool
* \li ParameterType_Float
* \li ParameterType_Radius
* \li ParameterType_Choice
......@@ -246,6 +243,7 @@ public:
* \li ParameterType_InputVectorDataListParameter
* \li ParameterType_InputFilenameListParameter
* \li ParameterType_StringList
* \li ParameterType_ListView
*/
void SetParameterString(std::string parameter, std::string value, bool hasUserValueFlag = true);
......@@ -253,6 +251,8 @@ public:
*
* Can be called for types :
* \li ParameterType_String
* \li ParameterType_StringList
* \li ParameterType_ListView
* \li ParameterType_InputFilename
* \li ParameterType_OutputFilename
* \li ParameterType_Directory
......@@ -268,8 +268,6 @@ public:
*/
void SetParameterStringList(std::string parameter, std::vector<std::string> values, bool hasUserValueFlag = true);
void SetParameterEmpty(std::string parameter, bool value, bool hasUserValueFlag = true);
/** Checks if the application is ready to be executed. It checks that there
* is no missing parameter
*/
......@@ -431,6 +429,7 @@ public:
*
* Can be called for types :
* \li ParameterType_Int
* \li ParameterType_Bool
* \li ParameterType_Float
* \li ParameterType_Radius
* \li ParameterType_Choice
......
......@@ -33,8 +33,6 @@ namespace Wrapper
/** \class BoolParameter
* \brief This class represent a boolean parameter for the wrapper framework
*
* It is intended to replace the deprecated EmptyParameter
*
* \ingroup OTBApplicationEngine
*/
class OTBApplicationEngine_EXPORT BoolParameter
......
/*
* Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef otbWrapperEmptyParameter_h
#define otbWrapperEmptyParameter_h
#include "otbWrapperParameter.h"
namespace otb
{
namespace Wrapper
{
/** \class EmptyParameter
* \brief This class represent an empty parameter for the wrapper framework (boolean value)
*
* \deprecated in OTB 6.6, use BoolParameter instead
*
* \ingroup OTBApplicationEngine
*/
class OTBApplicationEngine_EXPORT EmptyParameter
: public Parameter
{
public:
/** Standard class typedef */
typedef EmptyParameter Self;
typedef Parameter Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Defining ::New() static method */
itkNewMacro(Self);
/** RTTI support */
itkTypeMacro(EmptyParameter, Parameter);
/** HasValue */
bool HasValue() const override
{
return false;
}
bool HasUserValue() const override
{
return this->m_UserValue;
}
protected:
/** Constructor */
EmptyParameter()
{
// It does not make sense for an empty parameter to be mandatory
this->MandatoryOff();
}
/** Destructor */
~EmptyParameter() override
{}
private:
EmptyParameter(const EmptyParameter &) = delete;
void operator =(const EmptyParameter&) = delete;
}; // End class Parameter
} // End namespace Wrapper
} // End namespace otb
#endif
......@@ -35,7 +35,6 @@ namespace Wrapper
typedef enum
{
ParameterType_Empty,
ParameterType_Int,
ParameterType_Float,
ParameterType_String,
......
......@@ -22,7 +22,6 @@
#include "otbWrapperChoiceParameter.h"
#include "otbWrapperListViewParameter.h"
#include "otbWrapperDirectoryParameter.h"
#include "otbWrapperEmptyParameter.h"
#include "otbWrapperInputFilenameParameter.h"
#include "otbWrapperInputFilenameListParameter.h"
#include "otbWrapperOutputFilenameParameter.h"
......@@ -380,6 +379,10 @@ void Application::SetParameterInt(std::string parameter, int value, bool hasUser
BoolParameter* paramBool = dynamic_cast<BoolParameter*>(param);
paramBool->SetValue(static_cast<bool>(value));
}
else
{
otbAppLogWARNING(<< "SetParameterInt on parameter " + parameter);
}
this->SetParameterUserValue(parameter, hasUserValueFlag);
}
......@@ -538,12 +541,6 @@ void Application::SetParameterStringList(std::string parameter, std::vector<std:
this->SetParameterUserValue(parameter, hasUserValueFlag);
}
void Application::SetParameterEmpty(std::string parameter, bool value, bool hasUserValueFlag)
{
this->SetParameterUserValue(parameter, hasUserValueFlag);
GetParameterByKey(parameter)->SetActive(value);
}
void Application::SetParameterUserValue(std::string paramKey, bool value)
{
/** UserValue is set/unset parameter must be active.
......@@ -1086,11 +1083,6 @@ Role Application::GetParameterRole(std::string paramKey) const
return GetParameterByKey(paramKey)->GetRole();
}
bool Application::GetParameterEmpty(std::string paramKey)
{
return GetParameterByKey(paramKey)->GetActive();
}
/* Return the role (input/output) of a parameter */
void Application::SetParameterRole(std::string paramKey, Role role)
{
......@@ -1116,10 +1108,6 @@ ParameterType Application::GetParameterType(std::string paramKey) const
{
type = ParameterType_Radius;
}
else if (dynamic_cast<const EmptyParameter*>(param))
{
type = ParameterType_Empty;
}
else if (dynamic_cast<const IntParameter*>(param))
{
type = ParameterType_Int;
......@@ -1550,11 +1538,6 @@ int Application::GetParameterInt(std::string parameter)
BoolParameter* paramBool = dynamic_cast<BoolParameter*>(param);
ret = static_cast<int>(paramBool->GetValue());
}
else if (dynamic_cast<EmptyParameter*>(param))
{
// This case is here for compatibility purpose with deprecated EmptyParameter
ret = static_cast<int>(this->IsParameterEnabled(parameter));
}
else
{
itkExceptionMacro(<<parameter << " parameter can't be casted to int");
......
......@@ -23,7 +23,6 @@
#include "otbWrapperChoiceParameter.h"
#include "otbWrapperListViewParameter.h"
#include "otbWrapperDirectoryParameter.h"
#include "otbWrapperEmptyParameter.h"
#include "otbWrapperInputFilenameParameter.h"
#include "otbWrapperInputFilenameListParameter.h"
#include "otbWrapperOutputFilenameParameter.h"
......@@ -419,15 +418,6 @@ InputProcessXMLParameter::Read(Application::Pointer this_)
std::stringstream(value) >> floatValue;
this_->SetParameterFloat(key, floatValue);
}
else if (type == ParameterType_Empty)
{
bool emptyValue = false;
if( value == "true")
{
emptyValue = true;
}
this_->SetParameterEmpty(key, emptyValue);
}
else if (type == ParameterType_StringList || type == ParameterType_ListView)