+ MoriLabelling( )
+ : Superclass( ),
+ m_VesselnessThreshold( 5 ),
+ m_UpperThreshold( -650 )
+ {
+ ivqITKInputConfigureMacro( InputLabels, _TLabels );
+ ivqITKInputConfigureMacro( InputVesselness, _TScalarImage );
+ this->m_Functor = TFunctor::New( );
+ this->SetPredicate( this->m_Functor );
+ }
+
+ virtual ~MoriLabelling( )
+ {
+ }
+
+ virtual const itk::DataObject* _GetReferenceInput( ) const override
+ {
+ return( this->GetInputLabels( ) );
+ }
+ virtual void _BeforeGenerateData( ) override
+ {
+ this->Superclass::_BeforeGenerateData( );
+
+ this->m_Functor->SetUpperThreshold( this->m_UpperThreshold );
+
+ typedef itk::MinimumMaximumImageCalculator< _TScalarImage > _TMinMax;
+ typename _TMinMax::Pointer minMax = _TMinMax::New( );
+ minMax->SetImage( this->GetInputVesselness( ) );
+ minMax->Compute( );
+ this->m_MinVesselness =
+ ( 1.0 - ( this->m_VesselnessThreshold / double( 100 ) ) ) *
+ double( minMax->GetMaximum( ) );
+ }
+
+ virtual void _PostComputeOutputValue( TNode& n ) override
+ {
+ this->Superclass::_PostComputeOutputValue( n );
+ if( n.Value == this->GetInsideValue( ) )
+ {
+ const _TLabels* labels = this->GetInputLabels( );
+ const _TScalarImage* vesselness = this->GetInputVesselness( );
+ if( labels->GetPixel( n.Vertex ) == 0 )
+ {
+ if( this->m_MinVesselness < vesselness->GetPixel( n.Vertex ) )
+ n.Value = this->GetInsideValue( );
+ else
+ n.Value = 0;
+
+ } // fi
+
+ } // fi
+ }