1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
6 #ifndef __CTBronchi__MoriLabelling__h__
7 #define __CTBronchi__MoriLabelling__h__
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>
20 template< class _TInputImage, class _TLabelImage, class _TTraits = fpa::Image::DefaultTraits< _TInputImage, _TLabelImage, typename _TLabelImage::PixelType > >
22 : public fpa::Base::RegionGrow< fpa::Image::Algorithm< _TTraits, fpa::Base::MarksInterface< _TTraits >, fpa::Image::LabelledSeedsInterface< _TTraits > > >
25 typedef _TInputImage TInputImage;
26 typedef _TLabelImage TLabelImage;
27 typedef _TTraits TTraits;
28 fpa_Base_TraitTypes( typename TTraits );
30 typedef fpa::Base::MarksInterface< TTraits > TMarksInterface;
31 typedef fpa::Image::LabelledSeedsInterface< TTraits > TSeedsInterface;
32 typedef fpa::Image::Algorithm< TTraits, TMarksInterface, TSeedsInterface > TAlgorithm;
34 typedef MoriLabelling Self;
35 typedef fpa::Base::RegionGrow< TAlgorithm > Superclass;
36 typedef itk::SmartPointer< Self > Pointer;
37 typedef itk::SmartPointer< const Self > ConstPointer;
39 typedef fpa::Base::Functors::RegionGrow::BinaryThreshold< TInputValue > TThresholdFunction;
43 itkTypeMacro( MoriLabelling, fpa::Base::RegionGrow );
45 itkGetConstMacro( InsideLabel, TOutputValue );
46 itkSetMacro( InsideLabel, TOutputValue );
49 const TLabelImage* GetInputLabelImage( ) const;
50 void SetInputLabelImage( TLabelImage* image );
52 const TInputImage* GetInputRawImage( ) const;
53 void SetInputRawImage( TInputImage* image );
55 TInputValue GetUpperThreshold( ) const;
56 void SetUpperThreshold( TInputValue t );
58 TOutputValue GetOutsideValue( ) const;
59 void SetOutsideLabel( TOutputValue o );
63 virtual ~MoriLabelling( );
65 virtual TNodes _UnifySeeds( ) override;
66 virtual void _UpdateOutputValue( TNode& n ) override;
69 // Purposely not implemented.
70 MoriLabelling( const Self& other );
71 Self& operator=( const Self& other );
74 TOutputValue m_InsideLabel;
79 #ifndef ITK_MANUAL_INSTANTIATION
80 # include <CTBronchi/MoriLabelling.hxx>
81 #endif // ITK_MANUAL_INSTANTIATION
83 #endif // __CTBronchi__MoriLabelling__h__