1 #ifndef __FPA__IMAGE__DIJKSTRAWITHENDPOINTDETECTION__H__
2 #define __FPA__IMAGE__DIJKSTRAWITHENDPOINTDETECTION__H__
6 #include <fpa/Image/Dijkstra.h>
7 #include <fpa/Base/MatrixValuesContainer.h>
8 #include <fpa/Base/UniqueValuesContainer.h>
15 * @param I Input image type
16 * @param O Output image type
18 template< class I, class O >
19 class DijkstraWithEndPointDetection
20 : public Dijkstra< I, O >
23 typedef DijkstraWithEndPointDetection Self;
24 typedef Dijkstra< I, O > Superclass;
25 typedef itk::SmartPointer< Self > Pointer;
26 typedef itk::SmartPointer< const Self > ConstPointer;
28 typedef typename Superclass::TInputImage TInputImage;
29 typedef typename Superclass::TOutputImage TOutputImage;
30 typedef typename Superclass::TVertex TVertex;
31 typedef typename Superclass::TVertexCompare TVertexCompare;
32 typedef typename Superclass::TValue TValue;
33 typedef typename Superclass::TResult TResult;
34 typedef typename Superclass::TMinimumSpanningTree TMinimumSpanningTree;
35 typedef typename Superclass::TCostFunction TCostFunction;
36 typedef typename Superclass::TConversionFunction TConversionFunction;
37 typedef typename Superclass::_TVertices TVertices;
39 typedef typename Superclass::TStartEvent TStartEvent;
40 typedef typename Superclass::TStartLoopEvent TStartLoopEvent;
41 typedef typename Superclass::TEndEvent TEndEvent;
42 typedef typename Superclass::TEndLoopEvent TEndLoopEvent;
43 typedef typename Superclass::TAliveEvent TAliveEvent;
44 typedef typename Superclass::TFrontEvent TFrontEvent;
45 typedef typename Superclass::TFreezeEvent TFreezeEvent;
48 Superclass::TStartBacktrackingEvent TStartBacktrackingEvent;
50 Superclass::TEndBacktrackingEvent TEndBacktrackingEvent;
52 Superclass::TBacktrackingEvent TBacktrackingEvent;
54 typedef unsigned short TLabel;
55 typedef itk::Image< TLabel, I::ImageDimension > TLabelImage;
57 typedef fpa::Base::UniqueValuesContainer< TVertex, TVertexCompare > TUniqueVertices;
58 typedef fpa::Base::MatrixValuesContainer< TVertex, TLabel, TVertexCompare > TBranches;
61 typedef typename Superclass::_TVertices _TVertices;
62 typedef typename Superclass::_TCollision _TCollision;
63 typedef typename Superclass::_TCollisionsRow _TCollisionsRow;
64 typedef typename Superclass::_TCollisions _TCollisions;
65 typedef typename Superclass::_TNode _TNode;
66 typedef typename Superclass::_TNodes _TNodes;
68 typedef typename I::PixelType _TPixel;
69 typedef typename I::RegionType _TRegion;
70 typedef typename I::SizeType _TSize;
72 typedef std::pair< TResult, TVertex > _TCandidate;
73 typedef std::multimap< TResult, TVertex > _TCandidates;
77 itkTypeMacro( DijkstraWithEndPointDetection, Dijkstra );
79 itkGetConstMacro( NumberOfBranches, unsigned long );
82 TLabelImage* GetLabelImage( );
83 const TLabelImage* GetLabelImage( ) const;
84 void GraftLabelImage( itk::DataObject* obj );
86 TUniqueVertices* GetEndPoints( );
87 const TUniqueVertices* GetEndPoints( ) const;
88 void GraftEndPoints( itk::DataObject* obj );
90 TUniqueVertices* GetBifurcations( );
91 const TUniqueVertices* GetBifurcations( ) const;
92 void GraftBifurcations( itk::DataObject* obj );
94 TBranches* GetBranches( );
95 const TBranches* GetBranches( ) const;
96 void GraftBranches( itk::DataObject* obj );
99 DijkstraWithEndPointDetection( );
100 virtual ~DijkstraWithEndPointDetection( );
102 virtual void _BeforeGenerateData( );
103 virtual void _AfterGenerateData( );
104 virtual void _SetResult( const TVertex& v, const _TNode& n );
106 void _EndPointsAndBifurcations( );
107 void _FindBranches( );
110 _TRegion _Region( const TVertex& c, const double& r );
113 TVertex _MaxInRegion(
114 const _T* image, const TVertex& v, const double& r
118 // Purposely not implemented
119 DijkstraWithEndPointDetection( const Self& other );
120 Self& operator=( const Self& other );
123 unsigned int m_LabelImageIndex;
124 unsigned int m_BifurcationsIndex;
125 unsigned int m_EndPointsIndex;
126 unsigned int m_BranchesIndex;
128 _TCandidates m_Candidates;
129 unsigned long m_NumberOfBranches;
136 #include <fpa/Image/DijkstraWithEndPointDetection.hxx>
138 #endif // __FPA__IMAGE__DIJKSTRAWITHENDPOINTDETECTION__H__