1 #ifndef __FPA__IMAGE__DIJKSTRA__H__
2 #define __FPA__IMAGE__DIJKSTRA__H__
4 #include <itkFunctionBase.h>
5 #include <itkImageToImageFilter.h>
6 #include <fpa/Base/Dijkstra.h>
7 #include <fpa/Image/Algorithm.h>
8 #include <fpa/Image/Functors/ImageCostFunction.h>
15 * @param I Input image type
16 * @param O Output image type
18 template< class I, class O = I >
20 : public Algorithm< I, O, fpa::Base::Dijkstra< typename I::IndexType, typename I::PixelType, typename O::PixelType, I, itk::Functor::IndexLexicographicCompare< I::ImageDimension >, itk::ImageToImageFilter< I, O > > >
23 typedef fpa::Base::Dijkstra< typename I::IndexType, typename I::PixelType, typename O::PixelType, I, itk::Functor::IndexLexicographicCompare< I::ImageDimension >, itk::ImageToImageFilter< I, O > > TBaseAlgorithm;
25 typedef Dijkstra Self;
26 typedef Algorithm< I, O, TBaseAlgorithm > Superclass;
27 typedef itk::SmartPointer< Self > Pointer;
28 typedef itk::SmartPointer< const Self > ConstPointer;
30 typedef typename Superclass::TInputImage TInputImage;
31 typedef typename Superclass::TOutputImage TOutputImage;
32 typedef typename Superclass::TVertex TVertex;
33 typedef typename Superclass::TValue TValue;
34 typedef typename Superclass::TResult TResult;
35 typedef typename Superclass::TSpace TSpace;
36 typedef typename Superclass::TMinimumSpanningTree TMinimumSpanningTree;
38 typedef typename Superclass::TStartEvent TStartEvent;
39 typedef typename Superclass::TStartLoopEvent TStartLoopEvent;
40 typedef typename Superclass::TEndEvent TEndEvent;
41 typedef typename Superclass::TEndLoopEvent TEndLoopEvent;
42 typedef typename Superclass::TAliveEvent TAliveEvent;
43 typedef typename Superclass::TFrontEvent TFrontEvent;
44 typedef typename Superclass::TFreezeEvent TFreezeEvent;
46 typedef typename Superclass::TStartBacktrackingEvent TStartBacktrackingEvent;
47 typedef typename Superclass::TEndBacktrackingEvent TEndBacktrackingEvent;
48 typedef typename Superclass::TBacktrackingEvent TBacktrackingEvent;
50 typedef fpa::Image::Functors::ImageCostFunction< TInputImage, TResult > TCostFunction;
51 typedef itk::FunctionBase< TResult, TResult > TConversionFunction;
54 typedef typename Superclass::_TVertices _TVertices;
55 typedef typename Superclass::_TCollision _TCollision;
56 typedef typename Superclass::_TCollisionsRow _TCollisionsRow;
57 typedef typename Superclass::_TCollisions _TCollisions;
58 typedef typename Superclass::_TNode _TNode;
59 typedef typename Superclass::_TNodes _TNodes;
63 itkTypeMacro( Dijkstra, Algorithm );
65 itkGetObjectMacro( CostFunction, TCostFunction );
66 itkGetObjectMacro( ConversionFunction, TConversionFunction );
68 itkGetConstObjectMacro( CostFunction, TCostFunction );
69 itkGetConstObjectMacro( ConversionFunction, TConversionFunction );
71 itkSetObjectMacro( CostFunction, TCostFunction );
72 itkSetObjectMacro( ConversionFunction, TConversionFunction );
78 virtual TResult _Cost( const TVertex& v, const TVertex& p ) const;
80 virtual void _BeforeGenerateData( );
81 virtual void _InitResults( );
84 // Purposely not implemented
85 Dijkstra( const Self& other );
86 Self& operator=( const Self& other );
89 typename TCostFunction::Pointer m_CostFunction;
90 typename TConversionFunction::Pointer m_ConversionFunction;
97 #include <fpa/Image/Dijkstra.hxx>
99 #endif // __FPA__IMAGE__DIJKSTRA__H__