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