]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Image/Dijkstra.hxx
bf6b5f09d67f99382f012d75b129d0921adf12bc
[FrontAlgorithms.git] / lib / fpa / Image / Dijkstra.hxx
1 #ifndef __fpa__Image__Dijkstra__hxx__
2 #define __fpa__Image__Dijkstra__hxx__
3
4 #include <fpa/Image/Functors/SimpleDijkstraCost.h>
5
6 // -------------------------------------------------------------------------
7 template< class _TInputImage, class _TOutputImage >
8 fpa::Image::Dijkstra< _TInputImage, _TOutputImage >::
9 Dijkstra( )
10   : Superclass( )
11 {
12   typedef
13     fpa::Image::Functors::SimpleDijkstraCost< _TInputImage, TOutput >
14     _TCost;
15
16   typename _TCost::Pointer cost = _TCost::New( );
17   this->SetCostFunction( cost );
18 }
19
20 // -------------------------------------------------------------------------
21 template< class _TInputImage, class _TOutputImage >
22 fpa::Image::Dijkstra< _TInputImage, _TOutputImage >::
23 ~Dijkstra( )
24 {
25 }
26
27 // -------------------------------------------------------------------------
28 template< class _TInputImage, class _TOutputImage >
29 void fpa::Image::Dijkstra< _TInputImage, _TOutputImage >::
30 _BeforeGenerateData( )
31 {
32   this->Superclass::_BeforeGenerateData( );
33
34   TCostFunction* cost =
35     dynamic_cast< TCostFunction* >( this->GetCostFunction( ) );
36   if( cost == NULL )
37     itkExceptionMacro( << "CostFunction not well defined." );
38   cost->SetImage( this->GetInput( ) );
39 }
40
41 #endif // __fpa__Image__Dijkstra__hxx__
42
43 // eof - $RCSfile$