]> Creatis software - FrontAlgorithms.git/blob - appli/CTBronchi/MoriLabelling.h
...
[FrontAlgorithms.git] / appli / CTBronchi / MoriLabelling.h
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __CTBronchi__MoriLabelling__h__
6 #define __CTBronchi__MoriLabelling__h__
7
8 #include <fpa/Filters/BaseMarksInterface.h>
9 #include <fpa/Filters/Image/SeedsFromLabelsInterface.h>
10 #include <fpa/Filters/Image/DefaultTraits.h>
11 #include <fpa/Filters/Image/RegionGrow.h>
12 #include <fpa/Functors/RegionGrow/BinaryThreshold.h>
13
14 namespace CTBronchi
15 {
16   /**
17    */
18   template< class _TImage, class _TLabels >
19   class MoriLabellingTraits
20     : public fpa::Filters::Image::DefaultTraits< _TImage, _TLabels, typename _TLabels::PixelType >
21   {
22   public:
23     typedef fpa::Filters::Image::DefaultTraits< _TImage, _TLabels, typename _TLabels::PixelType > Superclass;
24     typedef typename Superclass::TInternalTraits  TInternalTraits;
25     typedef typename Superclass::TMarksImage      TMarksImage;
26     typedef typename Superclass::TFilterInterface TFilterInterface;
27
28     typedef fpa::Filters::BaseMarksInterface< TInternalTraits >  TMarksInterface;
29     typedef fpa::Filters::Image::SeedsFromLabelsInterface< TInternalTraits > TSeedsInterface;
30   };
31
32   /**
33    */
34   template< class _TImage, class _TLabels, class _TScalarImage >
35   class MoriLabelling
36     : public fpa::Filters::Image::RegionGrow< _TImage, _TLabels, typename _TLabels::PixelType, CTBronchi::MoriLabellingTraits< _TImage, _TLabels > >
37   {
38   public:
39     typedef CTBronchi::MoriLabellingTraits< _TImage, _TLabels > TTraits;
40     fpaTraitsMacro( typename TTraits );
41
42     typedef fpa::Filters::Image::RegionGrow< _TImage, _TLabels, TMark, TTraits > Superclass;
43     typedef MoriLabelling Self;
44     typedef itk::SmartPointer< Self > Pointer;
45     typedef itk::SmartPointer< const Self > ConstPointer;
46
47     typedef fpa::Functors::RegionGrow::BinaryThreshold< TInputValue > TFunctor;
48
49   public:
50     itkNewMacro( Self );
51     itkTypeMacro( MoriLabelling, fpa::Filters::Image::RegionGrow );
52
53     itkGetConstMacro( VesselnessThreshold, double );
54     itkSetMacro( VesselnessThreshold, double );
55
56     itkGetConstMacro( UpperThreshold, TInputValue );
57     itkSetMacro( UpperThreshold, TInputValue );
58
59     ivqITKInputMacro( InputLabels, _TLabels );
60     ivqITKInputMacro( InputVesselness, _TScalarImage );
61
62   protected:
63     MoriLabelling( )
64       : Superclass( ),
65         m_VesselnessThreshold( 0.05 ),
66         m_UpperThreshold( -650 )
67       {
68         ivqITKInputConfigureMacro( InputLabels, _TLabels );
69         ivqITKInputConfigureMacro( InputVesselness, _TScalarImage );
70         this->m_Functor = TFunctor::New( );
71         this->SetPredicate( this->m_Functor );
72       }
73
74     virtual ~MoriLabelling( )
75       {
76       }
77
78   private:
79     // Purposely not implemented.
80     MoriLabelling( const Self& other );
81     Self& operator=( const Self& other );
82
83   protected:
84     typename TFunctor::Pointer m_Functor;
85     double m_VesselnessThreshold;
86     TInputValue m_UpperThreshold;
87   };
88
89 } // ecapseman
90
91 #endif // __CTBronchi__Functions__h__
92
93 // eof - $RCSfile$