#ifndef __CTBronchi__MoriLabelling__h__
#define __CTBronchi__MoriLabelling__h__
-#include <itkImageToImageFilter.h>
+#include <fpa/Base/RegionGrow.h>
+#include <fpa/Base/MarksInterface.h>
+#include <fpa/Base/Functors/RegionGrow/BinaryThreshold.h>
+#include <fpa/Image/Algorithm.h>
+#include <fpa/Image/DefaultTraits.h>
+#include <fpa/Image/LabelledSeedsInterface.h>
namespace CTBronchi
{
/**
*/
- template< class _TInputImage, class _TLabelImage >
+ template< class _TInputImage, class _TLabelImage, class _TTraits = fpa::Image::DefaultTraits< _TInputImage, _TLabelImage, typename _TLabelImage::PixelType > >
class MoriLabelling
- : public itk::ImageToImageFilter< _TLabelImage, _TLabelImage >
+ : public fpa::Base::RegionGrow< fpa::Image::Algorithm< _TTraits, fpa::Base::MarksInterface< _TTraits >, fpa::Image::LabelledSeedsInterface< _TTraits > > >
{
public:
- typedef MoriLabelling Self;
- typedef itk::ImageToImageFilter< _TLabelImage, _TLabelImage > Superclass;
- typedef itk::SmartPointer< Self > Pointer;
- typedef itk::SmartPointer< const Self > ConstPointer;
-
typedef _TInputImage TInputImage;
typedef _TLabelImage TLabelImage;
- typedef typename TInputImage::PixelType TPixel;
- typedef typename TLabelImage::PixelType TLabel;
- typedef typename TLabelImage::RegionType TRegion;
+ typedef _TTraits TTraits;
+ fpa_Base_TraitTypes( typename TTraits );
- public:
- itkNewMacro( Self );
- itkTypeMacro( MoriLabelling, itk::ImageToImageFilter );
+ typedef fpa::Base::MarksInterface< TTraits > TMarksInterface;
+ typedef fpa::Image::LabelledSeedsInterface< TTraits > TSeedsInterface;
+ typedef fpa::Image::Algorithm< TTraits, TMarksInterface, TSeedsInterface > TAlgorithm;
- itkGetConstMacro( UpperThreshold, TPixel );
- itkSetMacro( UpperThreshold, TPixel );
+ typedef MoriLabelling Self;
+ typedef fpa::Base::RegionGrow< TAlgorithm > Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
- itkGetConstMacro( InsideValue, TLabel );
- itkSetMacro( InsideValue, TLabel );
+ typedef fpa::Base::Functors::RegionGrow::BinaryThreshold< TInputValue > TThresholdFunction;
- itkGetConstMacro( InsideLabel, TLabel );
- itkSetMacro( InsideLabel, TLabel );
+ public:
+ itkNewMacro( Self );
+ itkTypeMacro( MoriLabelling, fpa::Base::RegionGrow );
- itkGetConstMacro( OutsideLabel, TLabel );
- itkSetMacro( OutsideLabel, TLabel );
+ itkGetConstMacro( InsideLabel, TOutputValue );
+ itkSetMacro( InsideLabel, TOutputValue );
public:
const TLabelImage* GetInputLabelImage( ) const;
const TInputImage* GetInputRawImage( ) const;
void SetInputRawImage( TInputImage* image );
+ TInputValue GetUpperThreshold( ) const;
+ void SetUpperThreshold( TInputValue t );
+
+ TOutputValue GetOutsideValue( ) const;
+ void SetOutsideLabel( TOutputValue o );
+
protected:
MoriLabelling( );
virtual ~MoriLabelling( );
- virtual void ThreadedGenerateData( const TRegion& region, itk::ThreadIdType threadId ) override;
+ virtual TNodes _UnifySeeds( ) override;
+ virtual void _UpdateOutputValue( TNode& n ) override;
private:
// Purposely not implemented.
Self& operator=( const Self& other );
protected:
- TPixel m_UpperThreshold;
- TLabel m_InsideValue;
- TLabel m_InsideLabel;
- TLabel m_OutsideLabel;
+ TOutputValue m_InsideLabel;
};
} // ecapseman