- Dijkstra( )
- : Superclass( )
- {
- typedef fpa::Image::Functors::Dijkstra::Identity< TInputImage, TOutputValue > _TDefaultFunction;
- this->SetWeightFunction( _TDefaultFunction::New( ) );
- }
- virtual ~Dijkstra( )
- {
- }
-
- virtual void _ConfigureOutput( const TOutputValue& v ) override
- {
- this->Superclass::_ConfigureOutput( v );
- const TInputImage* in = this->GetInput( );
-
- TMST* mst = this->GetMinimumSpanningTree( );
- mst->SetLargestPossibleRegion( in->GetLargestPossibleRegion( ) );
- mst->SetRequestedRegion( in->GetRequestedRegion( ) );
- mst->SetBufferedRegion( in->GetBufferedRegion( ) );
- mst->SetSpacing( in->GetSpacing( ) );
- mst->SetOrigin( in->GetOrigin( ) );
- mst->SetDirection( in->GetDirection( ) );
- mst->Allocate( );
-
- typename TMST::PixelType zero;
- zero.Fill( 0 );
- mst->FillBuffer( zero );
- }
-
- virtual void _BeforeGenerateData( ) override
- {
- this->Superclass::_BeforeGenerateData( );
- TWeightFunction* wf =
- dynamic_cast< TWeightFunction* >( this->GetWeightFunction( ) );
- if( wf != NULL )
- wf->SetImage( this->GetInput( ) );
- }