// ========================================================================= // @author Leonardo Florez Valencia // @email florez-l@javeriana.edu.co // ========================================================================= #ifndef __CTBronchi__MoriLabelling__h__ #define __CTBronchi__MoriLabelling__h__ #include #include #include #include #include namespace CTBronchi { /** */ template< class _TInputImage, class _TLabelImage > class MoriLabelling : 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 > > > { public: typedef _TInputImage TInputImage; typedef _TLabelImage TLabelImage; typedef typename TInputImage::PixelType TInputValue; typedef typename TInputImage::PointType TPoint; typedef typename TInputImage::IndexType TVertex; typedef typename TLabelImage::PixelType TOutputValue; typedef typename TVertex::LexicographicCompare TVertexCompare; typedef fpa::Base::MarksInterface< TVertex > TMarksInterface; typedef fpa::Image::LabelledSeedsInterface< TVertex, TPoint, TInputValue, TOutputValue, TOutputValue, TVertexCompare > TSeedsInterface; typedef fpa::Image::Algorithm< TInputImage, TLabelImage, TMarksInterface, TSeedsInterface > TAlgorithm; typedef MoriLabelling Self; typedef fpa::Base::RegionGrow< TAlgorithm > Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; typedef typename TSeedsInterface::TNode TNode; typedef typename TSeedsInterface::TNodes TNodes; typedef fpa::Base::Functors::RegionGrow::BinaryThreshold< TInputValue > TThresholdFunction; public: itkNewMacro( Self ); itkTypeMacro( MoriLabelling, fpa::Base::RegionGrow ); itkGetConstMacro( InsideLabel, TOutputValue ); itkSetMacro( InsideLabel, TOutputValue ); itkGetConstMacro( OutsideLabel, TOutputValue ); itkSetMacro( OutsideLabel, TOutputValue ); public: const TLabelImage* GetInputLabelImage( ) const; void SetInputLabelImage( TLabelImage* image ); const TInputImage* GetInputRawImage( ) const; void SetInputRawImage( TInputImage* image ); TInputValue GetUpperThreshold( ) const; void SetUpperThreshold( TInputValue t ); protected: MoriLabelling( ); virtual ~MoriLabelling( ); virtual TNodes _UnifySeeds( ) override; virtual void _UpdateOutputValue( TNode& n ) override; private: // Purposely not implemented. MoriLabelling( const Self& other ); Self& operator=( const Self& other ); protected: TOutputValue m_InsideLabel; TOutputValue m_OutsideLabel; }; } // ecapseman #ifndef ITK_MANUAL_INSTANTIATION # include #endif // ITK_MANUAL_INSTANTIATION #endif // __CTBronchi__MoriLabelling__h__ // eof - $RCSfile$