for( unsigned int d = 1; d < I::ImageDimension; ++d )
max_spac =
( max_spac < double( spac[ d ] ) )? double( spac[ d ] ): max_spac;
- max_spac *= double( 3 );
+ max_spac *= double( 30 );
// Correct seeds
for( unsigned int s = 0; s < this->m_Seeds.size( ); ++s )
{
// Finish base algorithm
this->Superclass::_AfterMainLoop( );
- this->m_FinalTree.clear( );
+ this->m_FullTree.clear( );
+ this->m_ReducedTree.clear( );
this->m_EndPoints.clear( );
this->m_BifurcationPoints.clear( );
if( this->m_Candidates.size( ) == 0 )
{
if( start )
{
- if( this->m_FinalTree.find( max_vertex ) == this->m_FinalTree.end( ) )
+ if( this->m_FullTree.find( max_vertex ) == this->m_FullTree.end( ) )
{
// Mark a sphere around current point as visited
double dist = std::sqrt( double( input->GetPixel( max_vertex ) ) );
// Next vertex in current path
this->InvokeEvent( TBacktrackingEvent( max_vertex, this->m_NumberOfBranches ) );
- this->m_FinalTree[ max_vertex ] =
+ this->m_FullTree[ max_vertex ] =
TTreeNode( this->_Parent( max_vertex ), this->m_NumberOfBranches );
// std::cout << "New: " << this->m_NumberOfBranches << std::endl;
}
this->m_BifurcationPoints.push_back( max_vertex );
this->m_NumberOfBranches++;
- this->m_FinalTree[ max_vertex ] =
+ this->m_FullTree[ max_vertex ] =
TTreeNode( this->_Parent( max_vertex ), this->m_NumberOfBranches );
// std::cout << "Bifurcation: " << this->m_NumberOfBranches << std::endl;
// Next vertex in current path
this->InvokeEvent( TBacktrackingEvent( max_vertex, this->m_NumberOfBranches ) );
- this->m_FinalTree[ max_vertex ] =
+ this->m_FullTree[ max_vertex ] =
TTreeNode( this->_Parent( max_vertex ), this->m_NumberOfBranches );
change = true;
// std::cout << "Change: " << this->m_NumberOfBranches << std::endl;
// A bifurcation point has been reached!
// TODO: this->m_BifurcationPoints.push_back( max_vertex );
this->m_NumberOfBranches++;
- this->m_FinalTree[ max_vertex ] =
+ this->m_FullTree[ max_vertex ] =
TTreeNode( this->_Parent( max_vertex ), this->m_NumberOfBranches );
// std::cout << "Change bifurcation: " << this->m_NumberOfBranches << std::endl;
} while( max_vertex != this->_Parent( max_vertex ) );
if( start || change )
this->m_NumberOfBranches++;
+ this->m_FullTree[ max_vertex ] = TTreeNode( max_vertex, this->m_NumberOfBranches );
this->InvokeEvent( TEndBacktrackingEvent( ) );
std::map< TMark, unsigned long > histo;
for(
- typename TTree::iterator treeIt = this->m_FinalTree.begin( );
- treeIt != this->m_FinalTree.end( );
+ typename TTree::iterator treeIt = this->m_FullTree.begin( );
+ treeIt != this->m_FullTree.end( );
++treeIt
)
histo[ treeIt->second.second ]++;
this->m_NumberOfBranches = changes.size( );
for(
- typename TTree::iterator treeIt = this->m_FinalTree.begin( );
- treeIt != this->m_FinalTree.end( );
+ typename TTree::iterator treeIt = this->m_FullTree.begin( );
+ treeIt != this->m_FullTree.end( );
++treeIt
)
{
} // fi
+ // Construct reduced tree
+ for(
+ typename TVertices::const_iterator eIt = this->m_EndPoints.begin( );
+ eIt != this->m_EndPoints.end( );
+ ++eIt
+ )
+ {
+ typename TTree::const_iterator tIt = this->m_FullTree.find( *eIt );
+ if( tIt != this->m_FullTree.end( ) )
+ {
+ TMark id = tIt->second.second;
+ do
+ {
+ tIt = this->m_FullTree.find( tIt->second.first );
+ if( tIt == this->m_FullTree.end( ) )
+ break;
+
+ } while( tIt->second.second == id );
+ this->m_ReducedTree[ *eIt ] = TTreeNode( tIt->first, id );
+
+ } // fi
+
+ } // rof
+
+ for(
+ typename TVertices::const_iterator bIt = this->m_BifurcationPoints.begin( );
+ bIt != this->m_BifurcationPoints.end( );
+ ++bIt
+ )
+ {
+ typename TTree::const_iterator tIt = this->m_FullTree.find( *bIt );
+ if( tIt != this->m_FullTree.end( ) )
+ {
+ TMark id = tIt->second.second;
+ do
+ {
+ tIt = this->m_FullTree.find( tIt->second.first );
+ if( tIt == this->m_FullTree.end( ) )
+ break;
+
+ } while( tIt->second.second == id );
+ this->m_ReducedTree[ *bIt ] = TTreeNode( tIt->first, id );
+
+ } // fi
+
+ } // rof
}
// -------------------------------------------------------------------------