// -------------------------------------------------------------------------
template< class T >
typename fpa::Base::ExtractBranchesFromMinimumSpanningTree< T >::
-TBranches* fpa::Base::ExtractBranchesFromMinimumSpanningTree< T >::
+TPath* fpa::Base::ExtractBranchesFromMinimumSpanningTree< T >::
GetOutput( )
{
return(
- itkDynamicCastInDebugMode< TBranches* >( this->GetPrimaryOutput( ) )
+ itkDynamicCastInDebugMode< TPath* >( this->GetPrimaryOutput( ) )
);
}
{
this->itk::ProcessObject::SetNumberOfRequiredInputs( 1 );
- typename TBranches::Pointer out = TBranches::New( );
+ typename TPath::Pointer out = TPath::New( );
this->itk::ProcessObject::SetNumberOfRequiredOutputs( 1 );
this->itk::ProcessObject::SetNthOutput( 0, out.GetPointer( ) );
}
GenerateData( )
{
auto tree = this->GetInput( );
- auto branches = this->GetOutput( );
+ auto path = this->GetOutput( );
+
+ // TODO: this is just a temporary code
+ auto v0 = *( this->m_EndPoints.begin( ) );
+ auto v1 = *( this->m_EndPoints.rbegin( ) );
+ auto lst = tree->GetPath( v0, v1 );
+ path->Initialize( );
+ for( auto i = lst.begin( ); i != lst.end( ); ++i )
+ path->AddVertex( *i );
// Find bifurcations
- TEndPoints bifurcations, marks;
- auto e0It = this->m_EndPoints.begin( );
- for( ; e0It != this->m_EndPoints.end( ); ++e0It )
- {
- auto e1It = e0It;
- e1It++;
- for( ; e1It != this->m_EndPoints.end( ); ++e1It )
- {
- auto path = tree->GetPath( *e0It, *e1It );
- std::cout << "path" << std::endl;
- auto pIt = path.begin( );
- for( ; pIt != path.end( ); ++pIt )
- {
- if( marks.find( *pIt ) == marks.end( ) )
- marks.insert( *pIt );
- else
- bifurcations.insert( *pIt );
-
- } // rof
-
- } // rof
-
- } // rof
-
- // Construct branches
- std::cout << bifurcations.size( ) << std::endl;
+ /* TODO: this should be the final code
+ TEndPoints bifurcations, marks;
+ auto e0It = this->m_EndPoints.begin( );
+ for( ; e0It != this->m_EndPoints.end( ); ++e0It )
+ {
+ auto e1It = e0It;
+ e1It++;
+ for( ; e1It != this->m_EndPoints.end( ); ++e1It )
+ {
+ auto path = tree->GetPath( *e0It, *e1It );
+ std::cout << "path" << std::endl;
+ auto pIt = path.begin( );
+ for( ; pIt != path.end( ); ++pIt )
+ {
+ if( marks.find( *pIt ) == marks.end( ) )
+ marks.insert( *pIt );
+ else
+ bifurcations.insert( *pIt );
+
+ } // rof
+
+ } // rof
+
+ } // rof
+
+ // Construct branches
+ std::cout << bifurcations.size( ) << std::endl;
+ */
}
#endif // __FPA__BASE__EXTRACTBRANCHESFROMMINIMUMSPANNINGTREE__HXX__