]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Plugins/BasicFilters/BinaryThresholdImageFilter.cxx
...
[cpPlugins.git] / lib / cpPlugins / Plugins / BasicFilters / BinaryThresholdImageFilter.cxx
index 5dc60cba906aabf2a6f0a21845275b37b9a22633..5f159ce6410de2384beb69fd40b0a54e926be5be 100644 (file)
@@ -9,12 +9,17 @@ BinaryThresholdImageFilter( )
   : Superclass( )
 {
   this->_AddInput( "Input" );
-  this->_MakeOutput< cpPlugins::Interface::Image >( "Output" );
+  this->_AddOutput< cpPlugins::Interface::Image >( "Output" );
 
-  this->m_Parameters->ConfigureAsReal( "LowerThresholdValue", 0 );
-  this->m_Parameters->ConfigureAsReal( "UpperThresholdValue", 10000 );
-  this->m_Parameters->ConfigureAsUint( "InsideValue", 1 );
-  this->m_Parameters->ConfigureAsUint( "OutsideValue", 0 );
+  this->m_Parameters->ConfigureAsReal( "LowerThresholdValue" );
+  this->m_Parameters->ConfigureAsReal( "UpperThresholdValue" );
+  this->m_Parameters->ConfigureAsUint( "InsideValue" );
+  this->m_Parameters->ConfigureAsUint( "OutsideValue" );
+
+  this->m_Parameters->SetReal( "LowerThresholdValue", 0 );
+  this->m_Parameters->SetReal( "UpperThresholdValue", 10000 );
+  this->m_Parameters->SetUint( "InsideValue", 1 );
+  this->m_Parameters->SetUint( "OutsideValue", 0 );
 }
 
 // -------------------------------------------------------------------------
@@ -27,8 +32,7 @@ cpPlugins::BasicFilters::BinaryThresholdImageFilter::
 std::string cpPlugins::BasicFilters::BinaryThresholdImageFilter::
 _GenerateData( )
 {
-  cpPlugins::Interface::Image* image =
-    this->GetInput< cpPlugins::Interface::Image >( "Input" );
+  auto image = this->GetInputData< cpPlugins::Interface::Image >( "Input" );
   if( image == NULL )
     return( "BinaryThresholdImageFilter: No input image." );
 
@@ -80,8 +84,7 @@ _RealGD( itk::DataObject* image )
   filter->Update( );
 
   // Connect output
-  cpPlugins::Interface::Image* out =
-    this->GetOutput< cpPlugins::Interface::Image >( "Output" );
+  auto out = this->GetOutputData< cpPlugins::Interface::Image >( "Output" );
   if( out != NULL )
   {
     out->SetITK< O >( filter->GetOutput( ) );