X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FPlugins%2FBasicFilters%2FMacheteFilter.cxx;h=6877a3d3e2ee65134f72dca8f3d90c9906ad56f8;hb=1bf710541f1f708f9000096a8d516596bf009d6d;hp=71b3af481495376306fb099683b047d7897e9858;hpb=7caa01f9eacc4861ba7d5d9ed16872d60328088f;p=cpPlugins.git diff --git a/lib/cpPlugins/Plugins/BasicFilters/MacheteFilter.cxx b/lib/cpPlugins/Plugins/BasicFilters/MacheteFilter.cxx index 71b3af4..6877a3d 100644 --- a/lib/cpPlugins/Plugins/BasicFilters/MacheteFilter.cxx +++ b/lib/cpPlugins/Plugins/BasicFilters/MacheteFilter.cxx @@ -130,8 +130,7 @@ ExecConfigurationDialog( QWidget* parent ) // 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 ) { @@ -139,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 ); @@ -196,7 +194,7 @@ MacheteFilter( ) : Superclass( ), m_PlaneWidget( NULL ) { - this->_AddInput( "Input" ); + this->_AddInput( "Input", true ); this->_AddOutput< cpPlugins::Interface::DataObject >( "PositiveOutput" ); this->_AddOutput< cpPlugins::Interface::DataObject >( "NegativeOutput" ); @@ -218,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." ); @@ -289,25 +285,19 @@ _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