1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __CTBronchi__MoriLabelling__h__
6 #define __CTBronchi__MoriLabelling__h__
9 #include <fpa/Filters/BaseMarksInterface.h>
10 #include <fpa/Filters/Image/SeedsFromLabelsInterface.h>
11 #include <fpa/Filters/Image/DefaultTraits.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 typename TLabelImage::PixelType TLabel;
27 typedef fpa::Filters::Image::DefaultTraits< TInputImage, TLabelImage, TLabel > Superclass;
28 typedef typename Superclass::TInternalTraits TInternalTraits;
29 typedef typename Superclass::TMarksImage TMarksImage;
30 typedef typename Superclass::TFilterInterface TFilterInterface;
32 typedef fpa::Filters::BaseMarksInterface< TInternalTraits > TMarksInterface;
33 typedef fpa::Filters::Image::SeedsFromLabelsInterface< TInternalTraits > TSeedsInterface;
38 template< class _TInputImage, class _TLabelImage >
40 : public fpa::Filters::Image::RegionGrow< _TInputImage, _TLabelImage, typename _TLabelImage::PixelType, CTBronchi::MoriLabellingTraits< _TInputImage, _TLabelImage > >
43 typedef _TInputImage TInputImage;
44 typedef _TLabelImage TLabelImage;
45 typedef CTBronchi::MoriLabellingTraits< TInputImage, TLabelImage > TTraits;
46 fpaTraitsMacro( typename TTraits );
48 typedef fpa::Filters::Image::RegionGrow< TInputImage, TLabelImage, TMark, TTraits > Superclass;
49 typedef MoriLabelling Self;
50 typedef itk::SmartPointer< Self > Pointer;
51 typedef itk::SmartPointer< const Self > ConstPointer;
52 typedef fpa::Functors::RegionGrow::BinaryThreshold< TInputValue > TFunctor;
56 itkTypeMacro( CTBronchi::MoriLabelling, fpa::Filters::Image::RegionGrow );
58 itkGetConstMacro( LastThreshold, TInputValue );
59 itkSetMacro( LastThreshold, TInputValue );
61 fpaFilterInputMacro( InputLabels, TLabelImage );
64 TInputValue GetUpperThreshold( ) const;
65 void SetUpperThreshold( TInputValue t );
69 virtual ~MoriLabelling( );
71 virtual const itk::DataObject* _GetReferenceInput( ) const override;
72 virtual void _PostComputeOutputValue( TNode& n ) override;
75 // Purposely not implemented.
76 MoriLabelling( const Self& other );
77 Self& operator=( const Self& other );
80 typename TFunctor::Pointer m_Functor;
81 TInputValue m_LastThreshold;
86 #ifndef ITK_MANUAL_INSTANTIATION
87 # include <CTBronchi/MoriLabelling.hxx>
88 #endif // ITK_MANUAL_INSTANTIATION
89 #endif // __CTBronchi__MoriLabelling__h__