]> Creatis software - cpPlugins.git/blobdiff - appli/examples/plugins/ImageTracer.cxx
...
[cpPlugins.git] / appli / examples / plugins / ImageTracer.cxx
diff --git a/appli/examples/plugins/ImageTracer.cxx b/appli/examples/plugins/ImageTracer.cxx
deleted file mode 100644 (file)
index cff73bd..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-#include <cpExtensions/Config.h>
-
-#ifdef cpExtensions_QT4
-
-#include <cpExtensions/QT/ImageWidget.h>
-#include <cpExtensions/Visualization/WindowLevelImageActor.h>
-#include <cpPlugins/Interface/Workspace.h>
-
-#include <QApplication>
-#include <QWidget>
-#include <QMainWindow>
-#include <QHBoxLayout>
-
-#include <vtkImageData.h>
-#include <vtkPolyData.h>
-
-#endif // cpExtensions_QT4
-
-//----------------------------------------------------------------------------
-int main( int argc, char* argv[] )
-{
-#ifdef cpExtensions_QT4
-
-  // Manage inputs
-  if( argc < 2 )
-  {
-    std::cerr << "Usage: " << argv[ 0 ] << " image_file(s)" << std::endl;
-    return( 1 );
-
-  } // fi
-
-  // Create interface
-  cpPlugins::Interface::Plugins::Pointer interface =
-    cpPlugins::Interface::Plugins::New( );
-  try
-  {
-    interface->LoadEnvironments( );
-    interface->GuessPlugins( );
-  }
-  catch( std::exception& err )
-  {
-    std::cerr << "Error caught: " << err.what( ) << std::endl;
-    return( 1 );
-
-  } // yrt
-
-  // Create workspace
-  typedef cpPlugins::Interface::Workspace _TWorkspace;
-  _TWorkspace::Pointer ws = _TWorkspace::New( );
-  ws->PrintExecutionOn( );
-  ws->Load( argv[ 1 ] );
-
-  // Configure filters
-  /* TODO
-     auto reader = ws->CreateFilter( "IO", "ImageReader", "reader" );
-     auto widget = ws->CreateFilter( "Widgets", "SplineWidget", "spline" );
-     ws->Connect( "reader", "spline", "Output", "Input" );
-     auto params = reader->GetParameters( );
-     for( int i = 1; i < argc; ++i )
-     params->AddToOpenFileNameList( "FileNames",  argv[ i ] );
-  */
-  auto reader = ws->GetFilter( "reader" );
-  auto spline = ws->GetFilter( "spline" );
-  auto seeds = ws->GetFilter( "seeds" );
-  auto axis = ws->GetFilter( "axis" );
-  auto writer = ws->GetFilter( "writer" );
-  auto raster = ws->GetFilter( "raster" );
-
-  // Execute reader
-  try
-  {
-    reader->Update( );
-  }
-  catch( std::exception& err )
-  {
-    std::cerr << "Error caugth: " << err.what( ) << std::endl;
-    return( 1 );
-
-  } // yrt
-
-  // Qt initialization
-  QApplication app( argc, argv );
-  QMainWindow wnd;
-  wnd.setGeometry( 0, 0, 1024, 768 );
-  cpExtensions::QT::ImageWidget view( &wnd );
-  view.SetImage(
-    reader->GetOutputData< vtkImageData >( "Output" ), 2, "image"
-    );
-  spline->AddInteractor( view.GetInteractor( ) );
-  seeds->AddInteractor( view.GetInteractor( ) );
-  spline->Update( );
-  seeds->Update( );
-
-  // Start application and show data
-  wnd.setCentralWidget( &view );
-  wnd.show( );
-  app.exec( );
-  spline->Modified( );
-  spline->Update( );
-  raster->Update( );
-  writer->Update( );
-
-  wnd.show( );
-  app.exec( );
-  
-  seeds->Modified( );
-  seeds->Update( );
-  axis->Update( );
-  // view.Add( axis->GetOutputData< vtkPolyData >( "Output" ) );
-  wnd.show( );
-  return( app.exec( ) );
-
-  // TODO: widget->GetOutputData< vtkPolyData >( "Output" )->Print( std::cout );
-
-  /*
-    auto raster = ws->CreateFilter( "MeshToImageFilters", "RasterMeshFilter", "raster" );
-    ws->Connect( "spline", "raster", "Output", "Input" );
-    ws->Connect( "reader", "raster", "Output", "Template" );
-    raster->Update( );
-  */
-  
-#else // cpExtensions_QT4
-  return( 0 );
-#endif // cpExtensions_QT4
-}
-
-// eof - $RCSfile$