X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FImage%2FSkeleton.hxx;fp=lib%2Ffpa%2FImage%2FSkeleton.hxx;h=0000000000000000000000000000000000000000;hb=3c639e5da479c7216a0a302ffa156ac6762caeed;hp=57a418441cd9505fb0cf45bf1752eb80cda27040;hpb=5bf766068f54d061d3816f4950a076c3cf3a4d8b;p=FrontAlgorithms.git diff --git a/lib/fpa/Image/Skeleton.hxx b/lib/fpa/Image/Skeleton.hxx deleted file mode 100644 index 57a4184..0000000 --- a/lib/fpa/Image/Skeleton.hxx +++ /dev/null @@ -1,99 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= - -#ifndef __fpa__Image__Skeleton__hxx__ -#define __fpa__Image__Skeleton__hxx__ - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -void fpa::Image::Skeleton< _VDim >:: -AddBranch( TPath* path ) -{ - // Check inputs - if( path == NULL ) - return; - unsigned long size = path->GetSize( ); - if( size == 0 ) - return; - TIndex a = path->GetVertex( 0 ); - TIndex b = path->GetVertex( size - 1 ); - if( this->HasEdge( a, b ) ) - return; - - // Add path - this->SetVertex( a, a ); - this->SetVertex( b, b ); - this->AddEdge( a, b, path ); - this->AddEdge( b, a, path ); - this->Modified( ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -const typename fpa::Image::Skeleton< _VDim >:: -TPath* fpa::Image::Skeleton< _VDim >:: -GetBranch( const TIndex& a, const TIndex& b ) const -{ - static const TPath* null_path = NULL; - if( this->HasEdge( a, b ) ) - return( this->GetEdges( a, b ).front( ) ); - else - return( null_path ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -std::vector< typename fpa::Image::Skeleton< _VDim >::TIndex > -fpa::Image::Skeleton< _VDim >:: -GetEndPoints( ) const -{ - std::vector< TIndex > res; - typename Superclass::TMatrix::const_iterator mIt = this->BeginEdgesRows( ); - for( ; mIt != this->EndEdgesRows( ); ++mIt ) - { - unsigned long count = mIt->second.size( ); - if( count == 1 ) - res.push_back( mIt->first ); - - } // rof - return( res ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -std::vector< typename fpa::Image::Skeleton< _VDim >::TIndex > -fpa::Image::Skeleton< _VDim >:: -GetBifurcations( ) const -{ - std::vector< TIndex > res; - typename Superclass::TMatrix::const_iterator mIt = this->BeginEdgesRows( ); - for( ; mIt != this->EndEdgesRows( ); ++mIt ) - { - unsigned long count = mIt->second.size( ); - if( count > 1 ) - res.push_back( mIt->first ); - - } // rof - return( res ); -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -fpa::Image::Skeleton< _VDim >:: -Skeleton( ) - : Superclass( ) -{ -} - -// ------------------------------------------------------------------------- -template< unsigned int _VDim > -fpa::Image::Skeleton< _VDim >:: -~Skeleton( ) -{ -} - -#endif // __fpa__Image__Skeleton__hxx__ - -// eof - $RCSfile$