this->Superclass::_AfterMainLoop( );
this->m_FinalTree.clear( );
this->m_EndPoints.clear( );
this->Superclass::_AfterMainLoop( );
this->m_FinalTree.clear( );
this->m_EndPoints.clear( );
const I* input = this->GetInput( );
typename I::SpacingType spac = input->GetSpacing( );
double max_spac = spac[ 0 ];
const I* input = this->GetInput( );
typename I::SpacingType spac = input->GetSpacing( );
double max_spac = spac[ 0 ];
this->m_EndPoints.push_back( max_vertex );
// Construct path (at least the part that hasn't been iterated)
this->m_EndPoints.push_back( max_vertex );
// Construct path (at least the part that hasn't been iterated)
// Next vertex in current path
this->InvokeEvent( TBacktrackingEvent( max_vertex, backId ) );
this->m_FinalTree[ max_vertex ] = this->_Parent( max_vertex );
// Next vertex in current path
this->InvokeEvent( TBacktrackingEvent( max_vertex, backId ) );
this->m_FinalTree[ max_vertex ] = this->_Parent( max_vertex );
- } while( max_vertex != this->_Parent( max_vertex ) );
- this->m_FinalTree[ max_vertex ] = max_vertex;
- this->InvokeEvent( TEndBacktrackingEvent( backId ) );
+ } while( max_vertex != this->_Parent( max_vertex ) && !terminate );
+
+ if( !terminate )
+ {
+ this->m_FinalTree[ max_vertex ] = max_vertex;
+ this->InvokeEvent( TEndBacktrackingEvent( backId ) );
+
+ } // fi