1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
6 #ifndef __fpa__Image__MarksInterface__hxx__
7 #define __fpa__Image__MarksInterface__hxx__
9 // -------------------------------------------------------------------------
10 template< unsigned int _VDim >
11 bool fpa::Image::MarksInterface< _VDim >::
12 _IsMarked( const TVertex& v ) const
14 return( this->m_Marks->GetPixel( v ) != 0 );
17 // -------------------------------------------------------------------------
18 template< unsigned int _VDim >
19 unsigned long fpa::Image::MarksInterface< _VDim >::
20 _GetMark( const TVertex& v ) const
22 return( this->m_Marks->GetPixel( v ) );
25 // -------------------------------------------------------------------------
26 template< unsigned int _VDim >
27 void fpa::Image::MarksInterface< _VDim >::
28 _Mark( const TVertex& v, unsigned long frontId )
30 this->m_Marks->SetPixel( v, frontId );
33 // -------------------------------------------------------------------------
34 template< unsigned int _VDim >
35 void fpa::Image::MarksInterface< _VDim >::
41 // -------------------------------------------------------------------------
42 template< unsigned int _VDim >
43 void fpa::Image::MarksInterface< _VDim >::
44 _InitMarks( unsigned long nSeeds )
46 this->Superclass::_InitMarks( nSeeds );
49 if( this->m_Filter == NULL )
51 if( this->m_Filter->GetInputs( ).size( ) == 0 )
53 itk::ImageBase< _VDim >* input =
54 dynamic_cast< itk::ImageBase< _VDim >* >(
55 this->m_Filter->GetInputs( )[ 0 ].GetPointer( )
60 // Reserve memory for marks
61 this->m_Marks = TMarks::New( );
62 this->m_Marks->CopyInformation( input );
63 this->m_Marks->SetRequestedRegion( input->GetRequestedRegion( ) );
64 this->m_Marks->SetBufferedRegion( input->GetBufferedRegion( ) );
65 this->m_Marks->Allocate( );
66 this->m_Marks->FillBuffer( 0 );
69 // -------------------------------------------------------------------------
70 template< unsigned int _VDim >
71 fpa::Image::MarksInterface< _VDim >::
72 MarksInterface( itk::ProcessObject* filter )
73 : Superclass( filter )
77 // -------------------------------------------------------------------------
78 template< unsigned int _VDim >
79 fpa::Image::MarksInterface< _VDim >::
84 #endif // __fpa__Image__MarksInterface__hxx__