1 #ifndef __FPA__BASE__EXTRACTPATHFROMMINIMUMSPANNINGTREE__HXX__
2 #define __FPA__BASE__EXTRACTPATHFROMMINIMUMSPANNINGTREE__HXX__
4 // -------------------------------------------------------------------------
6 const T* fpa::Base::ExtractPathFromMinimumSpanningTree< T >::
10 dynamic_cast< const T* >( this->itk::ProcessObject::GetInput( 0 ) )
14 // -------------------------------------------------------------------------
16 void fpa::Base::ExtractPathFromMinimumSpanningTree< T >::
17 SetInput( const T* tree )
19 this->itk::ProcessObject::SetNthInput( 0, const_cast< T* >( tree ) );
22 // -------------------------------------------------------------------------
24 typename fpa::Base::ExtractPathFromMinimumSpanningTree< T >::
25 TPath* fpa::Base::ExtractPathFromMinimumSpanningTree< T >::
29 itkDynamicCastInDebugMode< TPath* >( this->GetPrimaryOutput( ) )
33 // -------------------------------------------------------------------------
35 fpa::Base::ExtractPathFromMinimumSpanningTree< T >::
36 ExtractPathFromMinimumSpanningTree( )
39 this->itk::ProcessObject::SetNumberOfRequiredInputs( 1 );
41 typename TPath::Pointer out = TPath::New( );
42 this->itk::ProcessObject::SetNumberOfRequiredOutputs( 1 );
43 this->itk::ProcessObject::SetNthOutput( 0, out.GetPointer( ) );
46 // -------------------------------------------------------------------------
48 fpa::Base::ExtractPathFromMinimumSpanningTree< T >::
49 ~ExtractPathFromMinimumSpanningTree( )
53 // -------------------------------------------------------------------------
55 void fpa::Base::ExtractPathFromMinimumSpanningTree< T >::
58 auto tree = this->GetInput( );
59 auto path = this->GetOutput( );
61 auto lst = tree->GetPath( this->m_Vertex0, this->m_Vertex1 );
63 for( auto i = lst.begin( ); i != lst.end( ); ++i )
64 path->AddVertex( *i );
65 path->SetReferenceImage( tree );
68 #endif // __FPA__BASE__EXTRACTPATHFROMMINIMUMSPANNINGTREE__HXX__