X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FImage%2FRegionGrow.h;h=b8147985d53f1fb60c6e99bcd5f28a80d6dc8792;hb=6468f1fda5fed2788fbaef1a7925c91ecff83d13;hp=dd7c851a5bf5324ad12b72d101a9f59910e57232;hpb=79df4abfecefc36c0dfca7d9f6f2978882de95dc;p=FrontAlgorithms.git diff --git a/lib/fpa/Image/RegionGrow.h b/lib/fpa/Image/RegionGrow.h index dd7c851..b814798 100644 --- a/lib/fpa/Image/RegionGrow.h +++ b/lib/fpa/Image/RegionGrow.h @@ -1,11 +1,11 @@ #ifndef __FPA__IMAGE__REGIONGROW__H__ #define __FPA__IMAGE__REGIONGROW__H__ +#include #include #include #include #include -#include namespace fpa { @@ -13,73 +13,58 @@ namespace fpa { /** * @param I Input image type + * @param O Output image type */ - template< class I > + template< class I, class O = I > 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, I, itk::Functor::IndexLexicographicCompare< I::ImageDimension >, 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, I, itk::Functor::IndexLexicographicCompare< I::ImageDimension >, 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 - 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 + #endif // __FPA__IMAGE__REGIONGROW__H__ // eof - $RCSfile$