1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
6 #ifndef __CTBronchi__MoriLabelling__h__
7 #define __CTBronchi__MoriLabelling__h__
10 #include <fpa/Base/RegionGrow.h>
11 #include <fpa/Base/MarksInterface.h>
12 #include <fpa/Base/Functors/RegionGrow/BinaryThreshold.h>
13 #include <fpa/Image/Algorithm.h>
14 #include <fpa/Image/DefaultTraits.h>
15 #include <fpa/Image/LabelledSeedsInterface.h>
23 template< class _TInputImage, class _TLabelImage, class _TTraits = fpa::Image::DefaultTraits< _TInputImage, _TLabelImage, typename _TLabelImage::PixelType > >
25 : public fpa::Base::RegionGrow< fpa::Image::Algorithm< _TTraits, fpa::Base::MarksInterface< _TTraits >, fpa::Image::LabelledSeedsInterface< _TTraits > > >
28 typedef _TInputImage TInputImage;
29 typedef _TLabelImage TLabelImage;
30 typedef _TTraits TTraits;
31 fpa_Base_TraitTypes( typename TTraits );
33 typedef fpa::Base::MarksInterface< TTraits > TMarksInterface;
34 typedef fpa::Image::LabelledSeedsInterface< TTraits > TSeedsInterface;
35 typedef fpa::Image::Algorithm< TTraits, TMarksInterface, TSeedsInterface > TAlgorithm;
37 typedef MoriLabelling Self;
38 typedef fpa::Base::RegionGrow< TAlgorithm > Superclass;
39 typedef itk::SmartPointer< Self > Pointer;
40 typedef itk::SmartPointer< const Self > ConstPointer;
42 typedef fpa::Base::Functors::RegionGrow::BinaryThreshold< TInputValue > TThresholdFunction;
46 itkTypeMacro( MoriLabelling, fpa::Base::RegionGrow );
48 itkGetConstMacro( InsideLabel, TOutputValue );
49 itkSetMacro( InsideLabel, TOutputValue );
52 const TLabelImage* GetInputLabelImage( ) const;
53 void SetInputLabelImage( TLabelImage* image );
55 const TInputImage* GetInputRawImage( ) const;
56 void SetInputRawImage( TInputImage* image );
58 TInputValue GetUpperThreshold( ) const;
59 void SetUpperThreshold( TInputValue t );
61 TOutputValue GetOutsideValue( ) const;
62 void SetOutsideLabel( TOutputValue o );
66 virtual ~MoriLabelling( );
68 virtual TNodes _UnifySeeds( ) override;
69 virtual void _UpdateOutputValue( TNode& n ) override;
72 // Purposely not implemented.
73 MoriLabelling( const Self& other );
74 Self& operator=( const Self& other );
77 TOutputValue m_InsideLabel;
83 #ifndef ITK_MANUAL_INSTANTIATION
84 # include <CTBronchi/MoriLabelling.hxx>
85 #endif // ITK_MANUAL_INSTANTIATION
87 #endif // __CTBronchi__MoriLabelling__h__