// ========================================================================= // @author Leonardo Florez Valencia // @email florez-l@javeriana.edu.co // ========================================================================= #ifndef __fpa__Image__DefaultTraits__h__ #define __fpa__Image__DefaultTraits__h__ #include #include #include #include namespace fpa { namespace Image { /** */ template< class _TInputImage, class _TOutputImage, class _TFrontId > class DefaultTraits { public: typedef DefaultTraits Self; typedef _TInputImage TInputImage; typedef _TOutputImage TOutputImage; typedef _TFrontId TFrontId; itkStaticConstMacro( Dimension, unsigned int, TInputImage::ImageDimension ); typedef typename TInputImage::IndexType TVertex; typedef typename TInputImage::PixelType TInputValue; typedef typename TInputImage::PointType TPoint; typedef typename TOutputImage::PixelType TOutputValue; typedef typename TVertex::LexicographicCompare TCompare; typedef fpa::Base::Event< TVertex > TEvent; typedef std::vector< TVertex > TNeighborhood; struct TSeed { TVertex Vertex; TPoint Point; bool IsPoint; bool IsUnified; TFrontId FrontId; TSeed( ) : IsUnified( false ), FrontId( TFrontId( 0 ) ) { } }; typedef std::vector< TSeed > TSeeds; struct TNode { TVertex Vertex; TVertex Parent; TFrontId FrontId; // Hack to hide the fact that seed values need to be initialized mutable TOutputValue Value; }; struct TNodeCompare { bool operator()( const TNode& a, const TNode& b ) const { TCompare cmp; return( cmp( a.Vertex, b.Vertex ) ); } }; typedef std::set< TNode, TNodeCompare > TNodes; private: itkConceptMacro( Check_SameDimension, ( itk::Concept::SameDimension< Self::Dimension, TOutputImage::ImageDimension > ) ); private: // Purposely not implemented. DefaultTraits( ); DefaultTraits( const Self& other ); virtual ~DefaultTraits( ); Self& operator=( const Self& other ); }; } // ecapseman } // ecapseman #endif // __fpa__Image__DefaultTraits__h__ // eof - $RCSfile$