]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Plugins/BasicFilters/ExtractSliceImageFilter.cxx
...
[cpPlugins.git] / lib / cpPlugins / Plugins / BasicFilters / ExtractSliceImageFilter.cxx
index df46d6f434d8e62a28759818ff816a2f8fc24241..0e553fd1bca1a6fe31e9e4868c2e064042f5f23d 100644 (file)
@@ -8,12 +8,14 @@ cpPlugins::BasicFilters::ExtractSliceImageFilter::
 ExtractSliceImageFilter( )
   : Superclass( )
 {
-  this->SetNumberOfInputs( 1 );
-  this->SetNumberOfOutputs( 1 );
-  this->_MakeOutput< cpPlugins::Interface::Image >( 0 );
+  this->_AddInput( "Input", true );
+  this->_AddOutput< cpPlugins::Interface::Image >( "Output" );
 
-  this->m_Parameters->ConfigureAsUint( "Axis", 0 );
-  this->m_Parameters->ConfigureAsInt( "Slice", 0 );
+  this->m_Parameters->ConfigureAsUint( "Axis" );
+  this->m_Parameters->ConfigureAsInt( "Slice" );
+
+  this->m_Parameters->SetUint( "Axis", 0 );
+  this->m_Parameters->SetInt( "Slice", 0 );
 }
 
 // -------------------------------------------------------------------------
@@ -26,8 +28,7 @@ cpPlugins::BasicFilters::ExtractSliceImageFilter::
 std::string cpPlugins::BasicFilters::ExtractSliceImageFilter::
 _GenerateData( )
 {
-  cpPlugins::Interface::Image* image =
-    this->GetInput< cpPlugins::Interface::Image >( 0 );
+  auto image = this->GetInputData< cpPlugins::Interface::Image >( "Input" );
   if( image == NULL )
     return( "ExtractSliceImageFilter: No input image." );
 
@@ -78,8 +79,7 @@ _RealGD( itk::DataObject* image )
   filter->Update( );
 
   // Connect output
-  cpPlugins::Interface::Image* out =
-    this->GetOutput< cpPlugins::Interface::Image >( 0 );
+  auto out = this->GetOutputData< cpPlugins::Interface::Image >( "Output" );
   if( out != NULL )
   {
     out->SetITK< O >( filter->GetOutput( ) );