} // fi
+ std::cout << int( this->GetInput( )->GetPixel( this->m_Seed ) ) << std::endl;
+ std::cout << this->m_DistanceMap->GetOutput( )->GetPixel( this->m_Seed ) << std::endl;
+
// Compute MST
typename _TDijkstra::Pointer dijkstra = _TDijkstra::New( );
dijkstra->SetInput( this->m_DistanceMap->GetOutput( ) );
this->m_EndPoints = end_points;
// Compute symbolic branches
- typedef std::map< TIndex, TIndex, typename TIndex::LexicographicCompare > _TTags;
- _TTags tags, branches;
- typename std::vector< TIndex >::const_iterator eIt = end_points.begin( );
- for( ; eIt != end_points.end( ); ++eIt )
- {
- // Tag path
- TIndex it = *eIt;
- TIndex p = mst->GetParent( it );
- typename _TTags::iterator bIt = tags.end( );
- while( it != p && bIt == tags.end( ) )
- {
- typename _TTags::iterator tIt = tags.find( it );
- if( tIt != tags.end( ) )
- {
- // Ok, a bifurcation point has been found
- // branch1: tIt->second <-> it (ok)
- branches[ tIt->second ] = it;
-
- // branch2: *eit <-> it (ok)
- branches[ *eIt ] = it;
-
- // branch3: it <-> until next bifurcation
- bIt = tIt;
- }
- else
- tags[ it ] = *eIt;
- it = p;
- p = mst->GetParent( it );
-
- } // elihw
- if( bIt != tags.end( ) )
- {
- TIndex pTag = bIt->second;
- TIndex nTag = bIt->first;
- it = bIt->first;
- p = it;
- while( tags[ it ] == pTag )
- {
- tags[ it ] = nTag;
- p = it;
- it = mst->GetParent( it );
-
- } // elihw
- tags[ it ] = nTag;
- branches[ bIt->first ] = p;
- }
- else
- {
- tags[ it ] = *eIt;
- branches[ *eIt ] = it;
-
- } // fi
-
- } // rof
-
- // Fill full branches
- typedef typename _TMST::TVertices _TVertices;
- typedef typename TSkeleton::TPath _TPath;
-
- TSkeleton* sk = this->GetOutput( );
- typename _TTags::const_iterator bIt = branches.begin( );
- for( ; bIt != branches.end( ); ++bIt )
- {
- _TVertices v = mst->GetAxis( bIt->first, bIt->second );
- typename _TPath::Pointer path = _TPath::New( );
- path->SetReferenceImage( this->GetInput( ) );
- typename _TVertices::const_reverse_iterator vIt = v.rbegin( );
- for( ; vIt != v.rend( ); ++vIt )
- path->AddVertex( *vIt );
- sk->AddBranch( path );
-
- } // rof
+ /* TODO
+ typedef std::map< TIndex, TIndex, typename TIndex::LexicographicCompare > _TTags;
+ _TTags tags, branches;
+ typename std::vector< TIndex >::const_iterator eIt = end_points.begin( );
+ for( ; eIt != end_points.end( ); ++eIt )
+ {
+ // Tag path
+ TIndex it = *eIt;
+ TIndex p = mst->GetParent( it );
+ typename _TTags::iterator bIt = tags.end( );
+ while( it != p && bIt == tags.end( ) )
+ {
+ typename _TTags::iterator tIt = tags.find( it );
+ if( tIt != tags.end( ) )
+ {
+ // Ok, a bifurcation point has been found
+ // branch1: tIt->second <-> it (ok)
+ branches[ tIt->second ] = it;
+
+ // branch2: *eit <-> it (ok)
+ branches[ *eIt ] = it;
+
+ // branch3: it <-> until next bifurcation
+ bIt = tIt;
+ }
+ else
+ tags[ it ] = *eIt;
+ it = p;
+ p = mst->GetParent( it );
+
+ } // elihw
+ if( bIt != tags.end( ) )
+ {
+ TIndex pTag = bIt->second;
+ TIndex nTag = bIt->first;
+ it = bIt->first;
+ p = it;
+ while( tags[ it ] == pTag )
+ {
+ tags[ it ] = nTag;
+ p = it;
+ it = mst->GetParent( it );
+
+ } // elihw
+ tags[ it ] = nTag;
+ branches[ bIt->first ] = p;
+ }
+ else
+ {
+ tags[ it ] = *eIt;
+ branches[ *eIt ] = it;
+
+ } // fi
+
+ } // rof
+
+ // Fill full branches
+ typedef typename _TMST::TVertices _TVertices;
+ typedef typename TSkeleton::TPath _TPath;
+
+ TSkeleton* sk = this->GetOutput( );
+ typename _TTags::const_iterator bIt = branches.begin( );
+ for( ; bIt != branches.end( ); ++bIt )
+ {
+ _TVertices v = mst->GetAxis( bIt->first, bIt->second );
+ typename _TPath::Pointer path = _TPath::New( );
+ path->SetReferenceImage( this->GetInput( ) );
+ typename _TVertices::const_reverse_iterator vIt = v.rbegin( );
+ for( ; vIt != v.rend( ); ++vIt )
+ path->AddVertex( *vIt );
+ sk->AddBranch( path );
+
+ } // rof
+ */
}
// -------------------------------------------------------------------------