1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
6 #ifndef __fpa__Image__ExtractAxisFilter__h__
7 #define __fpa__Image__ExtractAxisFilter__h__
9 #include <itkProcessObject.h>
10 #include <itkImageToImageFilter.h>
12 #include <fpa/Image/Dijkstra.h>
13 #include <fpa/Image/PolyLineParametricPath.h>
21 template< class _TInputImage, class _TScalar >
22 class ExtractAxisFilter
23 : public itk::ProcessObject
26 typedef ExtractAxisFilter Self;
27 typedef itk::ProcessObject Superclass;
28 typedef itk::SmartPointer< Self > Pointer;
29 typedef itk::SmartPointer< const Self > ConstPointer;
31 typedef _TInputImage TInputImage;
32 typedef _TScalar TScalar;
33 typedef typename TInputImage::IndexType TIndex;
34 typedef typename TInputImage::PointType TPoint;
39 TInputImage::ImageDimension
42 typedef itk::Image< TScalar, Self::Dimension > TScalarImage;
43 typedef itk::ImageToImageFilter< TInputImage, TScalarImage > TCenterness;
45 typedef fpa::Image::PolyLineParametricPath< Self::Dimension > TPath;
46 typedef fpa::Image::Dijkstra< TScalarImage, TScalarImage > TDijkstra;
50 itkTypeMacro( fpa::Image::ExtractAxisFilter, fpa::Image::Dijkstra );
52 itkGetConstObjectMacro( Centerness, TCenterness );
53 itkGetObjectMacro( Centerness, TCenterness );
54 itkSetObjectMacro( Centerness, TCenterness );
56 itkGetConstMacro( StartIndex, TIndex );
57 itkSetMacro( StartIndex, TIndex );
59 itkGetConstMacro( EndIndex, TIndex );
60 itkSetMacro( EndIndex, TIndex );
63 virtual itk::ModifiedTimeType GetMTime( ) const override;
65 virtual void AddSeed( const TIndex& seed );
66 virtual void AddSeed( const TPoint& seed );
67 virtual void ClearSeeds( );
69 void SetInput( TInputImage* input );
70 TInputImage* GetInput( );
71 const TInputImage* GetInput( ) const;
74 const TPath* GetOutput( ) const;
78 virtual ~ExtractAxisFilter( );
80 virtual void GenerateData( ) override;
83 // Purposely not implemented.
84 ExtractAxisFilter( const Self& other );
85 Self& operator=( const Self& other );
88 typename TCenterness::Pointer m_Centerness;
89 typename TDijkstra::Pointer m_Dijkstra;
99 #ifndef ITK_MANUAL_INSTANTIATION
100 # include <fpa/Image/ExtractAxisFilter.hxx>
101 #endif // ITK_MANUAL_INSTANTIATION
103 #endif // __fpa__Image__ExtractAxisFilter__h__