]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Image/Dijkstra.h
...
[FrontAlgorithms.git] / lib / fpa / Image / Dijkstra.h
index 4e5105ca90b65b99dfb2747813af60dae0bfdedd..f4da12311e397fb839c18209c31ff19475a108e0 100644 (file)
@@ -5,6 +5,7 @@
 #include <itkImageToImageFilter.h>
 #include <fpa/Base/Dijkstra.h>
 #include <fpa/Image/Algorithm.h>
+#include <fpa/Image/MinimumSpanningTree.h>
 #include <fpa/Image/Functors/ImageCostFunction.h>
 
 namespace fpa
@@ -15,13 +16,12 @@ namespace fpa
      * @param I Input image type
      * @param O Output image type
      */
-    template< class I, class O >
+    template< class I, class O = I >
     class Dijkstra
-      : public Algorithm< I, O, fpa::Base::Dijkstra< typename I::IndexType, typename I::PixelType, typename O::PixelType, itk::ImageToImageFilter< I, O > > >
+      : public Algorithm< I, O, fpa::Base::Dijkstra< typename I::IndexType, typename I::PixelType, typename O::PixelType, I, itk::Functor::IndexLexicographicCompare< I::ImageDimension >, fpa::Image::MinimumSpanningTree< I::ImageDimension >, itk::ImageToImageFilter< I, O > > >
     {
     public:
-      typedef fpa::Base::Dijkstra< typename I::IndexType, typename I::PixelType, typename O::PixelType, itk::ImageToImageFilter< I, O > > TBaseAlgorithm;
-
+      typedef fpa::Base::Dijkstra< typename I::IndexType, typename I::PixelType, typename O::PixelType, I, itk::Functor::IndexLexicographicCompare< I::ImageDimension >, fpa::Image::MinimumSpanningTree< I::ImageDimension >, itk::ImageToImageFilter< I, O > > TBaseAlgorithm;
       typedef Dijkstra                          Self;
       typedef Algorithm< I, O, TBaseAlgorithm > Superclass;
       typedef itk::SmartPointer< Self >         Pointer;
@@ -32,6 +32,21 @@ namespace fpa
       typedef typename Superclass::TVertex      TVertex;
       typedef typename Superclass::TValue       TValue;
       typedef typename Superclass::TResult      TResult;
+      typedef typename Superclass::TSpace       TSpace;
+
+      typedef typename Superclass::TStartEvent     TStartEvent;
+      typedef typename Superclass::TStartLoopEvent TStartLoopEvent;
+      typedef typename Superclass::TEndEvent       TEndEvent;
+      typedef typename Superclass::TEndLoopEvent   TEndLoopEvent;
+      typedef typename Superclass::TAliveEvent     TAliveEvent;
+      typedef typename Superclass::TFrontEvent     TFrontEvent;
+      typedef typename Superclass::TFreezeEvent    TFreezeEvent;
+
+      typedef typename Superclass::TStartBacktrackingEvent TStartBacktrackingEvent;
+      typedef typename Superclass::TEndBacktrackingEvent TEndBacktrackingEvent;
+      typedef typename Superclass::TBacktrackingEvent TBacktrackingEvent;
+
+      typedef typename TBaseAlgorithm::TMinimumSpanningTree TMinimumSpanningTree;
 
       typedef fpa::Image::Functors::ImageCostFunction< TInputImage, TResult > TCostFunction;
       typedef itk::FunctionBase< TResult, TResult > TConversionFunction;
@@ -61,10 +76,11 @@ namespace fpa
       Dijkstra( );
       virtual ~Dijkstra( );
 
-      virtual TResult _Cost( const TVertex& v, const TVertex& p ) const;
+      virtual TResult _Cost( const TVertex& v, const TVertex& p ) const ITK_OVERRIDE;
 
-      virtual void _BeforeGenerateData( );
-      virtual void _InitResults( );
+      virtual void _BeforeGenerateData( ) ITK_OVERRIDE;
+      virtual void _AfterGenerateData( ) ITK_OVERRIDE;
+      virtual void _InitResults( ) ITK_OVERRIDE;
 
     private:
       // Purposely not implemented
@@ -80,7 +96,9 @@ namespace fpa
 
 } // ecapseman
 
+#ifndef ITK_MANUAL_INSTANTIATION
 #include <fpa/Image/Dijkstra.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
 
 #endif // __FPA__IMAGE__DIJKSTRA__H__