#define __fpa__Base__RegionGrow__h__
#include <queue>
-#include <fpa/Config.h>
-#include <fpa/Base/RegionGrowFunctionBase.h>
+#include <fpa/Base/QueueAlgorithm.h>
+#include <fpa/Base/Functors/RegionGrow/Base.h>
namespace fpa
{
*/
template< class _TSuperclass >
class RegionGrow
- : public _TSuperclass
+ : public fpa::Base::QueueAlgorithm< _TSuperclass >
{
public:
- typedef RegionGrow Self;
- typedef _TSuperclass Superclass;
- typedef itk::SmartPointer< Self > Pointer;
- typedef itk::SmartPointer< const Self > ConstPointer;
+ typedef RegionGrow Self;
+ typedef fpa::Base::QueueAlgorithm< _TSuperclass > Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
typedef typename Superclass::TOutput TOutput;
typedef typename Superclass::TVertex TVertex;
-
- typedef fpa::Base::RegionGrowFunctionBase< TVertex > TGrowFunction;
+ typedef fpa::Base::Functors::RegionGrow::Base< TVertex, TOutput > TGrowFunction;
protected:
typedef typename Superclass::_TQueueNode _TQueueNode;
- typedef std::queue< _TQueueNode > _TQueue;
public:
itkTypeMacro( RegionGrow, Algorithm );
- itkGetObjectMacro( GrowFunction, TGrowFunction );
- itkGetConstMacro( InsideValue, TOutput );
- itkGetConstMacro( OutsideValue, TOutput );
+ public:
+ TGrowFunction* GetGrowFunction( );
+ const TGrowFunction* GetGrowFunction( ) const;
+ TOutput GetInsideValue( ) const;
+ TOutput GetOutsideValue( ) const;
- itkSetObjectMacro( GrowFunction, TGrowFunction );
- itkSetMacro( InsideValue, TOutput );
- itkSetMacro( OutsideValue, TOutput );
+ void SetGrowFunction( TGrowFunction* f );
+ void SetInsideValue( const TOutput& v );
+ void SetOutsideValue( const TOutput& v );
protected:
RegionGrow( );
virtual bool _UpdateValue(
_TQueueNode& v, const _TQueueNode& p
- ) fpa_OVERRIDE;
- virtual unsigned long _QueueSize( ) const fpa_OVERRIDE;
- virtual void _QueueClear( ) fpa_OVERRIDE;
- virtual void _QueuePush( const _TQueueNode& node ) fpa_OVERRIDE;
- virtual _TQueueNode _QueuePop( ) fpa_OVERRIDE;
+ ) override;
+ virtual TOutput _GetInputValue( const _TQueueNode& v, const _TQueueNode& p ) override
+ {
+ TOutput res = this->m_InitResult;
+ if( this->m_GrowFunction.IsNotNull( ) )
+ res = this->m_GrowFunction->Evaluate( v.Vertex, p.Vertex );
+ return( res );
+ }
+
private:
// Purposely not defined
Self& operator=( const Self& other );
protected:
- TOutput m_InsideValue;
- TOutput m_OutsideValue;
- _TQueue m_Queue;
typename TGrowFunction::Pointer m_GrowFunction;
};