#ifndef __FPA__IMAGE__REGIONGROW__H__
#define __FPA__IMAGE__REGIONGROW__H__
+#include <itkFunctionBase.h>
#include <itkImageToImageFilter.h>
#include <itkIndex.h>
#include <fpa/Base/RegionGrow.h>
#include <fpa/Image/Algorithm.h>
-#include <fpa/Image/Functors/ImageFunction.h>
namespace fpa
{
{
/**
* @param I Input image type
+ * @param O Output image type
*/
- template< class I, class O = I, class CC = fpa::Image::Functors::CastVertexValueToCost< typename I::PixelType, typename O::PixelType > >
+ template< class I, class O = I >
class RegionGrow
- : public Algorithm< I, fpa::Base::RegionGrow< typename I::IndexType, typename O::PixelType, typename I::PixelType, itk::Functor::IndexLexicographicCompare< I::ImageDimension >, itk::ImageToImageFilter< I, O > >, CC >
+ : public Algorithm< I, O, fpa::Base::RegionGrow< typename I::IndexType, typename I::PixelType, typename O::PixelType, I, itk::Functor::IndexLexicographicCompare< I::ImageDimension >, itk::ImageToImageFilter< I, O > > >
{
public:
- // Standard class typdedefs
- typedef typename I::IndexType TVertex;
- typedef typename O::PixelType TResult;
- typedef typename I::PixelType TVertexValue;
- typedef itk::ImageToImageFilter< I, O > TBaseFilter;
- typedef fpa::Base::RegionGrow< TVertex, TResult, TVertexValue, itk::Functor::IndexLexicographicCompare< I::ImageDimension >, TBaseFilter > TBaseAlgorithm;
+ typedef fpa::Base::RegionGrow< typename I::IndexType, typename I::PixelType, typename O::PixelType, I, itk::Functor::IndexLexicographicCompare< I::ImageDimension >, itk::ImageToImageFilter< I, O > > TBaseAlgorithm;
- typedef RegionGrow Self;
- typedef Algorithm< I, TBaseAlgorithm, CC > Superclass;
- typedef itk::SmartPointer< Self > Pointer;
- typedef itk::SmartPointer< const Self > ConstPointer;
+ typedef RegionGrow Self;
+ typedef Algorithm< I, O, TBaseAlgorithm > Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
- typedef
- fpa::Image::Functors::ImageFunction< I, bool >
- TMembershipFunction;
+ typedef typename Superclass::TInputImage TInputImage;
+ typedef typename Superclass::TOutputImage TOutputImage;
+ typedef typename Superclass::TVertex TVertex;
+ typedef typename Superclass::TValue TValue;
+ typedef typename Superclass::TResult TResult;
+ typedef typename Superclass::TSpace TSpace;
+ typedef typename Superclass::TGrowingFunction TGrowingFunction;
+
+ protected:
+ typedef typename Superclass::_TVertices _TVertices;
+ typedef typename Superclass::_TCollision _TCollision;
+ typedef typename Superclass::_TCollisionsRow _TCollisionsRow;
+ typedef typename Superclass::_TCollisions _TCollisions;
+ typedef typename Superclass::_TNode _TNode;
+ typedef typename Superclass::_TNodes _TNodes;
public:
itkNewMacro( Self );
- itkTypeMacro( RegionGrow, fpaBaseRegionGrow );
-
- itkGetObjectMacro( MembershipFunction, TMembershipFunction );
- itkSetObjectMacro( MembershipFunction, TMembershipFunction );
+ itkTypeMacro( RegionGrow, Algorithm );
protected:
- RegionGrow( )
- : Superclass( ),
- m_MembershipFunction( NULL )
- { }
- virtual ~RegionGrow( )
- { }
+ RegionGrow( );
+ virtual ~RegionGrow( );
- virtual bool _CheckMembership(
- const typename Superclass::_TNode& n
- ) const
- {
- if( this->m_MembershipFunction.IsNotNull( ) )
- {
- if(
- this->m_MembershipFunction->GetInputImage( ) !=
- this->GetInput( )
- )
- this->m_MembershipFunction->SetInputImage( this->GetInput( ) );
- return( this->m_MembershipFunction->Evaluate( n.Vertex ) );
- }
- else
- return( false );
- }
+ virtual void _InitResults( );
private:
// Purposely not implemented
- RegionGrow( const Self& );
- void operator=( const Self& );
-
- protected:
- typename TMembershipFunction::Pointer m_MembershipFunction;
+ RegionGrow( const Self& other );
+ Self& operator=( const Self& other );
};
} // ecapseman
} // ecapseman
+#include <fpa/Image/RegionGrow.hxx>
+
#endif // __FPA__IMAGE__REGIONGROW__H__
// eof - $RCSfile$