1 #ifndef __FPA__IMAGE__DIJKSTRAWITHENDPOINTDETECTION__H__
2 #define __FPA__IMAGE__DIJKSTRAWITHENDPOINTDETECTION__H__
6 #include <fpa/Image/Dijkstra.h>
13 * @param I Input image type
14 * @param O Output image type
16 template< class I, class O >
17 class DijkstraWithEndPointDetection
18 : public Dijkstra< I, O >
21 typedef DijkstraWithEndPointDetection Self;
22 typedef Dijkstra< I, O > Superclass;
23 typedef itk::SmartPointer< Self > Pointer;
24 typedef itk::SmartPointer< const Self > ConstPointer;
26 typedef typename Superclass::TInputImage TInputImage;
27 typedef typename Superclass::TOutputImage TOutputImage;
28 typedef typename Superclass::TVertex TVertex;
29 typedef typename Superclass::TVertexCompare TVertexCompare;
30 typedef typename Superclass::TValue TValue;
31 typedef typename Superclass::TResult TResult;
32 typedef typename Superclass::TCostFunction TCostFunction;
33 typedef typename Superclass::TConversionFunction TConversionFunction;
34 typedef typename Superclass::_TVertices TVertices;
36 typedef typename Superclass::TStartEvent TStartEvent;
37 typedef typename Superclass::TStartLoopEvent TStartLoopEvent;
38 typedef typename Superclass::TEndEvent TEndEvent;
39 typedef typename Superclass::TEndLoopEvent TEndLoopEvent;
40 typedef typename Superclass::TAliveEvent TAliveEvent;
41 typedef typename Superclass::TFrontEvent TFrontEvent;
42 typedef typename Superclass::TFreezeEvent TFreezeEvent;
45 Superclass::TStartBacktrackingEvent TStartBacktrackingEvent;
47 Superclass::TEndBacktrackingEvent TEndBacktrackingEvent;
49 Superclass::TBacktrackingEvent TBacktrackingEvent;
51 typedef unsigned short TLabel;
52 typedef itk::Image< TLabel, I::ImageDimension > TLabelImage;
54 typedef std::set< TVertex, TVertexCompare > TUniqueVertices;
55 typedef std::map< TVertex, TLabel, TVertexCompare > TBranch;
56 typedef std::map< TVertex, TBranch, TVertexCompare > TBranches;
59 typedef typename Superclass::_TVertices _TVertices;
60 typedef typename Superclass::_TCollision _TCollision;
61 typedef typename Superclass::_TCollisionsRow _TCollisionsRow;
62 typedef typename Superclass::_TCollisions _TCollisions;
63 typedef typename Superclass::_TNode _TNode;
64 typedef typename Superclass::_TNodes _TNodes;
66 typedef typename I::PixelType _TPixel;
67 typedef typename I::RegionType _TRegion;
68 typedef typename I::SizeType _TSize;
70 typedef std::pair< TResult, TVertex > _TCandidate;
71 typedef std::multimap< TResult, TVertex > _TCandidates;
75 itkTypeMacro( DijkstraWithEndPointDetection, Dijkstra );
77 itkGetConstMacro( EndPoints, TUniqueVertices );
78 itkGetConstMacro( BifurcationPoints, TUniqueVertices );
79 itkGetConstMacro( NumberOfBranches, unsigned long );
80 itkGetConstMacro( Branches, TBranches );
83 TLabelImage* GetLabelImage( );
84 const TLabelImage* GetLabelImage( ) const;
85 void GraftLabelImage( itk::DataObject* obj );
88 DijkstraWithEndPointDetection( );
89 virtual ~DijkstraWithEndPointDetection( );
91 virtual void _BeforeGenerateData( );
92 virtual void _AfterGenerateData( );
93 virtual void _SetResult( const TVertex& v, const _TNode& n );
95 _TRegion _Region( const TVertex& c, const double& r );
99 const _T* image, const TVertex& v, const double& r
102 void _Label( const TVertex& v, const TLabel& l );
105 // Purposely not implemented
106 DijkstraWithEndPointDetection( const Self& other );
107 Self& operator=( const Self& other );
110 unsigned int m_LabelImageIndex;
112 _TCandidates m_Candidates;
113 TUniqueVertices m_BifurcationPoints;
114 TUniqueVertices m_EndPoints;
115 unsigned long m_NumberOfBranches;
116 TBranches m_Branches;
123 #include <fpa/Image/DijkstraWithEndPointDetection.hxx>
125 #endif // __FPA__IMAGE__DIJKSTRAWITHENDPOINTDETECTION__H__