X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=appli%2FCTBronchi%2FProcess.cxx;h=848a1f03673b51cd16602e377621bb891bbed3af;hb=b6c80dbd5be1caf6cbdbfc21d2075021c57d7af2;hp=4261a97d197d0c1afb5abeedb74229055f973eb4;hpb=03200c96631e0c6e35b5be9c78d651185efcbdf2;p=FrontAlgorithms.git diff --git a/appli/CTBronchi/Process.cxx b/appli/CTBronchi/Process.cxx index 4261a97..848a1f0 100644 --- a/appli/CTBronchi/Process.cxx +++ b/appli/CTBronchi/Process.cxx @@ -133,8 +133,25 @@ void Mori( _TOutputPtr& output, const _TInputPtr& input ) // ------------------------------------------------------------------------- template< class _TInputPtr, class _TOutputPtr > -void Label( _TOutputPtr& output, const _TInputPtr& input ) +void Label( _TOutputPtr& output, const _TInputPtr& input, const _TOutputPtr& labels ) { + typedef typename _TInputPtr::ObjectType _TInput; + typedef typename _TOutputPtr::ObjectType _TOutput; + typedef CTBronchi::MoriLabelling< _TInput, _TOutput > _TLabelling; + + typename _TLabelling::Pointer labelling = _TLabelling::New( ); + labelling->SetInput( input ); + labelling->SetInputLabels( labels ); + // TODO: labelling->SetOutsideValue( ); // out label + // TODO: labelling->SetInsideValue( ); // inside label + // TODO: labelling->SetUpperThreshold( ); + double t = MeasureTime( labelling ); + std::cout << "Labelling executed in " << t << " s" << std::endl; + output = labelling->GetOutput( ); + TMap::const_iterator i = Args.find( "out_labels" ); + if( i != Args.end( ) ) + WriteImage( output, i->second ); + output->DisconnectPipeline( ); } // ------------------------------------------------------------------------- @@ -206,7 +223,7 @@ int main( int argc, char* argv[] ) // Create labels TLabelImage::Pointer labels; - Label( labels, mori ); + Label( labels, input_image, mori ); return( 0 );