X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FImage%2FDijkstra.h;h=24c06438c01885c54e184881e3f3edb33cdc64d8;hb=c9542e420b94b0bfc1f285599f7816eab1191519;hp=4e5105ca90b65b99dfb2747813af60dae0bfdedd;hpb=b70a564ee2d7bc180b77a05c37ab431ab9c393e7;p=FrontAlgorithms.git diff --git a/lib/fpa/Image/Dijkstra.h b/lib/fpa/Image/Dijkstra.h index 4e5105c..24c0643 100644 --- a/lib/fpa/Image/Dijkstra.h +++ b/lib/fpa/Image/Dijkstra.h @@ -1,87 +1,70 @@ -#ifndef __FPA__IMAGE__DIJKSTRA__H__ -#define __FPA__IMAGE__DIJKSTRA__H__ +// ========================================================================= +// @author Leonardo Florez Valencia +// @email florez-l@javeriana.edu.co +// ========================================================================= + +#ifndef __fpa__Image__Dijkstra__h__ +#define __fpa__Image__Dijkstra__h__ -#include -#include #include #include -#include +#include +#include +#include namespace fpa { namespace Image { /** - * @param I Input image type - * @param O Output image type */ - template< class I, class O > + template< class _TInputImage, class _TOutputImage, class _TFrontId = unsigned char > class Dijkstra - : public Algorithm< I, O, fpa::Base::Dijkstra< typename I::IndexType, typename I::PixelType, typename O::PixelType, itk::ImageToImageFilter< I, O > > > + : public fpa::Base::Dijkstra< fpa::Image::Algorithm< fpa::Image::DefaultTraits< _TInputImage, _TOutputImage, _TFrontId > >, fpa::Image::MinimumSpanningTree< _TInputImage::ImageDimension > > { public: - typedef fpa::Base::Dijkstra< typename I::IndexType, typename I::PixelType, typename O::PixelType, 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 typename Superclass::TInputImage TInputImage; - typedef typename Superclass::TOutputImage TOutputImage; + typedef _TInputImage TInputImage; + typedef _TOutputImage TOutputImage; + typedef _TFrontId TFrontId; + typedef fpa::Image::MinimumSpanningTree< _TInputImage::ImageDimension > TMST; + + typedef fpa::Image::DefaultTraits< TInputImage, TOutputImage, TFrontId > TTraits; + typedef fpa::Image::Algorithm< TTraits > TAlgorithm; + typedef fpa::Base::Dijkstra< TAlgorithm, TMST > Superclass; + typedef Dijkstra Self; + typedef itk::SmartPointer< Self > Pointer; + typedef itk::SmartPointer< const Self > ConstPointer; + + typedef typename Superclass::TOutputValue TOutputValue; typedef typename Superclass::TVertex TVertex; - typedef typename Superclass::TValue TValue; - typedef typename Superclass::TResult TResult; - 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 fpa::Image::Functors::Dijkstra::Function< TInputImage, TOutputValue > TWeightFunction; 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; - - virtual void _BeforeGenerateData( ); - virtual void _InitResults( ); + virtual void _BeforeGenerateData( ) override; + virtual void _ConfigureOutput( const TOutputValue& v ) override; private: - // Purposely not implemented + // Purposely not implemented. Dijkstra( const Self& other ); Self& operator=( const Self& other ); - - protected: - typename TCostFunction::Pointer m_CostFunction; - typename TConversionFunction::Pointer m_ConversionFunction; }; } // ecapseman } // ecapseman -#include +#ifndef ITK_MANUAL_INSTANTIATION +# include +#endif // ITK_MANUAL_INSTANTIATION -#endif // __FPA__IMAGE__DIJKSTRA__H__ +#endif // __fpa__Image__Dijkstra__h__ // eof - $RCSfile$