X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=appli%2FCTBronchi%2FMoriLabelling.h;fp=appli%2FCTBronchi%2FMoriLabelling.h;h=b5993105a70bf691cbae243d109f84b7272896c7;hb=b4c7827278cd914c18ee5404fb636c87e8099b24;hp=d4eea090eec3e1a9ad02d6229d885ed439afaf77;hpb=b69a5d04d117c1fdd297999c4fb034db54911aca;p=FrontAlgorithms.git diff --git a/appli/CTBronchi/MoriLabelling.h b/appli/CTBronchi/MoriLabelling.h index d4eea09..b599310 100644 --- a/appli/CTBronchi/MoriLabelling.h +++ b/appli/CTBronchi/MoriLabelling.h @@ -5,10 +5,10 @@ #ifndef __CTBronchi__MoriLabelling__h__ #define __CTBronchi__MoriLabelling__h__ +#include +#include +#include #include -#include -#include -#include #include #include @@ -18,46 +18,47 @@ namespace CTBronchi */ template< class _TInputImage, class _TLabelImage > class MoriLabellingTraits - : public fpa::Filters::Image::DefaultTraits< _TInputImage, _TLabelImage, typename _TLabelImage::PixelType > + : public fpa::Filters::Image::DefaultTraits< _TInputImage, _TLabelImage, typename _TLabelImage::PixelType > { public: typedef _TInputImage TInputImage; typedef _TLabelImage TLabelImage; - typedef fpa::Filters::Image::DefaultTraits< TInputImage, TLabelImage, typename TLabelImage::PixelType > Superclass; - - typedef typename Superclass::TInternalTraits TInternalTraits; - typedef typename Superclass::TFilter TFilter; - typedef fpa::Filters::MarksInterface< TInternalTraits > TMarksInterface; - typedef fpa::Filters::Image::LabelsSeedInterface< TInternalTraits > TSeedsInterface; + 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::LabelsSeedFilter< fpa::Filters::Image::Algorithm< fpa::Filters::RegionGrow< CTBronchi::MoriLabellingTraits< _TInputImage, _TLabelImage > > >, _TLabelImage > + : 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::RegionGrow< TTraits > TBase; - typedef fpa::Filters::Image::Algorithm< TBase > TAlgorithm; - typedef fpa::Filters::Image::LabelsSeedFilter< TAlgorithm, _TLabelImage > Superclass; - typedef MoriLabelling Self; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; + fpaTraitsMacro( typename TTraits ); - typedef fpa::Functors::RegionGrow::BinaryThreshold< TInputValue > TLabelFunctor; + 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( InputInsideValue, TInputValue ); - itkSetMacro( InputInsideValue, TInputValue ); + itkGetConstMacro( LastThreshold, TInputValue ); + itkSetMacro( LastThreshold, TInputValue ); + + fpaFilterInputMacro( InputLabels, TLabelImage ); public: TInputValue GetUpperThreshold( ) const; @@ -67,7 +68,8 @@ namespace CTBronchi MoriLabelling( ); virtual ~MoriLabelling( ); - virtual void _UpdateOutputValue( TNode& n ) override; + virtual const itk::DataObject* _GetReferenceInput( ) const override; + virtual void _PostComputeOutputValue( TNode& n ) override; private: // Purposely not implemented. @@ -75,8 +77,8 @@ namespace CTBronchi Self& operator=( const Self& other ); protected: - typename TLabelFunctor::Pointer m_LabelFunctor; - TInputValue m_InputInsideValue; + typename TFunctor::Pointer m_Functor; + TInputValue m_LastThreshold; }; } // ecapseman