]> Creatis software - FrontAlgorithms.git/blobdiff - appli/CTBronchi/Process.cxx
...
[FrontAlgorithms.git] / appli / CTBronchi / Process.cxx
index 4261a97d197d0c1afb5abeedb74229055f973eb4..848a1f03673b51cd16602e377621bb891bbed3af 100644 (file)
@@ -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 );