this->_MakeOutput< cpPlugins::Interface::Image >( 0 );
using namespace cpPlugins::Interface;
- this->m_DefaultParameters.Configure(Parameters::Real, "LowerThresholdValue");
- this->m_DefaultParameters.Configure(Parameters::Real, "UpperThresholdValue");
- this->m_DefaultParameters.Configure(Parameters::Real, "InsideValue");
- this->m_DefaultParameters.Configure(Parameters::Real, "OutsideValue");
+ this->m_DefaultParameters.Configure( Parameters::Real, "LowerThresholdValue" );
+ this->m_DefaultParameters.Configure( Parameters::Real, "UpperThresholdValue" );
+ this->m_DefaultParameters.Configure( Parameters::Real, "InsideValue" );
+ this->m_DefaultParameters.Configure( Parameters::Real, "OutsideValue" );
- this->m_DefaultParameters.SetValueAsReal("LowerThresholdValue", 100);
- this->m_DefaultParameters.SetValueAsReal("UpperThresholdValue",500);
- this->m_DefaultParameters.SetValueAsReal("InsideValue", 255);
- this->m_DefaultParameters.SetValueAsReal("OutsideValue", 0);
+ this->m_DefaultParameters.SetValueAsReal( "LowerThresholdValue", 100 );
+ this->m_DefaultParameters.SetValueAsReal( "UpperThresholdValue", 500 );
+ this->m_DefaultParameters.SetValueAsReal( "InsideValue", 255 );
+ this->m_DefaultParameters.SetValueAsReal( "OutsideValue", 0 );
- //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;
}
_RealGD( itk::DataObject* image )
{
typedef itk::BinaryThresholdImageFilter< I, O > _F;
+ typedef typename I::PixelType _IP;
typedef typename O::PixelType _OP;
// Get parameters
//unsigned int bins =
// this->m_Parameters.GetValueAsUint( "NumberOfHistogramBins" );
- _OP lower_val = _OP(this->m_Parameters.GetValueAsReal("LowerValue"));
- _OP upper_val = _OP(this->m_Parameters.GetValueAsReal("UpperValue"));
+ _IP lower_val = _IP( this->m_Parameters.GetValueAsReal( "LowerValue" ) );
+ _IP upper_val = _IP( this->m_Parameters.GetValueAsReal( "UpperValue" ) );
_OP in_val = _OP( this->m_Parameters.GetValueAsReal( "InsideValue" ) );
_OP out_val = _OP( this->m_Parameters.GetValueAsReal( "OutsideValue" ) );
} // fi
filter->SetInput( dynamic_cast< I* >( image ) );
- //filter->SetNumberOfHistogramBins( bins );
- filter->SetLowerThreshold(lower_val);
- filter->SetUpperThreshold(upper_val);
+ filter->SetLowerThreshold( lower_val );
+ filter->SetUpperThreshold( upper_val );
filter->SetInsideValue( in_val );
filter->SetOutsideValue( out_val );
filter->Update( );
this->_MakeOutput< cpPlugins::Interface::Image >( 0 );
using namespace cpPlugins::Interface;
- this->m_DefaultParameters.Configure(Parameters::Real, "Radius");
-
- this->m_DefaultParameters.SetValueAsReal("Radius", 3);
-
+ this->m_DefaultParameters.Configure( Parameters::Uint, "Radius" );
+
+ this->m_DefaultParameters.SetValueAsUint( "Radius", 3 );
+
this->m_Parameters = this->m_DefaultParameters;
}
_RealGD( itk::DataObject* image )
{
typedef itk::MedianImageFilter< I, O > _F;
- typedef typename O::PixelType _OP;
+ typedef typename _F::RadiusType _RT;
// Get parameters
-
- _OP rad_val = _OP(this->m_Parameters.GetValueAsReal("Radius"));
-
+ _RT rad_val;
+ rad_val.Fill( this->m_Parameters.GetValueAsUint( "Radius" ) );
// Configure filter
_F* filter = dynamic_cast< _F* >( this->m_RealProcessObject.GetPointer( ) );
} // fi
filter->SetInput( dynamic_cast< I* >( image ) );
-
- filter->SetRadius(rad_val);
-
+ filter->SetRadius( rad_val );
+
filter->Update( );
// Connect output