X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FBase%2FRegionGrowWithMultipleCriteria.h;fp=lib%2Ffpa%2FBase%2FRegionGrowWithMultipleCriteria.h;h=69fbc8e0a7d684092bf581bcbe7ca0eb6dd21d77;hb=2479b55370fe1bec58d94faa3cc268bac419f6d6;hp=0000000000000000000000000000000000000000;hpb=56882b09aa679c7d85e3f21bf9e45df78340a253;p=FrontAlgorithms.git diff --git a/lib/fpa/Base/RegionGrowWithMultipleCriteria.h b/lib/fpa/Base/RegionGrowWithMultipleCriteria.h new file mode 100644 index 0000000..69fbc8e --- /dev/null +++ b/lib/fpa/Base/RegionGrowWithMultipleCriteria.h @@ -0,0 +1,79 @@ +#ifndef __FPA__BASE__REGIONGROWWITHMULTIPLECRITERIA__H__ +#define __FPA__BASE__REGIONGROWWITHMULTIPLECRITERIA__H__ + +#include +#include +#include + +namespace fpa +{ + namespace Base + { + /** + * Region grow is a front propagation with no costs. + */ + template< class V, class R, class VV, class VC, class B > + class RegionGrowWithMultipleCriteria + : public RegionGrow< V, R, VV, VC, B > + { + public: + typedef V TVertex; + typedef R TResult; + typedef VV TVertexValue; + typedef B TBaseFilter; + + /// Standard class typdedefs + typedef RegionGrowWithMultipleCriteria Self; + typedef RegionGrow< V, R, VV, VC, B > Superclass; + typedef itk::SmartPointer< Self > Pointer; + typedef itk::SmartPointer< const Self > ConstPointer; + + typedef typename Superclass::TTraits TTraits; + typedef typename Superclass::TCost TCost; + typedef itk::FunctionBase< V, TCost > TMembershipFunction; + typedef + typename TMembershipFunction::Pointer + TMembershipFunctionPointer; + typedef std::vector< TMembershipFunctionPointer > TFunctions; + + protected: + typedef typename Superclass::_TFrontId _TFrontId; + typedef typename Superclass::_TNode _TNode; + typedef typename Superclass::_TNodes _TNodes; + typedef typename Superclass::_TQueue _TQueue; + + public: + itkTypeMacro( RegionGrowWithMultipleCriteria, RegionGrow ); + + public: + unsigned int GetNumberOfMembershipFunctions( ) const; + void ClearMembershipFunctions( ); + void AddMembershipFunction( TMembershipFunction* function ); + + protected: + RegionGrowWithMultipleCriteria( ); + virtual ~RegionGrowWithMultipleCriteria( ); + + virtual void _BeforeLoop( ); + virtual _TNode _QueuePop( ); + virtual bool _CheckMembership( const _TNode& n ) const; + + private: + RegionGrowWithMultipleCriteria( const Self& ); // Not impl. + void operator=( const Self& ); // Not impl. + + protected: + mutable _TQueue m_AuxiliaryQueue; + TFunctions m_Functions; + typename TFunctions::iterator m_ActualFunction; + }; + + } // ecapseman + +} // ecapseman + +#include + +#endif // __FPA__BASE__REGIONGROWWITHMULTIPLECRITERIA__H__ + +// eof - $RCSfile$