#include <set>
#include <fpa/Base/MatrixValuesContainer.h>
#include <itkProcessObject.h>
+#include <itkPolyLineParametricPath.h>
namespace fpa
{
typedef T TMinimumSpanningTree;
typedef typename T::TVertex TVertex;
typedef typename T::TVertexCompare TVertexCompare;
- typedef std::vector< TVertex > TPath;
- typedef
- fpa::Base::MatrixValuesContainer< TVertex, TPath, TVertexCompare >
- TBranches;
+ typedef itk::PolyLineParametricPath< TVertex::Dimension > TPath;
+ typedef fpa::Base::MatrixValuesContainer< TVertex, typename TPath::Pointer, TVertexCompare > TBranches;
typedef std::set< TVertex, TVertexCompare > TEndPoints;
void fpa::Base::ExtractBranchesFromMinimumSpanningTree< T >::
GenerateData( )
{
- const T* tree = this->GetInput( );
- TBranches* branches = this->GetOutput( );
+ auto tree = this->GetInput( );
+ auto branches = this->GetOutput( );
// Find bifurcations
- TEndPoints all_points, marks;
+ TEndPoints bifurcations, marks;
auto e0It = this->m_EndPoints.begin( );
for( ; e0It != this->m_EndPoints.end( ); ++e0It )
{
- all_points.insert( *e0It );
auto e1It = e0It;
e1It++;
for( ; e1It != this->m_EndPoints.end( ); ++e1It )
{
- all_points.insert( *e0It );
auto path = tree->GetPath( *e0It, *e1It );
+ std::cout << "path" << std::endl;
auto pIt = path.begin( );
for( ; pIt != path.end( ); ++pIt )
{
- if( *pIt == *e0It || *pIt == *e1It )
- continue;
-
if( marks.find( *pIt ) == marks.end( ) )
marks.insert( *pIt );
else
- all_points.insert( *pIt );
-
+ bifurcations.insert( *pIt );
+
} // rof
} // rof
} // rof
// Construct branches
- std::cout << all_points.size( ) << std::endl;
+ std::cout << bifurcations.size( ) << std::endl;
}
#endif // __FPA__BASE__EXTRACTBRANCHESFROMMINIMUMSPANNINGTREE__HXX__