#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 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:
#include <itkImageRegionConstIteratorWithIndex.h>
// -------------------------------------------------------------------------
-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 =
}
// -------------------------------------------------------------------------
-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 =
}
// -------------------------------------------------------------------------
-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 ) )
}
// -------------------------------------------------------------------------
-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( );
}
// -------------------------------------------------------------------------
-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( );