]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Image/EndPointsFilter.h
afbfb10cc79efb19d7e3108a438d72d9021a880e
[FrontAlgorithms.git] / lib / fpa / Image / EndPointsFilter.h
1 #ifndef __fpa__Image__EndPointsFilter__h__
2 #define __fpa__Image__EndPointsFilter__h__
3
4 #include <fpa/Image/MinimumSpanningTree.h>
5 #include <set>
6
7 namespace fpa
8 {
9   namespace Image
10   {
11     /**
12      */
13     template< class _TDistanceMap, class _TCostMap >
14     class EndPointsFilter
15       : public itk::Object
16     {
17     public:
18       typedef EndPointsFilter                 Self;
19       typedef itk::Object                     Superclass;
20       typedef itk::SmartPointer< Self >       Pointer;
21       typedef itk::SmartPointer< const Self > ConstPointer;
22
23       typedef _TDistanceMap TDistanceMap;
24       typedef _TCostMap     TCostMap;
25       typedef typename TCostMap::IndexType TIndex;
26       typedef MinimumSpanningTree< TCostMap::ImageDimension > TMST;
27       
28       typedef itk::Functor::IndexLexicographicCompare< _TCostMap::ImageDimension > TIndexCompare;
29       typedef std::set< TIndex, TIndexCompare > TIndices;
30
31     public:
32       itkNewMacro( Self );
33       itkTypeMacro( fpa::Image::EndPointsFilter, itk::Object );
34
35       itkGetConstObjectMacro( DistanceMap, _TDistanceMap );
36       itkGetConstObjectMacro( CostMap, _TCostMap );
37       itkGetConstObjectMacro( MST, TMST );
38
39       itkSetConstObjectMacro( DistanceMap, _TDistanceMap );
40       itkSetConstObjectMacro( CostMap, _TCostMap );
41       itkSetConstObjectMacro( MST, TMST );
42
43     public:
44       const TIndices& GetBifurcations( ) const;
45       const TIndices& GetEndPoints( ) const;
46
47       void Compute( );
48
49     protected:
50       EndPointsFilter( );
51       virtual ~EndPointsFilter( );
52
53     private:
54       // Purposely not defined
55       EndPointsFilter( const Self& other );
56       Self& operator=( const Self& other );
57
58     protected:
59       typename _TDistanceMap::ConstPointer m_DistanceMap;
60       typename _TCostMap::ConstPointer m_CostMap;
61       typename TMST::ConstPointer m_MST;
62
63       TIndices m_Bifurcations;
64       TIndices m_EndPoints;
65     };
66
67   } // ecapseman
68
69 } // ecapseman
70
71 #ifndef ITK_MANUAL_INSTANTIATION
72 #  include <fpa/Image/EndPointsFilter.hxx>
73 #endif // ITK_MANUAL_INSTANTIATION
74
75 #endif // __fpa__Image__EndPointsFilter__h__
76
77 // eof - $RCSfile$