// -------------------------------------------------------------------------
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( );
}
// -------------------------------------------------------------------------
// Create labels
TLabelImage::Pointer labels;
- Label( labels, mori );
+ Label( labels, input_image, mori );
return( 0 );