// ========================================================================= // @author Leonardo Florez Valencia // @email florez-l@javeriana.edu.co // ========================================================================= #ifndef __fpa__Image__PathsToImageFilter__h__ #define __fpa__Image__PathsToImageFilter__h__ #include #include #include namespace fpa { namespace Image { /** */ template< class _TMST, class _TOutputPixelValue > class PathsToImageFilter : 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 PathsToImageFilter 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::PathsToImageFilter, 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: PathsToImageFilter( ); virtual ~PathsToImageFilter( ); virtual void GenerateData( ) override; private: PathsToImageFilter( 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__PathsToImageFilter__h__ // eof - $RCSfile$