1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
6 #ifndef __fpa__Image__Dijkstra__h__
7 #define __fpa__Image__Dijkstra__h__
9 #include <fpa/Base/Dijkstra.h>
10 #include <fpa/Base/SeedsInterface.h>
11 #include <fpa/Image/MarksInterface.h>
12 #include <fpa/Image/Filter.h>
13 #include <fpa/Image/MinimumSpanningTree.h>
14 #include <fpa/Image/Functors/VertexParentBase.h>
22 template< class _TInputImage, class _TOutputImage >
24 : public fpa::Base::Dijkstra< fpa::Image::Filter< _TInputImage, _TOutputImage >, fpa::Image::MarksInterface< _TInputImage::ImageDimension >, fpa::Base::SeedsInterface< typename _TInputImage::IndexType, typename _TInputImage::IndexType::LexicographicCompare >, fpa::Image::MinimumSpanningTree< _TInputImage::ImageDimension > >
28 typedef fpa::Image::Filter< _TInputImage, _TOutputImage > TFilter;
29 typedef fpa::Image::MarksInterface< _TInputImage::ImageDimension > TMarksInterface;
30 typedef fpa::Base::SeedsInterface< typename _TInputImage::IndexType, typename _TInputImage::IndexType::LexicographicCompare > TSeedsInterface;
31 typedef fpa::Image::MinimumSpanningTree< _TInputImage::ImageDimension > TMST;
34 typedef Dijkstra Self;
35 typedef fpa::Base::Dijkstra< TFilter, TMarksInterface, TSeedsInterface, TMST > Superclass;
36 typedef itk::SmartPointer< Self > Pointer;
37 typedef itk::SmartPointer< const Self > ConstPointer;
39 typedef typename TFilter::TInputImage TInputImage;
40 typedef typename TFilter::TOutputValue TOutputValue;
41 typedef typename TFilter::TVertex TVertex;
45 itkTypeMacro( fpa::Image::Dijkstra, fpa::Base::Dijkstra );
48 Dijkstra( ) : Superclass( ) { }
49 virtual ~Dijkstra( ) { }
51 virtual void _ConfigureOutputs( const TOutputValue& init_value ) override
53 this->Superclass::_ConfigureOutputs( init_value );
55 typename TVertex::OffsetType o;
57 const TInputImage* input = this->GetInput( );
58 TMST* mst = this->GetMinimumSpanningTree( );
59 mst->CopyInformation( input );
60 mst->SetBufferedRegion( input->GetRequestedRegion( ) );
65 virtual void GenerateData( ) override
67 // Configure functors with input image
68 typedef typename TFilter::TOutputValue _TOutputValue;
69 typedef fpa::Image::Functors::VertexParentBase< _TInputImage, _TOutputValue > _TVFunc;
71 dynamic_cast< _TVFunc* >( this->m_VertexFunctor.GetPointer( ) );
73 vfunc->SetImage( this->GetInput( ) );
76 this->Superclass::GenerateData( );
80 Dijkstra( const Self& other );
81 Self& operator=( const Self& other );
88 #endif // __fpa__Image__Dijkstra__h__