]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Plugins/BasicFilters/BinaryThresholdImageFilter.cxx
...
[cpPlugins.git] / lib / cpPlugins / Plugins / BasicFilters / BinaryThresholdImageFilter.cxx
index 5dc60cba906aabf2a6f0a21845275b37b9a22633..98926796d276469c85df76d22fa845d7a1a2d2f6 100644 (file)
@@ -8,13 +8,18 @@ cpPlugins::BasicFilters::BinaryThresholdImageFilter::
 BinaryThresholdImageFilter( )
   : Superclass( )
 {
-  this->_AddInput( "Input" );
-  this->_MakeOutput< cpPlugins::Interface::Image >( "Output" );
+  this->_AddInput( "Input", true );
+  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( ) );