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