Skip to content
Snippets Groups Projects
Commit 759ba449 authored by Cyrille Valladeau's avatar Cyrille Valladeau
Browse files

ENH: fix bug in Clamp filter, attribut not updated + tests

parent 805ddba8
No related branches found
No related tags found
No related merge requests found
......@@ -78,11 +78,21 @@ public:
void ClampOutside(const OutputImagePixelType &lower, const OutputImagePixelType &upper);
/** Set/Get methods to set the lower threshold */
itkSetMacro(Lower, OutputImagePixelType);
void SetLower(OutputImagePixelType val)
{
m_Lower = val;
m_DLower = static_cast<double>(val);
this->Modified();
}
itkGetConstMacro(Lower, OutputImagePixelType);
/** Set/Get methods to set the upper threshold */
itkSetMacro(Upper, OutputImagePixelType);
void SetUpper(OutputImagePixelType val)
{
m_Upper = val;
m_DUpper = static_cast<double>(val);
this->Modified();
}
itkGetConstMacro(Upper, OutputImagePixelType);
......
......@@ -80,11 +80,21 @@ public:
void ClampOutside(const OutputImageInternalPixelType &lower, const OutputImageInternalPixelType &upper);
/** Set/Get methods to set the lower threshold */
itkSetMacro(Lower, OutputImageInternalPixelType);
void SetLower(OutputImageInternalPixelType val)
{
m_Lower = val;
m_DLower = static_cast<double>(val);
this->Modified();
}
itkGetConstMacro(Lower, OutputImageInternalPixelType);
/** Set/Get methods to set the upper threshold */
itkSetMacro(Upper, OutputImageInternalPixelType);
void SetUpper(OutputImageInternalPixelType val)
{
m_Upper = val;
m_DUpper = static_cast<double>(val);
this->Modified();
}
itkGetConstMacro(Upper, OutputImageInternalPixelType);
......
......@@ -55,8 +55,8 @@ int otbClampImageFilterTest(int argc, char* argv[])
reader->SetFileName( argv[1] );
filter->SetInput( reader->GetOutput() );
filter->SetLower( 500 );
filter->SetUpper( 2000 );
filter->SetLower( 100 );
filter->SetUpper( 400 );
writer->SetInput( filter->GetOutput() );
writer->SetFileName( argv[2] );
......
......@@ -56,7 +56,7 @@ int otbClampVectorImageFilterTest(int argc, char* argv[])
reader->SetFileName( argv[1] );
filter->SetInput( reader->GetOutput() );
filter->SetLower( 100 );
filter->SetUpper( 150 );
filter->SetUpper( 400 );
writer->SetInput( filter->GetOutput() );
writer->SetFileName( argv[2] );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment