]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Image/ExtractAxisFilter.h
01efc75a66e163fd80662365813847c850b0e423
[FrontAlgorithms.git] / lib / fpa / Image / ExtractAxisFilter.h
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5
6 #ifndef __fpa__Image__ExtractAxisFilter__h__
7 #define __fpa__Image__ExtractAxisFilter__h__
8
9 #include <itkProcessObject.h>
10 #include <itkSignedMaurerDistanceMapImageFilter.h>
11
12 #include <fpa/Image/Dijkstra.h>
13 #include <fpa/Image/PolyLineParametricPath.h>
14
15 namespace fpa
16 {
17   namespace Image
18   {
19     /**
20      */
21     template< class _TInputImage, class _TScalar, class _TCenterness = itk::SignedMaurerDistanceMapImageFilter< _TInputImage, itk::Image< _TScalar, _TInputImage::ImageDimension > > >
22     class ExtractAxisFilter
23       : public itk::ProcessObject
24     {
25     public:
26       typedef ExtractAxisFilter               Self;
27       typedef itk::ProcessObject              Superclass;
28       typedef itk::SmartPointer< Self >       Pointer;
29       typedef itk::SmartPointer< const Self > ConstPointer;
30
31       typedef _TInputImage TInputImage;
32       typedef _TScalar     TScalar;
33       typedef _TCenterness TCenterness;
34       itkStaticConstMacro(
35         Dimension,
36         unsigned int,
37         TInputImage::ImageDimension
38         );
39
40       typedef typename TCenterness::OutputImageType TOutputImage;
41       typedef typename TInputImage::IndexType       TIndex;
42       typedef typename TInputImage::PointType       TPoint;
43
44       typedef fpa::Image::PolyLineParametricPath< Self::Dimension > TPath;
45       typedef fpa::Image::Dijkstra< TOutputImage, TOutputImage > TDijkstra;
46
47     public:
48       itkNewMacro( Self );
49       itkTypeMacro( fpa::Image::ExtractAxisFilter, fpa::Image::Dijkstra );
50
51       itkGetConstObjectMacro( Centerness, TCenterness );
52       itkGetObjectMacro( Centerness, TCenterness );
53
54       itkGetConstMacro( StartIndex, TIndex );
55       itkGetConstMacro( EndIndex, TIndex );
56
57       itkSetMacro( StartIndex, TIndex );
58       itkSetMacro( EndIndex, TIndex );
59
60     public:
61       virtual itk::ModifiedTimeType GetMTime( ) const override;
62
63       virtual void AddSeed( const TIndex& seed );
64       virtual void AddSeed( const TPoint& seed );
65       virtual void ClearSeeds( );
66
67       void SetInput( TInputImage* input );
68       TInputImage* GetInput( );
69       const TInputImage* GetInput( ) const;
70
71       TPath* GetOutput( );
72       const TPath* GetOutput( ) const;
73
74     protected:
75       ExtractAxisFilter( );
76       virtual ~ExtractAxisFilter( );
77
78       virtual void GenerateData( ) override;
79
80     private:
81       // Purposely not implemented.
82       ExtractAxisFilter( const Self& other );
83       Self& operator=( const Self& other );
84
85     protected:
86       typename TCenterness::Pointer m_Centerness;
87       typename TDijkstra::Pointer m_Dijkstra;
88
89       TIndex m_StartIndex;
90       TIndex m_EndIndex;
91     };
92
93   } // ecapseman
94
95 } // ecapseman
96
97 #ifndef ITK_MANUAL_INSTANTIATION
98 #  include <fpa/Image/ExtractAxisFilter.hxx>
99 #endif // ITK_MANUAL_INSTANTIATION
100
101 #endif // __fpa__Image__ExtractAxisFilter__h__
102
103 // eof - $RCSfile$