]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Plugins/BasicFilters/MacheteFilter.cxx
MAC compilation issues solved... Now some tests please
[cpPlugins.git] / lib / cpPlugins / Plugins / BasicFilters / MacheteFilter.cxx
index 82449b388a4d45f7f8a69c8c65bbacef684af206..e8e9b101e8888c32f6c5d5769e4e2d574d3fdfc7 100644 (file)
@@ -112,6 +112,7 @@ ExecConfigurationDialog( QWidget* parent )
 
   // Choose a valid 3D interactor
   vtkRenderWindowInteractor* iren = NULL;
+  /* TODO
   auto iIt = this->m_Interactors.begin( );
   for( ; iIt != this->m_Interactors.end( ) && iren == NULL; ++iIt )
   {
@@ -123,13 +124,13 @@ ExecConfigurationDialog( QWidget* parent )
       iren = *iIt;
     
   } // rof
+  */
   if( iren == NULL )
     return( false );
   
   // Get bounding box
   double bbox[ 6 ];
-  cpPlugins::Interface::Image* image =
-    this->GetInput< cpPlugins::Interface::Image >( "Input" );
+  auto image = this->GetInputData< cpPlugins::Interface::Image >( "Input" );
   bool input_found = false;
   if( image != NULL )
   {
@@ -137,8 +138,7 @@ ExecConfigurationDialog( QWidget* parent )
     input_found = true;
 
   } // fi
-  cpPlugins::Interface::Mesh* mesh =
-    this->GetInput< cpPlugins::Interface::Mesh >( "Input" );
+  auto mesh = this->GetInputData< cpPlugins::Interface::Mesh >( "Input" );
   if( mesh != NULL )
   {
     mesh->GetVTK< vtkPolyData >( )->GetBounds( bbox );
@@ -216,12 +216,10 @@ cpPlugins::BasicFilters::MacheteFilter::
 std::string cpPlugins::BasicFilters::MacheteFilter::
 _GenerateData( )
 {
-  cpPlugins::Interface::Image* image =
-    this->GetInput< cpPlugins::Interface::Image >( "Input" );
+  auto image = this->GetInputData< cpPlugins::Interface::Image >( "Input" );
   if( image != NULL )
     return( this->_FromImage( image ) );
-  cpPlugins::Interface::Mesh* mesh =
-    this->GetInput< cpPlugins::Interface::Mesh >( "Input" );
+  auto mesh = this->GetInputData< cpPlugins::Interface::Mesh >( "Input" );
   if( mesh == NULL )
     return( this->_FromMesh( mesh ) );
   return( "MacheteFilter: No valid input." );
@@ -287,31 +285,25 @@ _RealImage( itk::DataObject* dobj )
   filter->SetOutsideValue( _TPixel( 0 ) );
   filter->Update( );
 
-  // Get output names
-  auto pos_name = this->GetOutput< _TObj >( "PositiveOutput" )->GetName( );
-  auto neg_name = this->GetOutput< _TObj >( "NegativeOutput" )->GetName( );
-
   // Connect outputs (and correct their types and names)
-  _TImage* pos_out = this->GetOutput< _TImage >( "PositiveOutput" );
+  _TImage* pos_out = this->GetOutputData< _TImage >( "PositiveOutput" );
   if( pos_out == NULL )
   {
     this->_AddOutput< _TImage >( "PositiveOutput" );
-    pos_out = this->GetOutput< _TImage >( "PositiveOutput" );
-    pos_out->SetName( pos_name );
+    pos_out = this->GetOutputData< _TImage >( "PositiveOutput" );
 
   } // fi
-  _TImage* neg_out = this->GetOutput< _TImage >( "NegativeOutput" );
+  _TImage* neg_out = this->GetOutputData< _TImage >( "NegativeOutput" );
   if( neg_out == NULL )
   {
     this->_AddOutput< _TImage >( "NegativeOutput" );
-    neg_out = this->GetOutput< _TImage >( "NegativeOutput" );
-    neg_out->SetName( neg_name );
+    neg_out = this->GetOutputData< _TImage >( "NegativeOutput" );
 
   } // fi
 
   // Assign outputs
-  pos_out->SetITK< I >( filter->GetPositiveOutput( ) );
-  neg_out->SetITK< I >( filter->GetNegativeOutput( ) );
+  pos_out->SetITK( filter->GetPositiveOutput( ) );
+  neg_out->SetITK( filter->GetNegativeOutput( ) );
   return( "" );
 }