21 #ifndef otbWrapperNumericalParameter_h
22 #define otbWrapperNumericalParameter_h
26 #include "itkNumericTraits.h"
27 #include <boost/optional.hpp>
54 m_Value = m_DefaultValue;
60 m_Value =
otb::clamp(value, m_MinimumValue, m_MaximumValue);
63 if (!GetAutomaticValue())
79 itkGenericExceptionMacro(<<
"Parameter " << this->GetKey() <<
" has no value yet.");
86 return m_Value != boost::none;
95 itkSetMacro(DefaultValue, ScalarType);
98 itkGetMacro(DefaultValue, ScalarType);
101 itkSetMacro(MinimumValue, ScalarType);
104 itkGetMacro(MinimumValue, ScalarType);
107 itkSetMacro(MaximumValue, ScalarType);
110 itkGetMacro(MaximumValue, ScalarType);
117 itkExceptionMacro(
"Cannot convert parameter " << GetKey() <<
" to int (no value).");
119 return static_cast<int>(*m_Value);
126 itkExceptionMacro(
"Cannot convert parameter " << GetKey() <<
" to float (no value).");
128 return static_cast<float>(*m_Value);
135 itkExceptionMacro(
"Cannot convert parameter " << GetKey() <<
" to double (no value).");
137 return static_cast<double>(*m_Value);
152 std::ostringstream oss;
153 oss << this->GetValue();
160 : m_DefaultValue(
itk::NumericTraits<T>::Zero), m_MinimumValue(
itk::NumericTraits<T>::NonpositiveMin()), m_MaximumValue(
itk::NumericTraits<T>::max())
183 void operator=(
const Parameter&) =
delete;
271 this->SetName(
"RAM");
272 this->SetDescription(
"Set the maximum of available memory for the pipeline execution in mega bytes (optional, 256 by default).");
277 this->SetMinimumValue(1);
304 this->SetName(
"Radius");
306 this->SetDescription(
"Radius in pixels");