]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Plugins/BasicFilters/MarchingCubes.cxx
...
[cpPlugins.git] / lib / cpPlugins / Plugins / BasicFilters / MarchingCubes.cxx
index 22ed81efd955f7a6bb888c33ab379521daf8b3f0..95ede25066c8db58751483cac71ea0d71a7f9464 100644 (file)
@@ -12,7 +12,7 @@ MarchingCubes( )
   : Superclass( )
 {
   this->_AddInput( "Input" );
-  this->_MakeOutput< cpPlugins::Interface::Mesh >( "Output" );
+  this->_AddOutput< cpPlugins::Interface::Mesh >( "Output" );
 
   this->m_Parameters->ConfigureAsRealList( "Thresholds" );
 }
@@ -28,16 +28,15 @@ std::string cpPlugins::BasicFilters::MarchingCubes::
 _GenerateData( )
 {
   // Get input
-  cpPlugins::Interface::Image* image =
-    this->GetInput< cpPlugins::Interface::Image >( "Input" );
+  auto image = this->GetInputData< cpPlugins::Interface::Image >( "Input" );
   if( image == NULL )
     return( "MarchingCubes: Input data is not a valid image." );
   vtkImageData* vtk_image = image->GetVTK< vtkImageData >( );
   if( vtk_image == NULL )
     return( "MarchingCubes: Input does not have a valid VTK conversion." );
 
-  std::vector< double > values;
-  this->m_Parameters->GetRealList( values, "Thresholds" );
+  std::vector< double > values =
+    this->m_Parameters->GetRealList( "Thresholds" );
   vtkPolyData* pd = NULL;
   if( vtk_image->GetDataDimension( ) == 2 )
   {
@@ -54,10 +53,7 @@ _GenerateData( )
     mc->ComputeNormalsOff( );
     mc->SetInputData( vtk_image );
     for( unsigned int i = 0; i < values.size( ); ++i )
-    {
-      std::cout << i << " " << values[ i ] << std::endl;
       mc->SetValue( i, values[ i ] );
-    }
     mc->Update( );
     pd = mc->GetOutput( );
   }
@@ -65,8 +61,7 @@ _GenerateData( )
     return( "MarchingCubes: Input data does not have a valid dimension." );
 
   // Execute filter
-  cpPlugins::Interface::Mesh* out =
-    this->GetOutput< cpPlugins::Interface::Mesh >( "Output" );
+  auto out = this->GetOutputData< cpPlugins::Interface::Mesh >( "Output" );
   out->SetVTK( pd );
   return( "" );
 }