1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
6 #ifndef __fpa__Image__MinimumSpanningTreeToImageFilter__hxx__
7 #define __fpa__Image__MinimumSpanningTreeToImageFilter__hxx__
9 // -------------------------------------------------------------------------
10 template< class _TMST, class _TOutputPixelValue >
11 void fpa::Image::MinimumSpanningTreeToImageFilter< _TMST, _TOutputPixelValue >::
13 const TIndex& start, const TIndex& end,
14 const TOutputPixelValue& r,
15 const TOutputPixelValue& g,
16 const TOutputPixelValue& b
27 this->m_Paths.push_back( d );
33 // -------------------------------------------------------------------------
34 template< class _TMST, class _TOutputPixelValue >
35 fpa::Image::MinimumSpanningTreeToImageFilter< _TMST, _TOutputPixelValue >::
36 MinimumSpanningTreeToImageFilter( )
41 // -------------------------------------------------------------------------
42 template< class _TMST, class _TOutputPixelValue >
43 fpa::Image::MinimumSpanningTreeToImageFilter< _TMST, _TOutputPixelValue >::
44 ~MinimumSpanningTreeToImageFilter( )
48 // -------------------------------------------------------------------------
49 template< class _TMST, class _TOutputPixelValue >
50 void fpa::Image::MinimumSpanningTreeToImageFilter< _TMST, _TOutputPixelValue >::
56 const TMST* mst = this->GetInput( );
57 TOutputImage* output = this->GetOutput( );
58 output->SetBufferedRegion( mst->GetBufferedRegion( ) );
60 output->FillBuffer( color );
62 for( TPathData d: this->m_Paths )
64 typename TMST::TVertices path = mst->GetPath( d.Start, d.End );
68 color[ 3 ] = std::numeric_limits< TOutputPixelValue >::max( );
70 output->SetPixel( i, color );
75 #endif // __fpa__Image__MinimumSpanningTreeToImageFilter__hxx__