-// -------------------------------------------------------------------------
-template< class I, class O >
-void fpa::Image::Dijkstra< I, O >::
-_InitResults( )
-{
- this->Superclass::_InitResults( );
- this->GetOutput( )->FillBuffer( std::numeric_limits< TResult >::max( ) );
+ TCostFunction* cost =
+ dynamic_cast< TCostFunction* >( this->GetCostFunction( ) );
+ if( cost == NULL )
+ itkExceptionMacro( << "CostFunction not well defined." );
+ cost->SetImage( this->GetInput( ) );