1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __CTBronchi__MoriLabelling__h__
6 #define __CTBronchi__MoriLabelling__h__
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>
19 template< class _TInputImage, class _TLabelImage >
20 class MoriLabellingTraits
21 : public fpa::Filters::Image::DefaultTraits< _TInputImage, _TLabelImage, typename _TLabelImage::PixelType >
24 typedef _TInputImage TInputImage;
25 typedef _TLabelImage TLabelImage;
26 typedef fpa::Filters::Image::DefaultTraits< TInputImage, TLabelImage, typename TLabelImage::PixelType > Superclass;
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;
36 template< class _TInputImage, class _TLabelImage >
38 : public fpa::Filters::Image::LabelsSeedFilter< fpa::Filters::Image::Algorithm< fpa::Filters::RegionGrow< CTBronchi::MoriLabellingTraits< _TInputImage, _TLabelImage > > >, _TLabelImage >
41 typedef _TInputImage TInputImage;
42 typedef _TLabelImage TLabelImage;
43 typedef CTBronchi::MoriLabellingTraits< TInputImage, TLabelImage > TTraits;
44 fpaTraitsMacro( typename, TTraits );
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;
53 typedef fpa::Functors::RegionGrow::BinaryThreshold< TInputValue > TLabelFunctor;
57 itkTypeMacro( CTBronchi::MoriLabelling, fpa::Filters::Image::RegionGrow );
59 itkGetConstMacro( InputInsideValue, TInputValue );
60 itkSetMacro( InputInsideValue, TInputValue );
63 TInputValue GetUpperThreshold( ) const;
64 void SetUpperThreshold( TInputValue t );
68 virtual ~MoriLabelling( );
70 virtual void _UpdateOutputValue( TNode& n ) override;
73 // Purposely not implemented.
74 MoriLabelling( const Self& other );
75 Self& operator=( const Self& other );
78 typename TLabelFunctor::Pointer m_LabelFunctor;
79 TInputValue m_InputInsideValue;
84 #ifndef ITK_MANUAL_INSTANTIATION
85 # include <CTBronchi/MoriLabelling.hxx>
86 #endif // ITK_MANUAL_INSTANTIATION
88 #endif // __CTBronchi__MoriLabelling__h__