]> 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/Image/DefaultTraits.h>
9 #include <fpa/Filters/MarksInterface.h>
10 #include <fpa/Filters/Image/LabelsSeedFilter.h>
11 #include <fpa/Filters/Image/LabelsSeedInterface.h>
12 #include <fpa/Filters/Image/RegionGrow.h>
13 #include <fpa/Functors/RegionGrow/BinaryThreshold.h>
14
15 namespace CTBronchi
16 {
17   /**
18    */
19   template< class _TInputImage, class _TLabelImage >
20   class MoriLabellingTraits
21         : public fpa::Filters::Image::DefaultTraits< _TInputImage, _TLabelImage, typename _TLabelImage::PixelType >
22   {
23   public:
24     typedef _TInputImage TInputImage;
25     typedef _TLabelImage TLabelImage;
26     typedef fpa::Filters::Image::DefaultTraits< TInputImage, TLabelImage, typename TLabelImage::PixelType > Superclass;
27
28     typedef typename Superclass::TInternalTraits TInternalTraits;
29     typedef typename Superclass::TFilter TFilter;
30     typedef fpa::Filters::MarksInterface< TInternalTraits >  TMarksInterface;
31     typedef fpa::Filters::Image::LabelsSeedInterface< TInternalTraits > TSeedsInterface;
32   };
33
34   /**
35    */
36   template< class _TInputImage, class _TLabelImage >
37   class MoriLabelling
38     : public fpa::Filters::Image::LabelsSeedFilter< fpa::Filters::Image::Algorithm< fpa::Filters::RegionGrow< CTBronchi::MoriLabellingTraits< _TInputImage, _TLabelImage > > >, _TLabelImage >
39   {
40   public:
41     typedef _TInputImage TInputImage;
42     typedef _TLabelImage TLabelImage;
43     typedef CTBronchi::MoriLabellingTraits< TInputImage, TLabelImage > TTraits;
44     fpaTraitsMacro( typename, TTraits );
45
46     typedef fpa::Filters::RegionGrow< TTraits > TBase;
47     typedef fpa::Filters::Image::Algorithm< TBase > TAlgorithm;
48     typedef fpa::Filters::Image::LabelsSeedFilter< TAlgorithm, _TLabelImage > Superclass;
49     typedef MoriLabelling Self;
50     typedef itk::SmartPointer< Self >        Pointer;
51     typedef itk::SmartPointer< const Self >  ConstPointer;
52
53     typedef fpa::Functors::RegionGrow::BinaryThreshold< TInputValue > TLabelFunctor;
54
55   public:
56     itkNewMacro( Self );
57     itkTypeMacro( CTBronchi::MoriLabelling, fpa::Filters::Image::RegionGrow );
58
59     itkGetConstMacro( InputInsideValue, TInputValue );
60     itkSetMacro( InputInsideValue, TInputValue );
61
62   public:
63     TInputValue GetUpperThreshold( ) const;
64     void SetUpperThreshold( TInputValue t );
65
66   protected:
67     MoriLabelling( );
68     virtual ~MoriLabelling( );
69
70     virtual void _UpdateOutputValue( TNode& n ) override;
71
72   private:
73     // Purposely not implemented.
74     MoriLabelling( const Self& other );
75     Self& operator=( const Self& other );
76
77   protected:
78     typename TLabelFunctor::Pointer m_LabelFunctor;
79     TInputValue m_InputInsideValue;
80   };
81
82 } // ecapseman
83
84 #ifndef ITK_MANUAL_INSTANTIATION
85 #  include <CTBronchi/MoriLabelling.hxx>
86 #endif // ITK_MANUAL_INSTANTIATION
87
88 #endif // __CTBronchi__MoriLabelling__h__
89
90 // eof - $RCSfile$