X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FImage%2FDijkstraWithEndPointDetection.h;h=2158f16d3af5f8f4591c8c560d35844825120b79;hb=e832f438861464a8d521464b61be7e31c896adb8;hp=c63f4f11ecf6073d3ae7fd9bba319ce7156a9ec8;hpb=5e326afe442245572b6c3ec98ebeec8b45f9012f;p=FrontAlgorithms.git diff --git a/lib/fpa/Image/DijkstraWithEndPointDetection.h b/lib/fpa/Image/DijkstraWithEndPointDetection.h index c63f4f1..2158f16 100644 --- a/lib/fpa/Image/DijkstraWithEndPointDetection.h +++ b/lib/fpa/Image/DijkstraWithEndPointDetection.h @@ -4,6 +4,8 @@ #include #include #include +#include +#include namespace fpa { @@ -23,15 +25,17 @@ namespace fpa typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; - typedef typename Superclass::TInputImage TInputImage; - typedef typename Superclass::TOutputImage TOutputImage; - typedef typename Superclass::TVertex TVertex; - typedef typename Superclass::TVertexCompare TVertexCompare; - typedef typename Superclass::TValue TValue; - typedef typename Superclass::TResult TResult; - typedef typename Superclass::TCostFunction TCostFunction; - typedef typename Superclass::TConversionFunction TConversionFunction; - typedef typename Superclass::_TVertices TVertices; + typedef typename Superclass::TInputImage TInputImage; + typedef typename Superclass::TOutputImage TOutputImage; + typedef typename Superclass::TVertex TVertex; + typedef typename Superclass::TVertexCompare TVertexCompare; + typedef typename Superclass::TValue TValue; + typedef typename Superclass::TResult TResult; + typedef typename Superclass::TSpace TSpace; + typedef typename Superclass::TMinimumSpanningTree TMinimumSpanningTree; + typedef typename Superclass::TCostFunction TCostFunction; + typedef typename Superclass::TConversionFunction TConversionFunction; + typedef typename Superclass::_TVertices TVertices; typedef typename Superclass::TStartEvent TStartEvent; typedef typename Superclass::TStartLoopEvent TStartLoopEvent; @@ -51,9 +55,10 @@ namespace fpa typedef unsigned short TLabel; typedef itk::Image< TLabel, I::ImageDimension > TLabelImage; - typedef std::set< TVertex, TVertexCompare > TUniqueVertices; - typedef std::map< TVertex, TLabel, TVertexCompare > TBranch; - typedef std::map< TVertex, TBranch, TVertexCompare > TBranches; + typedef fpa::Base:: + UniqueValuesContainer< TVertex, TVertexCompare > TUniqueVertices; + typedef fpa::Base:: + MatrixValuesContainer< TVertex, TLabel, TVertexCompare > TBranches; protected: typedef typename Superclass::_TVertices _TVertices; @@ -74,16 +79,36 @@ namespace fpa itkNewMacro( Self ); itkTypeMacro( DijkstraWithEndPointDetection, Dijkstra ); - itkGetConstMacro( EndPoints, TUniqueVertices ); - itkGetConstMacro( BifurcationPoints, TUniqueVertices ); + itkBooleanMacro( CorrectSeeds ); + itkBooleanMacro( CorrectEndPoints ); + + itkGetConstMacro( CorrectSeeds, bool ); + itkGetConstMacro( CorrectEndPoints, bool ); + itkGetConstMacro( SafetyNeighborhoodSize, unsigned int ); + itkGetConstMacro( NumberOfBranches, unsigned long ); - itkGetConstMacro( Branches, TBranches ); + + itkSetMacro( CorrectSeeds, bool ); + itkSetMacro( CorrectEndPoints, bool ); + itkSetMacro( SafetyNeighborhoodSize, unsigned int ); public: TLabelImage* GetLabelImage( ); const TLabelImage* GetLabelImage( ) const; void GraftLabelImage( itk::DataObject* obj ); + TUniqueVertices* GetEndPoints( ); + const TUniqueVertices* GetEndPoints( ) const; + void GraftEndPoints( itk::DataObject* obj ); + + TUniqueVertices* GetBifurcations( ); + const TUniqueVertices* GetBifurcations( ) const; + void GraftBifurcations( itk::DataObject* obj ); + + TBranches* GetBranches( ); + const TBranches* GetBranches( ) const; + void GraftBranches( itk::DataObject* obj ); + protected: DijkstraWithEndPointDetection( ); virtual ~DijkstraWithEndPointDetection( ); @@ -92,6 +117,10 @@ namespace fpa virtual void _AfterGenerateData( ); virtual void _SetResult( const TVertex& v, const _TNode& n ); + void _EndPointsAndBifurcations( ); + void _FindBranches( ); + void _LabelAll( ); + _TRegion _Region( const TVertex& c, const double& r ); template< class _T > @@ -99,8 +128,6 @@ namespace fpa const _T* image, const TVertex& v, const double& r ); - void _Label( const TVertex& v, const TLabel& l ); - private: // Purposely not implemented DijkstraWithEndPointDetection( const Self& other ); @@ -108,19 +135,25 @@ namespace fpa protected: unsigned int m_LabelImageIndex; + unsigned int m_BifurcationsIndex; + unsigned int m_EndPointsIndex; + unsigned int m_BranchesIndex; + + bool m_CorrectSeeds; + bool m_CorrectEndPoints; + unsigned int m_SafetyNeighborhoodSize; - _TCandidates m_Candidates; - TUniqueVertices m_BifurcationPoints; - TUniqueVertices m_EndPoints; - unsigned long m_NumberOfBranches; - TBranches m_Branches; + _TCandidates m_Candidates; + unsigned long m_NumberOfBranches; }; } // ecapseman } // ecapseman +#ifndef ITK_MANUAL_INSTANTIATION #include +#endif // ITK_MANUAL_INSTANTIATION #endif // __FPA__IMAGE__DIJKSTRAWITHENDPOINTDETECTION__H__