1 // =========================================================================
2 // @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
3 // =========================================================================
4 #ifndef __DijkstraWithMeanAndVariance__hxx__
5 #define __DijkstraWithMeanAndVariance__hxx__
7 // -------------------------------------------------------------------------
8 template< class _TInput, class _TOutput >
9 double DijkstraWithMeanAndVariance< _TInput, _TOutput >::
12 return( this->m_MeanAndVar.GetMean( ) );
15 // -------------------------------------------------------------------------
16 template< class _TInput, class _TOutput >
17 double DijkstraWithMeanAndVariance< _TInput, _TOutput >::
20 return( this->m_MeanAndVar.GetDeviation( ) );
23 // -------------------------------------------------------------------------
24 template< class _TInput, class _TOutput >
25 double DijkstraWithMeanAndVariance< _TInput, _TOutput >::
28 return( this->m_MeanAndVar.GetVariance( ) );
31 // -------------------------------------------------------------------------
32 template< class _TInput, class _TOutput >
33 DijkstraWithMeanAndVariance< _TInput, _TOutput >::
34 DijkstraWithMeanAndVariance( )
39 // -------------------------------------------------------------------------
40 template< class _TInput, class _TOutput >
41 DijkstraWithMeanAndVariance< _TInput, _TOutput >::
42 ~DijkstraWithMeanAndVariance( )
46 // -------------------------------------------------------------------------
47 template< class _TInput, class _TOutput >
48 void DijkstraWithMeanAndVariance< _TInput, _TOutput >::
49 _BeforeGenerateData( )
51 this->Superclass::_BeforeGenerateData( );
52 this->m_MeanAndVar.Clear( );
54 typename _TInput::RegionType r = this->GetInput( )->GetRequestedRegion( );
55 this->m_MaxVertex = r.GetIndex( );
56 this->m_MinVertex = r.GetIndex( ) + r.GetSize( );
59 // -------------------------------------------------------------------------
60 template< class _TInput, class _TOutput >
61 void DijkstraWithMeanAndVariance< _TInput, _TOutput >::
62 _PostComputeOutputValue( TNode& n )
64 this->Superclass::_PostComputeOutputValue( n );
67 this->m_MeanAndVar.AddValue( this->_GetInputValue( n.Vertex ) );
68 for( unsigned int i = 0; i < TTraits::Dimension; ++i )
70 this->m_MinVertex[ i ] =
71 ( n.Vertex[ i ] < this->m_MinVertex[ i ] )?
72 n.Vertex[ i ]: this->m_MinVertex[ i ];
73 this->m_MaxVertex[ i ] =
74 ( this->m_MaxVertex[ i ] < n.Vertex[ i ] )?
75 n.Vertex[ i ]: this->m_MaxVertex[ i ];
82 #endif // __DijkstraWithMeanAndVariance__hxx__