func->SetUpper( t );
}
+// -------------------------------------------------------------------------
+template< class _TInputImage, class _TLabelImage >
+typename CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >::
+TOutputValue CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >::
+GetOutsideValue( ) const
+{
+ return( this->GetInitValue( ) );
+}
+
+// -------------------------------------------------------------------------
+template< class _TInputImage, class _TLabelImage >
+void CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >::
+SetOutsideLabel( TOutputValue o )
+{
+ this->SetInitValue( o );
+}
+
// -------------------------------------------------------------------------
template< class _TInputImage, class _TLabelImage >
CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >::
MoriLabelling( )
: Superclass( ),
- m_InsideLabel( TOutputValue( 0 ) ),
- m_OutsideLabel( TOutputValue( 0 ) )
+ m_InsideLabel( TOutputValue( 0 ) )
{
typename TThresholdFunction::Pointer func = TThresholdFunction::New( );
this->SetPredicate( func );
void CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >::
_UpdateOutputValue( TNode& n )
{
- const TInputImage* input = this->GetInputRawImage( );
- const TLabelImage* labels = this->GetInputLabelImage( );
-}
-
-
-/* TODO
- TOutputValue m_InsideValue;
- TOutputValue m_InsideLabel;
- TOutputValue m_OutsideLabel;
-*/
-
-
-
-
-
-
-
-
-
-
-/* TODO
-#include <itkImageRegionConstIterator.h>
-#include <itkImageRegionIterator.h>
-
-// -------------------------------------------------------------------------
-template< class _TInputImage, class _TLabelImage >
-const _TLabelImage*
-CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >::
-GetInputLabelImage( ) const
-{
- return( this->GetInput( ) );
-}
-
-// -------------------------------------------------------------------------
-template< class _TInputImage, class _TLabelImage >
-void CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >::
-SetInputLabelImage( TLabelImage* image )
-{
- this->SetInput( image );
-}
-
-// -------------------------------------------------------------------------
-template< class _TInputImage, class _TLabelImage >
-const _TInputImage*
-CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >::
-GetInputRawImage( ) const
-{
- return(
- dynamic_cast< const TInputImage* >(
- this->itk::ProcessObject::GetInput( 1 )
- )
- );
-}
-
-// -------------------------------------------------------------------------
-template< class _TInputImage, class _TLabelImage >
-void CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >::
-SetInputRawImage( TInputImage* image )
-{
- this->itk::ProcessObject::SetNthInput( 1, image );
-}
+ const TLabelImage* input_labels = this->GetInputLabelImage( );
-// -------------------------------------------------------------------------
-template< class _TInputImage, class _TLabelImage >
-CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >::
-MoriLabelling( )
- : Superclass( ),
- m_UpperThreshold( TOutputValue( 0 ) ),
- m_InsideValue( TOutputValue( 0 ) ),
- m_InsideLabel( TOutputValue( 0 ) ),
- m_OutsideLabel( TOutputValue( 0 ) )
-{
- this->SetNumberOfRequiredInputs( 2 );
-}
-
-// -------------------------------------------------------------------------
-template< class _TInputImage, class _TLabelImage >
-CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >::
-~MoriLabelling( )
-{
-}
-
-// -------------------------------------------------------------------------
-template< class _TInputImage, class _TLabelImage >
-void CTBronchi::MoriLabelling< _TInputImage, _TLabelImage >::
-ThreadedGenerateData( const TRegion& region, itk::ThreadIdType threadId )
-{
- itk::ImageRegionConstIterator< TLabelImage >
- lIt( this->GetInputLabelImage( ), region );
- itk::ImageRegionConstIterator< TInputImage >
- iIt( this->GetInputRawImage( ), region );
- itk::ImageRegionIterator< TLabelImage >
- oIt( this->GetOutput( ), region );
-
- lIt.GoToBegin( );
- iIt.GoToBegin( );
- oIt.GoToBegin( );
- while( !( lIt.IsAtEnd( ) || iIt.IsAtEnd( ) || oIt.IsAtEnd( ) ) )
+ this->Superclass::_UpdateOutputValue( n );
+ if( n.FrontId != 0 )
{
- if( lIt.Get( ) != this->m_InsideValue )
- {
- if( this->m_UpperThreshold < iIt.Get( ) )
- oIt.Set( this->m_OutsideLabel );
- else
- oIt.Set( TOutputValue( 0 ) );
- }
+ if( input_labels->GetPixel( n.Vertex ) == this->GetInsideValue( ) )
+ n.Value = this->GetInsideLabel( );
else
- oIt.Set( this->m_InsideLabel );
- ++lIt;
- ++iIt;
- ++oIt;
+ n.Value = TOutputValue( 0 );
+ this->TAlgorithm::_UpdateOutputValue( n );
- } // elihw
+ } // fi
}
-*/
#endif // __CTBronchi__MoriLabelling__hxx__