]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Filters/Image/ExtractAxis.h
...
[FrontAlgorithms.git] / lib / fpa / Filters / Image / ExtractAxis.h
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __fpa__Filters__Image__ExtractAxis__h__
6 #define __fpa__Filters__Image__ExtractAxis__h__
7
8 #include <itkProcessObject.h>
9 #include <itkImageToImageFilter.h>
10 #include <fpa/DataStructures/Image/PolyLineParametricPath.h>
11 #include <fpa/Filters/Image/Dijkstra.h>
12
13 namespace fpa
14 {
15   namespace Filters
16   {
17     namespace Image
18     {
19       /**
20        */
21       template< class _TInputImage, class _TScalar >
22       class ExtractAxis
23         : public itk::ProcessObject
24       {
25       public:
26         typedef ExtractAxis               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::DataStructures::Image::PolyLineParametricPath< Self::Dimension > TPath;
46         typedef fpa::Filters::Image::Dijkstra< TScalarImage, TScalarImage > TDijkstra;
47
48       public:
49         itkNewMacro( Self );
50         itkTypeMacro( fpa::Image::ExtractAxis, itk::ProcessObject );
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         ExtractAxis( );
78         virtual ~ExtractAxis( );
79
80         virtual void GenerateData( ) override;
81
82       private:
83         // Purposely not implemented.
84         ExtractAxis( 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 } // ecapseman
100
101 #ifndef ITK_MANUAL_INSTANTIATION
102 #  include <fpa/Filters/Image/ExtractAxis.hxx>
103 #endif // ITK_MANUAL_INSTANTIATION
104 #endif // __fpa__Filters__Image__ExtractAxis__h__
105
106 // eof - $RCSfile$