// ========================================================================= // @author Leonardo Florez Valencia // @email florez-l@javeriana.edu.co // ========================================================================= #ifndef __fpa__Image__MinimumSpanningTreeToImageFilter__h__ #define __fpa__Image__MinimumSpanningTreeToImageFilter__h__ #include #include #include namespace fpa { namespace Image { /** */ template< class _TMST, class _TOutputPixelValue > class MinimumSpanningTreeToImageFilter : public itk::ImageToImageFilter< _TMST, itk::Image< itk::RGBAPixel< _TOutputPixelValue >, _TMST::ImageDimension > > { public: typedef _TMST TMST; typedef _TOutputPixelValue TOutputPixelValue; typedef itk::RGBAPixel< TOutputPixelValue > TOutputPixel; typedef itk::Image< TOutputPixel, TMST::ImageDimension > TOutputImage; typedef MinimumSpanningTreeToImageFilter Self; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; typedef itk::ImageToImageFilter< TMST, TOutputImage > Superclass; typedef typename TMST::IndexType TIndex; struct TPathData { TIndex Start; TIndex End; TOutputPixelValue Red; TOutputPixelValue Green; TOutputPixelValue Blue; }; typedef std::vector< TPathData > TPaths; public: itkNewMacro( Self ); itkTypeMacro( fpa::Image::MinimumSpanningTreeToImageFilter, itk::ImageToImageFilter ); public: void AddPath( const TIndex& start, const TIndex& end, const TOutputPixelValue& r = TOutputPixelValue( 1 ), const TOutputPixelValue& g = TOutputPixelValue( 0 ), const TOutputPixelValue& b = TOutputPixelValue( 0 ) ); protected: MinimumSpanningTreeToImageFilter( ); virtual ~MinimumSpanningTreeToImageFilter( ); virtual void GenerateData( ) override; private: MinimumSpanningTreeToImageFilter( const Self& other ); Self& operator=( const Self& other ); protected: TPaths m_Paths; }; } // ecapseman } // ecapseman #ifndef ITK_MANUAL_INSTANTIATION # include #endif // ITK_MANUAL_INSTANTIATION #endif // __fpa__Image__MinimumSpanningTreeToImageFilter__h__ // eof - $RCSfile$