X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FPlugins%2FBasicFilters%2FOtsuThresholdImageFilter.cxx;h=6bc538e7efa635de4ca9b99bdeecb816f7bf237b;hb=053d8cf79b27bbef92a92a076d67e1b94fa509d1;hp=59f98f5778f5b614b7880225a05ec4a7d70031c2;hpb=dba64a6906e88d6023b2e6c9632da9fd41bfeb53;p=cpPlugins.git diff --git a/lib/cpPlugins/Plugins/BasicFilters/OtsuThresholdImageFilter.cxx b/lib/cpPlugins/Plugins/BasicFilters/OtsuThresholdImageFilter.cxx index 59f98f5..6bc538e 100644 --- a/lib/cpPlugins/Plugins/BasicFilters/OtsuThresholdImageFilter.cxx +++ b/lib/cpPlugins/Plugins/BasicFilters/OtsuThresholdImageFilter.cxx @@ -8,20 +8,12 @@ cpPlugins::BasicFilters::OtsuThresholdImageFilter:: OtsuThresholdImageFilter( ) : Superclass( ) { - this->SetNumberOfInputs( 1 ); - this->SetNumberOfOutputs( 1 ); - this->_MakeOutput< cpPlugins::Interface::Image >( 0 ); + this->_AddInput( "Input" ); + this->_MakeOutput< cpPlugins::Interface::Image >( "Output" ); - using namespace cpPlugins::Interface; - this->m_DefaultParameters.Configure( - Parameters::Uint, "NumberOfHistogramBins" - ); - this->m_DefaultParameters.Configure( Parameters::Real, "InsideValue" ); - this->m_DefaultParameters.Configure( Parameters::Real, "OutsideValue" ); - this->m_DefaultParameters.SetValueAsUint( "NumberOfHistogramBins", 100 ); - this->m_DefaultParameters.SetValueAsReal( "InsideValue", 255 ); - this->m_DefaultParameters.SetValueAsReal( "OutsideValue", 0 ); - this->m_Parameters = this->m_DefaultParameters; + this->m_Parameters->ConfigureAsUint( "NumberOfHistogramBins", 100 ); + this->m_Parameters->ConfigureAsUint( "InsideValue", 255 ); + this->m_Parameters->ConfigureAsUint( "OutsideValue", 0 ); } // ------------------------------------------------------------------------- @@ -69,10 +61,9 @@ _RealGD( itk::DataObject* image ) typedef typename O::PixelType _OP; // Get parameters - unsigned int bins = - this->m_Parameters.GetValueAsUint( "NumberOfHistogramBins" ); - _OP in_val = _OP( this->m_Parameters.GetValueAsReal( "InsideValue" ) ); - _OP out_val = _OP( this->m_Parameters.GetValueAsReal( "OutsideValue" ) ); + unsigned int bins = this->m_Parameters->GetUint( "NumberOfHistogramBins" ); + _OP in_val = _OP( this->m_Parameters->GetUint( "InsideValue" ) ); + _OP out_val = _OP( this->m_Parameters->GetUint( "OutsideValue" ) ); // Configure filter _F* filter = this->_CreateITK< _F >( ); @@ -84,7 +75,7 @@ _RealGD( itk::DataObject* image ) // Connect output cpPlugins::Interface::Image* out = - this->GetOutput< cpPlugins::Interface::Image >( 0 ); + this->GetOutput< cpPlugins::Interface::Image >( "Output" ); if( out != NULL ) { out->SetITK< O >( filter->GetOutput( ) );