// 2. Detect end-points
this->_EndPoints( dmap, cmap, mst, ep->Get( ) );
- std::cout << "endpoints" << std::endl;
// 3. Build skeleton and keep track of bifurcations
this->_Skeleton( dmap, cmap, mst, ep->Get( ), bi->Get( ), sk );
for( ; !dIt.IsAtEnd( ) && !cIt.IsAtEnd( ); ++dIt, ++cIt )
{
double d = double( dIt.Get( ) );
- if( d > double( 0 ) )
+ if( d >= double( 0 ) )
{
+ d += double( 1e-5 );
double v = double( cIt.Get( ) ) / ( d * d );
queue.insert( _TQueueValue( v, dIt.GetIndex( ) ) );
// BFS from maximum queue
auto region = dmap->GetRequestedRegion( );
- double init_v = queue.begin( )->first;
while( queue.size( ) > 0 )
{
// Get node
auto n = *nIt;
queue.erase( nIt );
+ // Mark it and update end-points
unsigned char m = marks->GetPixel( n.second );
if( m != 0 )
continue;
-
- std::cout << queue.size( ) << std::endl;
-
- // Mark it and update end-points
- m |= 0x01;
- marks->SetPixel( n.second, m );
+ marks->SetPixel( n.second, 1 );
end_points.insert( n.second );
// Mark path
for( unsigned int d = 0; d < TMarks::ImageDimension; ++d )
{
long off = long( std::ceil( r / double( spac[ d ] ) ) );
- if( off == 0 )
- off = 1;
+ if( off < 3 )
+ off = 3;
i0[ d ] = idx[ d ] - off;
i1[ d ] = idx[ d ] + off;
TIndex w = mIt.GetIndex( );
typename _TCostMap::PointType p;
marks->TransformIndexToPhysicalPoint( w, p );
- if( cnt.EuclideanDistanceTo( p ) <= r )
- mIt.Set( mIt.Get( ) | 0x02 );
+ mIt.Set( 1 );
} // rof