// ========================================================================= // @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co) // ========================================================================= #ifndef __DijkstraWithMeanAndVariance__hxx__ #define __DijkstraWithMeanAndVariance__hxx__ // ------------------------------------------------------------------------- template< class _TInput, class _TOutput > double DijkstraWithMeanAndVariance< _TInput, _TOutput >:: GetMean( ) const { return( this->m_MeanAndVar.GetMean( ) ); } // ------------------------------------------------------------------------- template< class _TInput, class _TOutput > double DijkstraWithMeanAndVariance< _TInput, _TOutput >:: GetDeviation( ) const { return( this->m_MeanAndVar.GetDeviation( ) ); } // ------------------------------------------------------------------------- template< class _TInput, class _TOutput > double DijkstraWithMeanAndVariance< _TInput, _TOutput >:: GetVariance( ) const { return( this->m_MeanAndVar.GetVariance( ) ); } // ------------------------------------------------------------------------- template< class _TInput, class _TOutput > DijkstraWithMeanAndVariance< _TInput, _TOutput >:: DijkstraWithMeanAndVariance( ) : Superclass( ) { } // ------------------------------------------------------------------------- template< class _TInput, class _TOutput > DijkstraWithMeanAndVariance< _TInput, _TOutput >:: ~DijkstraWithMeanAndVariance( ) { } // ------------------------------------------------------------------------- template< class _TInput, class _TOutput > void DijkstraWithMeanAndVariance< _TInput, _TOutput >:: _BeforeGenerateData( ) { this->Superclass::_BeforeGenerateData( ); this->m_MeanAndVar.Clear( ); typename _TInput::RegionType r = this->GetInput( )->GetRequestedRegion( ); this->m_MaxVertex = r.GetIndex( ); this->m_MinVertex = r.GetIndex( ) + r.GetSize( ); } // ------------------------------------------------------------------------- template< class _TInput, class _TOutput > void DijkstraWithMeanAndVariance< _TInput, _TOutput >:: _PostComputeOutputValue( TNode& n ) { this->Superclass::_PostComputeOutputValue( n ); if( n.FrontId > 0 ) { this->m_MeanAndVar.AddValue( this->_GetInputValue( n.Vertex ) ); for( unsigned int i = 0; i < TTraits::Dimension; ++i ) { this->m_MinVertex[ i ] = ( n.Vertex[ i ] < this->m_MinVertex[ i ] )? n.Vertex[ i ]: this->m_MinVertex[ i ]; this->m_MaxVertex[ i ] = ( this->m_MaxVertex[ i ] < n.Vertex[ i ] )? n.Vertex[ i ]: this->m_MaxVertex[ i ]; } // rof } // fi } #endif // __DijkstraWithMeanAndVariance__hxx__ // eof - $RCSfile$