1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
6 #ifndef __CTBronchi__MoriLabelling__hxx__
7 #define __CTBronchi__MoriLabelling__hxx__
9 // -------------------------------------------------------------------------
10 template< class _TInputImage, class _TLabelImage >
11 typename CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >::
12 TInputValue CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >::
13 GetUpperThreshold( ) const
15 return( this->m_LabelFunctor->GetUpperThreshold( ) );
18 // -------------------------------------------------------------------------
19 template< class _TInputImage, class _TLabelImage >
20 void CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >::
21 SetUpperThreshold( TInputValue t )
23 this->m_LabelFunctor->SetUpperThreshold( t );
26 // -------------------------------------------------------------------------
27 template< class _TInputImage, class _TLabelImage >
28 CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >::
32 this->m_LabelFunctor = TLabelFunctor::New( );
33 this->SetPredicate( this->m_LabelFunctor );
36 // -------------------------------------------------------------------------
37 template< class _TInputImage, class _TLabelImage >
38 CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >::
43 // -------------------------------------------------------------------------
44 template< class _TInputImage, class _TLabelImage >
45 void CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >::
46 _UpdateOutputValue( TNode& n )
48 this->Superclass::_UpdateOutputValue( n );
51 const TLabelImage* input_labels = this->GetInputLabels( );
52 if( input_labels->GetPixel( n.Vertex ) == this->GetInsideValue( ) )
53 n.Value = TOutputValue( 1 ); // this->GetInsideLabel( );
55 n.Value = TOutputValue( 0 );
57 if( input_labels->GetPixel( n.Vertex ) == this->GetInsideValue( ) )
62 #endif // __CTBronchi__MoriLabelling__hxx__