typedef Superclass::InputImageType TImage;
typedef std::deque< TVertex > TVertices;
+ typedef Superclass::TEndEvent TEndEvent;
+ typedef Superclass::TBacktrackingEvent TBacktrackingEvent;
+
protected:
typedef std::pair< TCost, TVertex > _TCandidate;
typedef std::multimap< TCost, TVertex > _TCandidates;
if( this->m_Candidates.size( ) == 0 )
return;
+ this->InvokeEvent( TEndEvent( ) );
+
const TImage* input = this->GetInput( );
TImage::SpacingType spacing = input->GetSpacing( );
// are near thin branches
_TCandidates::const_reverse_iterator cIt =
this->m_Candidates.rbegin( );
- for( int leo = 0; leo < 1 && cIt != this->m_Candidates.rend( ); ++cIt )
+ for( int backId = 0; backId < 100 && cIt != this->m_Candidates.rend( ); ++cIt )
{
// If pixel hasn't been visited, continue
TVertex v = cIt->second;
if( marks->GetPixel( max_vertex ) != _TMark( 0 ) )
continue;
- leo++;
- std::cout << "Leaf: " << leo << " " << max_value << " " << max_vertex << std::endl;
+ backId++;
+ std::cout << "Leaf: " << backId << " " << max_value << " " << max_vertex << std::endl;
bool start = true;
do
start = false;
*/
// Next vertex in current path
+ this->InvokeEvent( TBacktrackingEvent( max_vertex, backId ) );
max_vertex = this->_Parent( max_vertex );
} while( max_vertex != this->_Parent( max_vertex ) );
} // rof
*/
- itk::ImageFileWriter< _TMarkImage >::Pointer w =
- itk::ImageFileWriter< _TMarkImage >::New( );
- w->SetInput( marks );
- w->SetFileName( "marks.mhd" );
- w->Update( );
-
/*
-
+ itk::ImageFileWriter< _TMarkImage >::Pointer w =
+ itk::ImageFileWriter< _TMarkImage >::New( );
+ w->SetInput( marks );
+ w->SetFileName( "marks.mhd" );
+ w->Update( );
+
+
this->m_Axes = vtkSmartPointer< vtkPolyData >::New( );
vtkSmartPointer< vtkPoints > points =
vtkSmartPointer< vtkPoints >::New( );
{
- leo++;
- std::cout << "Leaf: " << leo << " " << cIt->first << " " << vIt << std::endl;
+ backId++;
+ std::cout << "Leaf: " << backId << " " << cIt->first << " " << vIt << std::endl;
bool start = true;
do
{