X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=appli%2FCTBronchi%2FMori.h;fp=appli%2FCTBronchi%2FMori.h;h=4693d19d6cc07aadc16fb9afb542ab161a8a0343;hb=b4c7827278cd914c18ee5404fb636c87e8099b24;hp=a228fa54d059870dfc357dd7664b2f0f80381a02;hpb=b69a5d04d117c1fdd297999c4fb034db54911aca;p=FrontAlgorithms.git diff --git a/appli/CTBronchi/Mori.h b/appli/CTBronchi/Mori.h index a228fa5..4693d19 100644 --- a/appli/CTBronchi/Mori.h +++ b/appli/CTBronchi/Mori.h @@ -12,22 +12,26 @@ namespace CTBronchi { // ----------------------------------------------------------------------- - template< class _TInputPtr, class _TOutputPtr > - void Mori( - _TOutputPtr& output, const _TInputPtr& input, - const std::map< std::string, std::string >& args + template< class _TInputPtr, class _TOutputPtr, class _TSeed > + typename _TInputPtr::ObjectType::PixelType Mori( + _TOutputPtr& output, const _TInputPtr& input, _TSeed& seed, + std::map< std::string, std::string >& args ) { typedef typename _TInputPtr::ObjectType _TInput; typedef typename _TOutputPtr::ObjectType _TOutput; typedef fpa::Filters::Image::Mori< _TInput, _TOutput > _TMori; - typedef typename _TInput::PixelType _TInputPixel; + typedef typename _TInput::PixelType _TInputPixel; + typedef typename _TOutput::PixelType _TOutputPixel; + + _TOutputPixel i_val = _TOutputPixel( 1 ); + _TOutputPixel o_val = _TOutputPixel( 0 ); typename _TMori::Pointer mori = _TMori::New( ); mori->SetInput( input ); - mori->SetSeed( global_seed ); - mori->SetInsideValue( inside_value ); - mori->SetOutsideValue( outside_value ); + mori->SetSeed( seed ); + mori->SetInsideValue( i_val ); + mori->SetOutsideValue( o_val ); mori->SetMinimumThreshold( _TInputPixel( std::atof( args[ "mori_minimum_threshold" ].c_str( ) ) ) ); @@ -69,13 +73,13 @@ namespace CTBronchi signal << x << " " << y << std::endl; } // rof - std::ofstream signals_str( i->second.c_str( ) ); signals_str << signal.str( ); signals_str.close( ); } // fi output->DisconnectPipeline( ); + return( mori->GetOptimumThreshold( ) ); } } // ecapseman