X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=plugins%2Ffpa%2FMinimumSpanningTreeReader.cxx;h=e0c4ffe9b1f86d82f13276e4efb2e5cc4b044631;hb=e832f438861464a8d521464b61be7e31c896adb8;hp=8326dfb6fefa31792773ca9a1ae01e12a194e68f;hpb=aaeabf9e79b8db1b97bc3381e95e46c77da4d891;p=FrontAlgorithms.git diff --git a/plugins/fpa/MinimumSpanningTreeReader.cxx b/plugins/fpa/MinimumSpanningTreeReader.cxx index 8326dfb..e0c4ffe 100644 --- a/plugins/fpa/MinimumSpanningTreeReader.cxx +++ b/plugins/fpa/MinimumSpanningTreeReader.cxx @@ -24,14 +24,14 @@ fpaPlugins::MinimumSpanningTreeReader:: } // ------------------------------------------------------------------------- -std::string fpaPlugins::MinimumSpanningTreeReader:: +void fpaPlugins::MinimumSpanningTreeReader:: _GenerateData( ) { // Infere MST dimensions auto fname = this->m_Parameters.GetOpenFileName( "FileName" ); std::ifstream input( fname.c_str( ) ); if( !input ) - return( + this->_Error( std::string( "MinimumSpanningTreeReader: Error opening file \"" ) + fname + std::string( "\"" ) @@ -40,15 +40,14 @@ _GenerateData( ) input >> dim; // Real execution - if ( dim == 2 ) return( this->_GD0< 2 >( fname ) ); - else if( dim == 3 ) return( this->_GD0< 3 >( fname ) ); - else - return( "MinimumSpanningTreeReader: invalid dimensions." ); + if ( dim == 2 ) this->_GD0< 2 >( fname ); + else if( dim == 3 ) this->_GD0< 3 >( fname ); + else this->_Error( "Invalid dimensions." ); } // ------------------------------------------------------------------------- template< unsigned int _NDim > -std::string fpaPlugins::MinimumSpanningTreeReader:: +void fpaPlugins::MinimumSpanningTreeReader:: _GD0( const std::string& fname ) { typedef fpa::Image::MinimumSpanningTree< _NDim > _TTree; @@ -62,13 +61,10 @@ _GD0( const std::string& fname ) } catch( itk::ExceptionObject& err ) { - return( - "MinimumSpanningTreeReader: " + std::string( err.GetDescription( ) ) - ); + this->_Error( err.GetDescription( ) ); } // yrt - this->GetOutputData( "Output" )->SetITK( reader->GetOutput( ) ); - return( "" ); + this->GetOutput( "Output" )->SetITK( reader->GetOutput( ) ); } // eof - $RCSfile$