- } while( max_vertex != this->_Parent( max_vertex ) && !terminate );
-
- if( !terminate )
- {
- this->m_FinalTree[ max_vertex ] = max_vertex;
- this->InvokeEvent( TEndBacktrackingEvent( backId ) );
-
- } // fi
+ } while( max_vertex != this->_Parent( max_vertex ) );
+
+ /* TODO
+ bool terminate = false;
+ do
+ {
+ if( this->m_FinalTree.find( max_vertex ) == this->m_FinalTree.end( ) )
+ {
+ // Mark a sphere around current point as visited
+ double dist = std::sqrt( double( input->GetPixel( max_vertex ) ) );
+ region = this->_Region( max_vertex, dist * double( 1.25 ) );
+ itk::ImageRegionIteratorWithIndex< TMarkImage >
+ mIt( marks, region );
+ for( mIt.GoToBegin( ); !mIt.IsAtEnd( ); ++mIt )
+ mIt.Set( true );
+
+ // Next vertex in current path
+ this->InvokeEvent( TBacktrackingEvent( max_vertex, this->m_NumberOfBranches ) );
+ this->m_FinalTree[ max_vertex ] = this->_Parent( max_vertex );
+ }
+ else
+ {
+ // A bifurcation point has been reached!
+ this->m_BifurcationPoints.push_back( max_vertex );
+ terminate = true;
+
+ } // fi
+ max_vertex = this->_Parent( max_vertex );
+
+ } while( max_vertex != this->_Parent( max_vertex ) && !terminate );
+
+ if( !terminate )
+ {
+ this->m_FinalTree[ max_vertex ] = max_vertex;
+ this->InvokeEvent( TEndBacktrackingEvent( this->m_NumberOfBranches ) );
+
+ } // fi
+ */