#define __fpa__Image__RandomWalker__h__
#include <itkImage.h>
-
#include <fpa/Base/DijkstraBase.h>
#include <fpa/Base/MarksInterface.h>
#include <fpa/Image/Algorithm.h>
+#include <fpa/Image/DefaultTraits.h>
#include <fpa/Image/LabelledSeedsInterface.h>
#include <fpa/Image/Functors/Dijkstra/Function.h>
{
namespace Image
{
+ /**
+ */
+ template< class _TInputImage, class _TLabelImage, class _TScalar >
+ class RandomWalkerTraits
+ : public fpa::Image::DefaultTraits< _TInputImage, itk::Image< _TScalar, _TInputImage::ImageDimension >, typename _TLabelImage::PixelType >
+ {
+ public:
+ typedef RandomWalkerTraits Self;
+ typedef _TInputImage TInputImage;
+ typedef _TLabelImage TLabelImage;
+ typedef _TScalar TScalar;
+ typedef typename _TLabelImage::PixelType TFrontId;
+ typedef itk::Image< TScalar, _TInputImage::ImageDimension > TOutputImage;
+ typedef fpa::Image::DefaultTraits< TInputImage, TOutputImage, TFrontId > Superclass;
+
+ typedef typename Superclass::TVertex TVertex;
+ typedef typename Superclass::TInputValue TInputValue;
+ typedef typename Superclass::TPoint TPoint;
+ typedef typename Superclass::TOutputValue TOutputValue;
+ typedef typename Superclass::TCompare TCompare;
+ typedef typename Superclass::TNeighborhood TNeighborhood;
+ typedef typename Superclass::TFilter TFilter;
+
+ typedef fpa::Image::LabelledSeedsInterface< TVertex, TPoint, TInputValue, TOutputValue, TFrontId, TCompare > TSeedsInterface;
+ typedef fpa::Base::MarksInterface< TVertex > TMarksInterface;
+
+ typedef typename TSeedsInterface::TNode TNode;
+ typedef typename TSeedsInterface::TNodes TNodes;
+ typedef typename TSeedsInterface::TSeed TSeed;
+ typedef typename TSeedsInterface::TSeeds TSeeds;
+
+ public:
+ itkConceptMacro(
+ Check_SameDimension,
+ ( itk::Concept::SameDimension< TInputImage::ImageDimension, TLabelImage::ImageDimension > )
+ );
+
+ private:
+ // Purposely not implemented.
+ RandomWalkerTraits( );
+ RandomWalkerTraits( const Self& other );
+ virtual ~RandomWalkerTraits( );
+ Self& operator=( const Self& other );
+ };
+
/**
*/
template< class _TInputImage, class _TLabelImage, class _TScalar >
class RandomWalker
- : public fpa::Base::DijkstraBase< fpa::Image::Algorithm< _TInputImage, itk::Image< _TScalar, _TInputImage::ImageDimension >, fpa::Base::MarksInterface< typename _TInputImage::IndexType >, fpa::Image::LabelledSeedsInterface< typename _TInputImage::IndexType, typename _TInputImage::PixelType, _TScalar, typename _TLabelImage::PixelType, typename _TInputImage::IndexType::LexicographicCompare > > >
+ : public fpa::Base::DijkstraBase< fpa::Image::Algorithm< fpa::Image::RandomWalkerTraits< _TInputImage, _TLabelImage, _TScalar > > >
{
public:
typedef _TInputImage TInputImage;
typedef _TLabelImage TLabelImage;
typedef _TScalar TScalar;
- typedef typename TInputImage::IndexType TVertex;
- typedef typename TVertex::LexicographicCompare TVertexCompare;
- typedef typename TInputImage::PixelType TInputValue;
- typedef typename TLabelImage::PixelType TFrontId;
- typedef itk::Image< TScalar, _TInputImage::ImageDimension > TOutputImage;
- typedef fpa::Base::MarksInterface< TVertex > TMarksInterface;
- typedef fpa::Image::LabelledSeedsInterface< TVertex, TInputValue, _TScalar, TFrontId, TVertexCompare > TSeedsInterface;
- typedef fpa::Image::Algorithm< _TInputImage, TOutputImage, TMarksInterface, TSeedsInterface > TAlgorithm;
-
- typedef RandomWalker Self;
+ typedef fpa::Image::RandomWalkerTraits< TInputImage, TLabelImage, TScalar > TTraits;
+ typedef fpa::Image::Algorithm< TTraits > TAlgorithm;
typedef fpa::Base::DijkstraBase< TAlgorithm > Superclass;
- typedef itk::SmartPointer< Self > Pointer;
- typedef itk::SmartPointer< const Self > ConstPointer;
+ typedef RandomWalker Self;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
+
+ typedef typename TTraits::TNode TNode;
+ typedef typename TTraits::TNodes TNodes;
+ typedef typename TTraits::TSeed TSeed;
+ typedef typename TTraits::TVertex TVertex;
typedef fpa::Image::Functors::Dijkstra::Function< TInputImage, TScalar > TWeightFunction;
virtual ~RandomWalker( );
virtual void _BeforeGenerateData( ) override;
- virtual void _QueueInit( ) override;
+ virtual TNodes _UnifySeeds( ) override;
private:
// Purposely not implemented.