]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Image/Dijkstra.h
...
[FrontAlgorithms.git] / lib / fpa / Image / Dijkstra.h
index f4da12311e397fb839c18209c31ff19475a108e0..118cc27abc76593139574fc50b05d344e15a6006 100644 (file)
@@ -1,95 +1,44 @@
-#ifndef __FPA__IMAGE__DIJKSTRA__H__
-#define __FPA__IMAGE__DIJKSTRA__H__
+#ifndef __fpa__Image__Dijkstra__h__
+#define __fpa__Image__Dijkstra__h__
 
-#include <itkFunctionBase.h>
-#include <itkImageToImageFilter.h>
 #include <fpa/Base/Dijkstra.h>
 #include <fpa/Image/Algorithm.h>
 #include <fpa/Image/MinimumSpanningTree.h>
-#include <fpa/Image/Functors/ImageCostFunction.h>
+#include <fpa/Image/Functors/Base.h>
 
 namespace fpa
 {
   namespace Image
   {
     /**
-     * @param I Input image type
-     * @param O Output image type
      */
-    template< class I, class O = I >
+    template< class _TInputImage, class _TOutputImage >
     class Dijkstra
-      : 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 fpa::Base::Dijkstra< fpa::Image::Algorithm< _TInputImage, _TOutputImage >, fpa::Image::MinimumSpanningTree< _TInputImage::ImageDimension > >
     {
     public:
-      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;
-      typedef itk::SmartPointer< const Self >   ConstPointer;
+      typedef Dijkstra                                             Self;
+      typedef fpa::Image::Algorithm< _TInputImage, _TOutputImage > TAlgorithm;
+      typedef fpa::Image::MinimumSpanningTree< _TInputImage::ImageDimension > TMST;
+      typedef fpa::Base::Dijkstra< TAlgorithm, TMST > Superclass;
+      typedef itk::SmartPointer< Self >               Pointer;
+      typedef itk::SmartPointer< const Self >         ConstPointer;
 
-      typedef typename Superclass::TInputImage  TInputImage;
-      typedef typename Superclass::TOutputImage TOutputImage;
-      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;
-
-    protected:
-      typedef typename Superclass::_TVertices      _TVertices;
-      typedef typename Superclass::_TCollision     _TCollision;
-      typedef typename Superclass::_TCollisionsRow _TCollisionsRow;
-      typedef typename Superclass::_TCollisions    _TCollisions;
-      typedef typename Superclass::_TNode          _TNode;
-      typedef typename Superclass::_TNodes         _TNodes;
+      typedef typename Superclass::TOutput TOutput;
+      typedef typename Superclass::TVertex TVertex;
 
     public:
       itkNewMacro( Self );
-      itkTypeMacro( Dijkstra, Algorithm );
-
-      itkGetObjectMacro( CostFunction, TCostFunction );
-      itkGetObjectMacro( ConversionFunction, TConversionFunction );
-
-      itkGetConstObjectMacro( CostFunction, TCostFunction );
-      itkGetConstObjectMacro( ConversionFunction, TConversionFunction );
-
-      itkSetObjectMacro( CostFunction, TCostFunction );
-      itkSetObjectMacro( ConversionFunction, TConversionFunction );
+      itkTypeMacro( fpa::Image::Dijkstra, fpa::Base::Dijkstra );
 
     protected:
       Dijkstra( );
       virtual ~Dijkstra( );
 
-      virtual TResult _Cost( const TVertex& v, const TVertex& p ) const ITK_OVERRIDE;
-
-      virtual void _BeforeGenerateData( ) ITK_OVERRIDE;
-      virtual void _AfterGenerateData( ) ITK_OVERRIDE;
-      virtual void _InitResults( ) ITK_OVERRIDE;
-
     private:
-      // Purposely not implemented
+      // Purposely not defined
       Dijkstra( const Self& other );
       Self& operator=( const Self& other );
-
-    protected:
-      typename TCostFunction::Pointer m_CostFunction;
-      typename TConversionFunction::Pointer m_ConversionFunction;
     };
 
   } // ecapseman
@@ -97,9 +46,9 @@ namespace fpa
 } // ecapseman
 
 #ifndef ITK_MANUAL_INSTANTIATION
-#include <fpa/Image/Dijkstra.hxx>
+#  include <fpa/Image/Dijkstra.hxx>
 #endif // ITK_MANUAL_INSTANTIATION
 
-#endif // __FPA__IMAGE__DIJKSTRA__H__
+#endif // __fpa__Image__Dijkstra__h__
 
 // eof - $RCSfile$