// ========================================================================= // @author Leonardo Florez Valencia // @email florez-l@javeriana.edu.co // ========================================================================= #ifndef __CTBronchi__MoriLabelling__h__ #define __CTBronchi__MoriLabelling__h__ #include #include #include #include #include #include namespace CTBronchi { /** */ template< class _TInputImage, class _TLabelImage > class MoriLabellingTraits : public fpa::Filters::Image::DefaultTraits< _TInputImage, _TLabelImage, typename _TLabelImage::PixelType > { public: typedef _TInputImage TInputImage; typedef _TLabelImage TLabelImage; typedef typename TLabelImage::PixelType TLabel; typedef fpa::Filters::Image::DefaultTraits< TInputImage, TLabelImage, TLabel > Superclass; typedef typename Superclass::TInternalTraits TInternalTraits; typedef typename Superclass::TMarksImage TMarksImage; typedef typename Superclass::TFilterInterface TFilterInterface; typedef fpa::Filters::BaseMarksInterface< TInternalTraits > TMarksInterface; typedef fpa::Filters::Image::SeedsFromLabelsInterface< TInternalTraits > TSeedsInterface; }; /** */ template< class _TInputImage, class _TLabelImage > class MoriLabelling : public fpa::Filters::Image::RegionGrow< _TInputImage, _TLabelImage, typename _TLabelImage::PixelType, CTBronchi::MoriLabellingTraits< _TInputImage, _TLabelImage > > { public: typedef _TInputImage TInputImage; typedef _TLabelImage TLabelImage; typedef CTBronchi::MoriLabellingTraits< TInputImage, TLabelImage > TTraits; fpaTraitsMacro( typename TTraits ); typedef fpa::Filters::Image::RegionGrow< TInputImage, TLabelImage, TMark, TTraits > Superclass; typedef MoriLabelling Self; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; typedef fpa::Functors::RegionGrow::BinaryThreshold< TInputValue > TFunctor; public: itkNewMacro( Self ); itkTypeMacro( CTBronchi::MoriLabelling, fpa::Filters::Image::RegionGrow ); itkGetConstMacro( LastThreshold, TInputValue ); itkSetMacro( LastThreshold, TInputValue ); fpaFilterInputMacro( InputLabels, TLabelImage ); public: TInputValue GetUpperThreshold( ) const; void SetUpperThreshold( TInputValue t ); protected: MoriLabelling( ); virtual ~MoriLabelling( ); virtual const itk::DataObject* _GetReferenceInput( ) const override; virtual void _PostComputeOutputValue( TNode& n ) override; private: // Purposely not implemented. MoriLabelling( const Self& other ); Self& operator=( const Self& other ); protected: typename TFunctor::Pointer m_Functor; TInputValue m_LastThreshold; }; } // ecapseman #ifndef ITK_MANUAL_INSTANTIATION # include #endif // ITK_MANUAL_INSTANTIATION #endif // __CTBronchi__MoriLabelling__h__ // eof - $RCSfile$