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/LabelledSeedsInterface.h>
19 template< class _TInputImage, class _TLabelImage >
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 > > >
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;
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;
36 typedef MoriLabelling Self;
37 typedef fpa::Base::RegionGrow< TAlgorithm > Superclass;
38 typedef itk::SmartPointer< Self > Pointer;
39 typedef itk::SmartPointer< const Self > ConstPointer;
41 typedef typename TSeedsInterface::TNode TNode;
42 typedef typename TSeedsInterface::TNodes TNodes;
44 typedef fpa::Base::Functors::RegionGrow::BinaryThreshold< TInputValue > TThresholdFunction;
48 itkTypeMacro( MoriLabelling, fpa::Base::RegionGrow );
50 itkGetConstMacro( InsideLabel, TOutputValue );
51 itkSetMacro( InsideLabel, TOutputValue );
53 itkGetConstMacro( OutsideLabel, TOutputValue );
54 itkSetMacro( OutsideLabel, TOutputValue );
57 const TLabelImage* GetInputLabelImage( ) const;
58 void SetInputLabelImage( TLabelImage* image );
60 const TInputImage* GetInputRawImage( ) const;
61 void SetInputRawImage( TInputImage* image );
63 TInputValue GetUpperThreshold( ) const;
64 void SetUpperThreshold( TInputValue t );
68 virtual ~MoriLabelling( );
70 virtual TNodes _UnifySeeds( ) override;
71 virtual void _UpdateOutputValue( TNode& n ) override;
74 // Purposely not implemented.
75 MoriLabelling( const Self& other );
76 Self& operator=( const Self& other );
79 TOutputValue m_InsideLabel;
80 TOutputValue m_OutsideLabel;
85 #ifndef ITK_MANUAL_INSTANTIATION
86 # include <CTBronchi/MoriLabelling.hxx>
87 #endif // ITK_MANUAL_INSTANTIATION
89 #endif // __CTBronchi__MoriLabelling__h__