From: Leonardo Flórez-Valencia Date: Tue, 11 Jul 2017 14:38:02 +0000 (-0500) Subject: ... X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;ds=sidebyside;h=7a0591e1611721f36428cee7d7cce6161f517612;p=FrontAlgorithms.git ... --- diff --git a/appli/CTBronchi/MoriLabelling.h b/appli/CTBronchi/MoriLabelling.h index 105c7d0..f1ac2ea 100644 --- a/appli/CTBronchi/MoriLabelling.h +++ b/appli/CTBronchi/MoriLabelling.h @@ -7,6 +7,11 @@ #define __CTBronchi__MoriLabelling__h__ #include +#include +#include + +#include + namespace CTBronchi { @@ -55,6 +60,35 @@ namespace CTBronchi MoriLabelling( ); virtual ~MoriLabelling( ); + virtual void BeforeThreadedGenerateData( ) override + { + this->Superclass::BeforeThreadedGenerateData( ); + + const TInputImage* raw = this->GetInputRawImage( ); + typename TInputImage::SpacingType spac = raw->GetSpacing( ); + double sigma = spac[ 0 ]; + for( unsigned int d = 1; d < TInputImage::ImageDimension; ++d ) + sigma = ( spac[ d ] < sigma )? spac[ d ]: sigma; + sigma *= 1.5; + + typedef itk::HessianRecursiveGaussianImageFilter< TInputImage > _THessian; + typename _THessian::Pointer hessian = _THessian::New( ); + hessian->SetInput( raw ); + hessian->SetSigma( sigma ); + + typedef itk::Hessian3DToVesselnessMeasureImageFilter< double > _TVesselness; + typename _TVesselness::Pointer vesselness = _TVesselness::New( ); + vesselness->SetInput( hessian->GetOutput( ) ); + vesselness->SetAlpha1( 0.5 ); + vesselness->SetAlpha2( 2.0 ); + + typename itk::ImageFileWriter< typename _TVesselness::OutputImageType >::Pointer w = + itk::ImageFileWriter< typename _TVesselness::OutputImageType >::New( ); + w->SetInput( vesselness->GetOutput( ) ); + w->SetFileName( "vessel.mhd" ); + w->Update( ); + } + virtual void ThreadedGenerateData( const TRegion& region, itk::ThreadIdType threadId ) override; private: