#ifndef __CTBronchi__MoriLabelling__h__
#define __CTBronchi__MoriLabelling__h__
-#include <itkMinimumMaximumImageCalculator.h>
+#include <itkStatisticsImageFilter.h>
#include <fpa/Filters/BaseMarksInterface.h>
#include <fpa/Filters/Image/SeedsFromLabelsInterface.h>
#include <fpa/Filters/Image/DefaultTraits.h>
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 =
- ( this->m_VesselnessThreshold / double( 100 ) ) *
- double( minMax->GetMaximum( ) );
+ typedef itk::StatisticsImageFilter< _TScalarImage > _TStats;
+ typename _TStats::Pointer stats = _TStats::New( );
+ stats->SetInput( this->GetInputVesselness( ) );
+ stats->Update( );
+ double vAvg = double( stats->GetMean( ) );
+ double vStd = double( stats->GetSigma( ) );
+ double vMin = double( stats->GetMinimum( ) );
+ double vMax = double( stats->GetMaximum( ) );
+
+ this->m_MinVesselness = vAvg + ( vStd * double( 5 ) );
+ /* TODO
+ std::cout
+ << vAvg << std::endl
+ << vStd << std::endl
+ << vMin << std::endl
+ << vMax << std::endl;
+
+ std::cout
+ << ( this->m_VesselnessThreshold / double( 100 ) ) * double( vMax )
+ << std::endl
+ << vAvg + ( vStd * double( 3 ) ) << std::endl;
+
+ std::exit( 1 );
+ */
+ /* TODO
+ this->m_MinVesselness =
+ ( this->m_VesselnessThreshold / double( 100 ) ) *
+ double( stats->GetMaximum( ) );
+ */
}
virtual void _PostComputeOutputValue( TNode& n ) override