]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Image/ExtractAxisFilter.h
5c659160eefacf58f800043b990a1327b9d9f6d1
[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 <itkImageToImageFilter.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 >
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 typename TInputImage::IndexType TIndex;
34       typedef typename TInputImage::PointType TPoint;
35
36       itkStaticConstMacro(
37         Dimension,
38         unsigned int,
39         TInputImage::ImageDimension
40         );
41
42       typedef itk::Image< TScalar, Self::Dimension > TScalarImage;
43       typedef itk::ImageToImageFilter< TInputImage, TScalarImage > TCenterness;
44
45       typedef fpa::Image::PolyLineParametricPath< Self::Dimension > TPath;
46       typedef fpa::Image::Dijkstra< TScalarImage, TScalarImage > TDijkstra;
47
48     public:
49       itkNewMacro( Self );
50       itkTypeMacro( fpa::Image::ExtractAxisFilter, fpa::Image::Dijkstra );
51
52       itkGetConstObjectMacro( Centerness, TCenterness );
53       itkGetObjectMacro( Centerness, TCenterness );
54       itkSetObjectMacro( Centerness, TCenterness );
55
56       itkGetConstMacro( StartIndex, TIndex );
57       itkSetMacro( StartIndex, TIndex );
58
59       itkGetConstMacro( EndIndex, TIndex );
60       itkSetMacro( EndIndex, TIndex );
61
62     public:
63       virtual itk::ModifiedTimeType GetMTime( ) const override;
64
65       virtual void AddSeed( const TIndex& seed );
66       virtual void AddSeed( const TPoint& seed );
67       virtual void ClearSeeds( );
68
69       void SetInput( TInputImage* input );
70       TInputImage* GetInput( );
71       const TInputImage* GetInput( ) const;
72
73       TPath* GetOutput( );
74       const TPath* GetOutput( ) const;
75
76     protected:
77       ExtractAxisFilter( );
78       virtual ~ExtractAxisFilter( );
79
80       virtual void GenerateData( ) override;
81
82     private:
83       // Purposely not implemented.
84       ExtractAxisFilter( const Self& other );
85       Self& operator=( const Self& other );
86
87     protected:
88       typename TCenterness::Pointer m_Centerness;
89       typename TDijkstra::Pointer   m_Dijkstra;
90
91       TIndex m_StartIndex;
92       TIndex m_EndIndex;
93     };
94
95   } // ecapseman
96
97 } // ecapseman
98
99 #ifndef ITK_MANUAL_INSTANTIATION
100 #  include <fpa/Image/ExtractAxisFilter.hxx>
101 #endif // ITK_MANUAL_INSTANTIATION
102
103 #endif // __fpa__Image__ExtractAxisFilter__h__
104
105 // eof - $RCSfile$