From 3bfac8d84c19e24fce4d479e7f332aefdba9abf7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leonardo=20Fl=C3=B3rez-Valencia?= Date: Wed, 9 Aug 2017 15:56:17 -0500 Subject: [PATCH] ... --- appli/CTBronchi/MoriLabelling.h | 21 +++++------ appli/CTBronchi/MoriLabelling.hxx | 58 +++++++++++++++---------------- 2 files changed, 37 insertions(+), 42 deletions(-) diff --git a/appli/CTBronchi/MoriLabelling.h b/appli/CTBronchi/MoriLabelling.h index eecb4ad..127ec0f 100644 --- a/appli/CTBronchi/MoriLabelling.h +++ b/appli/CTBronchi/MoriLabelling.h @@ -10,37 +10,32 @@ #include #include #include +#include #include 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 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 fpa::Base::RegionGrow< fpa::Image::Algorithm< _TTraits, fpa::Base::MarksInterface< _TTraits >, fpa::Image::LabelledSeedsInterface< _TTraits > > > { 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 _TTraits TTraits; + fpa_Base_TraitTypes( typename TTraits ); - 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 fpa::Base::MarksInterface< TTraits > TMarksInterface; + typedef fpa::Image::LabelledSeedsInterface< TTraits > TSeedsInterface; + typedef fpa::Image::Algorithm< TTraits, 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: diff --git a/appli/CTBronchi/MoriLabelling.hxx b/appli/CTBronchi/MoriLabelling.hxx index 69e968b..6f7246c 100644 --- a/appli/CTBronchi/MoriLabelling.hxx +++ b/appli/CTBronchi/MoriLabelling.hxx @@ -9,43 +9,43 @@ #include // ------------------------------------------------------------------------- -template< class _TInputImage, class _TLabelImage > -const typename CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >:: -TLabelImage* CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >:: +template< class _TInputImage, class _TLabelImage, class _TTraits > +const typename CTBronchi::MoriLabelling< _TInputImage, _TLabelImage, _TTraits >:: +TLabelImage* CTBronchi::MoriLabelling< _TInputImage, _TLabelImage, _TTraits >:: GetInputLabelImage( ) const { return( this->GetLabels( ) ); } // ------------------------------------------------------------------------- -template< class _TInputImage, class _TLabelImage > -void CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >:: +template< class _TInputImage, class _TLabelImage, class _TTraits > +void CTBronchi::MoriLabelling< _TInputImage, _TLabelImage, _TTraits >:: SetInputLabelImage( TLabelImage* image ) { this->SetLabels( image ); } // ------------------------------------------------------------------------- -template< class _TInputImage, class _TLabelImage > -const typename CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >:: -TInputImage* CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >:: +template< class _TInputImage, class _TLabelImage, class _TTraits > +const typename CTBronchi::MoriLabelling< _TInputImage, _TLabelImage, _TTraits >:: +TInputImage* CTBronchi::MoriLabelling< _TInputImage, _TLabelImage, _TTraits >:: GetInputRawImage( ) const { return( this->GetInput( ) ); } // ------------------------------------------------------------------------- -template< class _TInputImage, class _TLabelImage > -void CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >:: +template< class _TInputImage, class _TLabelImage, class _TTraits > +void CTBronchi::MoriLabelling< _TInputImage, _TLabelImage, _TTraits >:: SetInputRawImage( TInputImage* image ) { this->SetInput( image ); } // ------------------------------------------------------------------------- -template< class _TInputImage, class _TLabelImage > -typename CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >:: -TInputValue CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >:: +template< class _TInputImage, class _TLabelImage, class _TTraits > +typename CTBronchi::MoriLabelling< _TInputImage, _TLabelImage, _TTraits >:: +TInputValue CTBronchi::MoriLabelling< _TInputImage, _TLabelImage, _TTraits >:: GetUpperThreshold( ) const { const TThresholdFunction* func = @@ -57,8 +57,8 @@ GetUpperThreshold( ) const } // ------------------------------------------------------------------------- -template< class _TInputImage, class _TLabelImage > -void CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >:: +template< class _TInputImage, class _TLabelImage, class _TTraits > +void CTBronchi::MoriLabelling< _TInputImage, _TLabelImage, _TTraits >:: SetUpperThreshold( TInputValue t ) { TThresholdFunction* func = @@ -68,25 +68,25 @@ SetUpperThreshold( TInputValue t ) } // ------------------------------------------------------------------------- -template< class _TInputImage, class _TLabelImage > -typename CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >:: -TOutputValue CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >:: +template< class _TInputImage, class _TLabelImage, class _TTraits > +typename CTBronchi::MoriLabelling< _TInputImage, _TLabelImage, _TTraits >:: +TOutputValue CTBronchi::MoriLabelling< _TInputImage, _TLabelImage, _TTraits >:: GetOutsideValue( ) const { return( this->GetInitValue( ) ); } // ------------------------------------------------------------------------- -template< class _TInputImage, class _TLabelImage > -void CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >:: +template< class _TInputImage, class _TLabelImage, class _TTraits > +void CTBronchi::MoriLabelling< _TInputImage, _TLabelImage, _TTraits >:: SetOutsideLabel( TOutputValue o ) { this->SetInitValue( o ); } // ------------------------------------------------------------------------- -template< class _TInputImage, class _TLabelImage > -CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >:: +template< class _TInputImage, class _TLabelImage, class _TTraits > +CTBronchi::MoriLabelling< _TInputImage, _TLabelImage, _TTraits >:: MoriLabelling( ) : Superclass( ), m_InsideLabel( TOutputValue( 0 ) ) @@ -96,16 +96,16 @@ MoriLabelling( ) } // ------------------------------------------------------------------------- -template< class _TInputImage, class _TLabelImage > -CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >:: +template< class _TInputImage, class _TLabelImage, class _TTraits > +CTBronchi::MoriLabelling< _TInputImage, _TLabelImage, _TTraits >:: ~MoriLabelling( ) { } // ------------------------------------------------------------------------- -template< class _TInputImage, class _TLabelImage > -typename CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >:: -TNodes CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >:: +template< class _TInputImage, class _TLabelImage, class _TTraits > +typename CTBronchi::MoriLabelling< _TInputImage, _TLabelImage, _TTraits >:: +TNodes CTBronchi::MoriLabelling< _TInputImage, _TLabelImage, _TTraits >:: _UnifySeeds( ) { this->m_Seeds.clear( ); @@ -172,8 +172,8 @@ _UnifySeeds( ) } // ------------------------------------------------------------------------- -template< class _TInputImage, class _TLabelImage > -void CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >:: +template< class _TInputImage, class _TLabelImage, class _TTraits > +void CTBronchi::MoriLabelling< _TInputImage, _TLabelImage, _TTraits >:: _UpdateOutputValue( TNode& n ) { const TLabelImage* input_labels = this->GetInputLabelImage( ); -- 2.45.0