}
// -------------------------------------------------------------------------
-std::string fpaPlugins::ExtractPathFromMinimumSpanningTree::
+void fpaPlugins::ExtractPathFromMinimumSpanningTree::
_GenerateData( )
{
typedef fpa::Image::MinimumSpanningTree< 2 > _2DMST;
auto mst = this->GetInputData( "MST" )->GetITK< itk::DataObject >( );
auto mst2 = dynamic_cast< _2DMST* >( mst );
auto mst3 = dynamic_cast< _3DMST* >( mst );
- std::string r = this->_GD0( mst2 );
- if( r != "" ) r = this->_GD0( mst3 );
- return( r );
+ if ( mst2 != NULL ) this->_GD0( mst2 );
+ else if( mst3 != NULL ) this->_GD0( mst3 );
+ else this->_Error( "Invalid input MST." );
}
// -------------------------------------------------------------------------
template< class _TMST >
-std::string fpaPlugins::ExtractPathFromMinimumSpanningTree::
+void fpaPlugins::ExtractPathFromMinimumSpanningTree::
_GD0( _TMST* mst )
{
typedef fpa::Base::ExtractPathFromMinimumSpanningTree< _TMST > _TFilter;
typedef
cpExtensions::DataStructures::ImageIndexesContainer< _TMST::Dimension >
_TVertices;
- if( mst == NULL )
- return(
- "fpaPlugins::ExtractPathFromMinimumSpanningTree: No valid input tree."
- );
auto vertices = this->GetInputData( "Seeds" )->GetITK< _TVertices >( );
if( vertices == NULL )
- return(
- "fpaPlugins::ExtractPathFromMinimumSpanningTree: No valid vertices."
- );
+ this->_Error( "No valid vertices." );
if( vertices->Get( ).size( ) < 2 )
- return(
- "fpaPlugins::ExtractPathFromMinimumSpanningTree: Not enough vertices."
- );
+ this->_Error( "Not enough vertices." );
auto v0 = vertices->Get( )[ this->m_Parameters.GetUint( "Vertex0" ) ];
auto v1 = vertices->Get( )[ this->m_Parameters.GetUint( "Vertex1" ) ];
// Connect output and finish
this->GetOutputData( "Output" )->SetITK( filter->GetOutput( ) );
- return( "" );
}
// eof - $RCSfile$