#ifndef __FPA__IMAGE__REGIONGROW__H__
#define __FPA__IMAGE__REGIONGROW__H__
-#include <itkImageFunction.h>
+#include <itkFunctionBase.h>
#include <itkImageToImageFilter.h>
-#include <itkIndex.h>
#include <fpa/Base/RegionGrow.h>
#include <fpa/Image/Algorithm.h>
{
/**
* @param I Input image type
+ * @param O Output image type
*/
- template< class I >
+ template< class I, class O >
class RegionGrow
- : public Algorithm< I, fpa::Base::RegionGrow< typename I::IndexType, typename I::PixelType, typename I::PixelType, itk::Functor::IndexLexicographicCompare< I::ImageDimension >, itk::ImageToImageFilter< I, I > > >
+ : public Algorithm< I, O, fpa::Base::RegionGrow< typename I::IndexType, typename I::PixelType, typename O::PixelType, itk::ImageToImageFilter< I, O > > >
{
public:
- // Standard class typdedefs
- typedef typename I::IndexType TVertex;
- typedef typename I::PixelType TResult;
- typedef typename I::PixelType TVertexValue;
- typedef itk::ImageToImageFilter< I, I > 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, itk::ImageToImageFilter< I, O > > TBaseAlgorithm;
- typedef RegionGrow Self;
- typedef Algorithm< I, TBaseAlgorithm > 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 itk::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 itk::FunctionBase< TValue, bool > TMembershipFunction;
+
+ 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 );
+ itkTypeMacro( RegionGrow, Algorithm );
itkGetObjectMacro( MembershipFunction, TMembershipFunction );
+ itkGetConstObjectMacro( MembershipFunction, TMembershipFunction );
itkSetObjectMacro( MembershipFunction, TMembershipFunction );
protected:
- RegionGrow( )
- : Superclass( ),
- m_MembershipFunction( NULL )
- { }
- 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->EvaluateAtIndex( n.Vertex ) );
- }
- else
- return( false );
- }
+ RegionGrow( );
+ virtual ~RegionGrow( );
+
+ virtual bool _CheckMembership( const TVertex& v ) const;
+ virtual void _InitResults( );
private:
// Purposely not implemented
- RegionGrow( const Self& );
- void operator=( const Self& );
+ RegionGrow( const Self& other );
+ Self& operator=( const Self& other );
protected:
typename TMembershipFunction::Pointer m_MembershipFunction;
} // ecapseman
+#include <fpa/Image/RegionGrow.hxx>
+
#endif // __FPA__IMAGE__REGIONGROW__H__
// eof - $RCSfile$