#ifndef __fpa__Image__Functors__VertexCost__hxx__ #define __fpa__Image__Functors__VertexCost__hxx__ // ------------------------------------------------------------------------- template< class _TImage, class _TOutput > typename fpa::Image::Functors::VertexCost< _TImage, _TOutput >:: TOutput fpa::Image::Functors::VertexCost< _TImage, _TOutput >:: Evaluate( const TIndex& a, const TIndex& b ) const { const _TImage* im = dynamic_cast< const _TImage* >( this->m_Image.GetPointer( ) ); TOutput coeff = TOutput( 1 ); if( this->m_UseImageSpacing ) { typename _TImage::PointType pa, pb; im->TransformIndexToPhysicalPoint( a, pa ); im->TransformIndexToPhysicalPoint( b, pb ); coeff = TOutput( pa.EuclideanDistanceTo( pb ) ); } // fi return( TOutput( im->GetPixel( a ) ) * coeff ); } // ------------------------------------------------------------------------- template< class _TImage, class _TOutput > fpa::Image::Functors::VertexCost< _TImage, _TOutput >:: VertexCost( ) : Superclass( ), m_UseImageSpacing( false ) { } // ------------------------------------------------------------------------- template< class _TImage, class _TOutput > fpa::Image::Functors::VertexCost< _TImage, _TOutput >:: ~VertexCost( ) { } #endif // __fpa__Image__Functors__VertexCost__hxx__ // eof - $RCSfile$