]> Creatis software - cpMesh.git/commitdiff
Read/Write image plugin integration
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Tue, 9 Dec 2014 17:46:07 +0000 (18:46 +0100)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Tue, 9 Dec 2014 17:46:07 +0000 (18:46 +0100)
appli/InteractiveDeformableMeshSegmentation/CMakeLists.txt
appli/InteractiveDeformableMeshSegmentation/MainWnd.cxx
appli/InteractiveDeformableMeshSegmentation/MainWnd.h
appli/InteractiveDeformableMeshSegmentation/MainWnd.ui
appli/InteractiveDeformableMeshSegmentation/idms.plugins
appli/InteractiveDeformableMeshSegmentation/main.cxx

index dfa2d8ce552db1a656593cfdd3646ac757d03125..e360d5c98b2f13ac6f33d07a251be7252fce388e 100644 (file)
@@ -62,6 +62,7 @@ IF(BUILD_FINAL_APPLICATION)
   TARGET_LINK_LIBRARIES(
     ${App_NAME}
     cpm
+    ${cpPlugins_Interface_LIBRARIES}
     ${QT_LIBRARIES}
     ${ITK_LIBRARIES}
     ${VTK_LIBRARIES}
@@ -70,7 +71,12 @@ IF(BUILD_FINAL_APPLICATION)
   CONFIGURE_FILE(
     idms.plugins
     ${PROJECT_BINARY_DIR}/idms.plugins
-    COPYONLY
+    @ONLY
+    )
+  CONFIGURE_FILE(
+    idms.config
+    ${PROJECT_BINARY_DIR}/idms.config
+    @COPYONLY
     )
 ENDIF(BUILD_FINAL_APPLICATION)
 
index 51c0ac178c5dc2b3f8fd141870cedc4f373a1966..bde4b4a9fb7db8274b42c919958df94cc5b50269 100644 (file)
@@ -1,76 +1,41 @@
 #include "MainWnd.h"
 #include "ui_MainWnd.h"
 
+#include <algorithm>
+#include <cctype>
 #include <fstream>
-#include <limits>
-#include <map>
-#include <set>
-#include <sstream>
-
-#include <QDialog>
-#include <QDialogButtonBox>
-#include <QDoubleSpinBox>
+
 #include <QFileDialog>
-#include <QGridLayout>
-#include <QHBoxLayout>
-#include <QLabel>
 #include <QMessageBox>
-#include <QVBoxLayout>
-
-#include <itkGDCMImageIO.h>
-#include <itkImageFileReader.h>
-#include <itkImageSeriesReader.h>
 
+#include <vtkAnnotatedCubeActor.h>
+#include <vtkAxesActor.h>
+#include <vtkPropAssembly.h>
+#include <vtkProperty.h>
 #include <vtkRenderWindow.h>
 
-/*
-  #include "ui_SegmentationParametersDlg.h"
-
-  #include <set>
-
-
-  #include <itkImageFileWriter.h>
-  #include <itkMinimumMaximumImageCalculator.h>
-  #include <itkBinaryMask3DMeshSource.h>
-
-  #include <itkIdentityTransform.h>
-  #include <itkLinearInterpolateImageFunction.h>
-  #include <itkResampleImageFilter.h>
-  #include <itkSignedDanielssonDistanceMapImageFilter.h>
-  #include <vtkImageMarchingCubes.h>
-  #include <cpm/VTK/PolyDataToMeshFilter.h>
-  #include <itkBinaryMinMaxCurvatureFlowImageFilter.h>
-  #include <itkLaplacianRecursiveGaussianImageFilter.h>
-  #include <itkThresholdImageFilter.h>
-  #include <itkSubtractImageFilter.h>
-
-  #include <vtkAnnotatedCubeActor.h>
-  #include <vtkAxesActor.h>
-  #include <vtkPropAssembly.h>
-  #include <vtkProperty.h>
-  #include <vtkTextProperty.h>
-  #include <vtkCallbackCommand.h>
-
-  #include <vtkCamera.h>
-*/
+#include <cpPlugins/Interface/Image.h>
 
 // -------------------------------------------------------------------------
-#define IDMS_QT_ACTION( action )                                   \
-  QObject::connect(                                                \
-    this->m_UI->a##action, SIGNAL( triggered( ) ),                 \
-    this, SLOT( triggered_a##action( ) )                           \
+#define IDMS_QT_ACTION( name )                                         \
+  QObject::connect(                                                    \
+    this->m_UI->action##name, SIGNAL( triggered( ) ),                  \
+    this, SLOT( _triggered_action##name( ) )                           \
     )
 
 // -------------------------------------------------------------------------
 MainWnd::MainWnd( QWidget* parent )
   : QMainWindow( parent ),
-    m_UI( new Ui::MainWnd )
+    m_UI( new Ui::MainWnd ),
+    m_InputImage( NULL ),
+    m_SegmentedImage( NULL )
 {
   this->m_UI->setupUi( this );
 
-  // Configure strings
-  this->m_LastOpenedFile = ".";
+  // Configuration files
+  this->m_ApplicationPreferencesFile = "idms.config";
   this->m_PluginsConfigurationFile = "idms.plugins";
+  this->_LoadApplicationPreferences( );
 
   // Create and associate renderers
   this->m_3DRenderer = vtkSmartPointer< vtkRenderer >::New( );
@@ -111,76 +76,69 @@ MainWnd::MainWnd( QWidget* parent )
   this->m_UI->m_ZPlaneVTK->GetInteractor( )->
     SetInteractorStyle( this->m_ZStyle );
 
-  /*
-    vtkSmartPointer< vtkCallbackCommand > z_callback =
-    vtkSmartPointer< vtkCallbackCommand >::New( );
-    z_callback->SetCallback( MainWnd::_SliceEventCallback );
-    z_callback->SetClientData( this );
-    zstyle->AddObserver( idms::InteractorStyleImage::SliceEvent, z_callback );
-
-    // Orientation marks
-    vtkSmartPointer< vtkAnnotatedCubeActor > oCube =
+  // Orientation marks
+  vtkSmartPointer< vtkAnnotatedCubeActor > oCube =
     vtkSmartPointer< vtkAnnotatedCubeActor >::New( );
-    oCube->GetCubeProperty( )->SetColor( 0.9, 0.7, 0.2 );
-    oCube->GetTextEdgesProperty( )->SetLineWidth( 1 );
-    oCube->GetTextEdgesProperty( )->SetDiffuse( 0 );
-    oCube->GetTextEdgesProperty( )->SetAmbient( 1 );
-    oCube->GetTextEdgesProperty( )->SetColor( 0.18, 0.28, 0.23 );
-    oCube->GetXPlusFaceProperty( )->SetColor( 1, 0, 0 );
-    oCube->GetXPlusFaceProperty( )->SetInterpolationToFlat( );
-    oCube->GetXMinusFaceProperty( )->SetColor( 1, 0, 0 );
-    oCube->GetXMinusFaceProperty( )->SetInterpolationToFlat( );
-    oCube->GetYPlusFaceProperty( )->SetColor( 0, 1, 0 );
-    oCube->GetYPlusFaceProperty( )->SetInterpolationToFlat( );
-    oCube->GetYMinusFaceProperty( )->SetColor( 0, 1, 0 );
-    oCube->GetYMinusFaceProperty( )->SetInterpolationToFlat( );
-    oCube->GetZPlusFaceProperty( )->SetColor( 0, 0, 1 );
-    oCube->GetZPlusFaceProperty( )->SetInterpolationToFlat( );
-    oCube->GetZMinusFaceProperty( )->SetColor( 0, 0, 1 );
-    oCube->GetZMinusFaceProperty( )->SetInterpolationToFlat( );
-
-    vtkSmartPointer< vtkAxesActor > oAxes =
+  oCube->GetCubeProperty( )->SetColor( 0.9, 0.7, 0.2 );
+  oCube->GetTextEdgesProperty( )->SetLineWidth( 1 );
+  oCube->GetTextEdgesProperty( )->SetDiffuse( 0 );
+  oCube->GetTextEdgesProperty( )->SetAmbient( 1 );
+  oCube->GetTextEdgesProperty( )->SetColor( 0.18, 0.28, 0.23 );
+  oCube->GetXPlusFaceProperty( )->SetColor( 1, 0, 0 );
+  oCube->GetXPlusFaceProperty( )->SetInterpolationToFlat( );
+  oCube->GetXMinusFaceProperty( )->SetColor( 1, 0, 0 );
+  oCube->GetXMinusFaceProperty( )->SetInterpolationToFlat( );
+  oCube->GetYPlusFaceProperty( )->SetColor( 0, 1, 0 );
+  oCube->GetYPlusFaceProperty( )->SetInterpolationToFlat( );
+  oCube->GetYMinusFaceProperty( )->SetColor( 0, 1, 0 );
+  oCube->GetYMinusFaceProperty( )->SetInterpolationToFlat( );
+  oCube->GetZPlusFaceProperty( )->SetColor( 0, 0, 1 );
+  oCube->GetZPlusFaceProperty( )->SetInterpolationToFlat( );
+  oCube->GetZMinusFaceProperty( )->SetColor( 0, 0, 1 );
+  oCube->GetZMinusFaceProperty( )->SetInterpolationToFlat( );
+
+  vtkSmartPointer< vtkAxesActor > oAxes =
     vtkSmartPointer< vtkAxesActor >::New( );
-    oAxes->AxisLabelsOff( );
-    oAxes->SetShaftTypeToCylinder( );
-    oAxes->SetTotalLength( 2.5, 2.5, 2.5 );
+  oAxes->AxisLabelsOff( );
+  oAxes->SetShaftTypeToCylinder( );
+  oAxes->SetTotalLength( 2.5, 2.5, 2.5 );
 
-    vtkSmartPointer< vtkPropAssembly > oActors =
+  vtkSmartPointer< vtkPropAssembly > oActors =
     vtkSmartPointer< vtkPropAssembly >::New( );
-    oActors->AddPart( oCube );
-    oActors->AddPart( oAxes );
+  oActors->AddPart( oCube );
+  oActors->AddPart( oAxes );
 
-    this->m_3DOrientationWidget =
+  this->m_3DOrientationWidget =
     vtkSmartPointer< vtkOrientationMarkerWidget >::New( );
-    this->m_3DOrientationWidget->SetOutlineColor( 0.93, 0.57, 0.13 );
-    this->m_3DOrientationWidget->SetOrientationMarker( oActors );
-    this->m_3DOrientationWidget->SetViewport( 0.0, 0.0, 0.2, 0.2 );
+  this->m_3DOrientationWidget->SetOutlineColor( 0.93, 0.57, 0.13 );
+  this->m_3DOrientationWidget->SetOrientationMarker( oActors );
+  this->m_3DOrientationWidget->SetViewport( 0.0, 0.0, 0.2, 0.2 );
 
-    // Add actors, widgets, stuff, ...
-    this->m_3DOrientationWidget->
+  // Add actors, widgets, stuff, ...
+  this->m_3DOrientationWidget->
     SetInteractor( this->m_UI->m_3DVTK->GetInteractor( ) );
-    this->m_3DOrientationWidget->SetEnabled( 1 );
-    this->m_3DOrientationWidget->InteractiveOff( );
+  this->m_3DOrientationWidget->SetEnabled( 1 );
+  this->m_3DOrientationWidget->InteractiveOff( );
 
-    IDMS_QT_ACTION( aLoadInputImage );
-    IDMS_QT_ACTION( aLoadSegmentedImage );
-  */
   // Qt signals <-> slots
+  IDMS_QT_ACTION( ReloadPlugins );
+  IDMS_QT_ACTION( OpenInputImage );
+  IDMS_QT_ACTION( OpenSegmentedImage );
   QObject::connect(
-    this->m_UI->aNavigation, SIGNAL( triggered( ) ),
-    this, SLOT( triggered_aSwitchMode( ) )
+    this->m_UI->actionNavigation, SIGNAL( triggered( ) ),
+    this, SLOT( _triggered_actionSwitchMode( ) )
     );
   QObject::connect(
-    this->m_UI->aSegmentationInteractiveDeformation, SIGNAL( triggered( ) ),
-    this, SLOT( triggered_aSwitchMode( ) )
+    this->m_UI->actionSegmentationInteractiveDeformation,
+    SIGNAL( triggered( ) ),
+    this, SLOT( _triggered_actionSwitchMode( ) )
     );
 
-  IDMS_QT_ACTION( OpenInputImage );
-  IDMS_QT_ACTION( OpenSegmentedImage );
-  IDMS_QT_ACTION( ReloadPlugins );
+  // Historic configuration
+  this->m_LastOpenedFile = ".";
 
   // Start: load all disponible plugins
-  this->triggered_aReloadPlugins( );
+  this->_triggered_actionReloadPlugins( );
 }
 
 // -------------------------------------------------------------------------
@@ -188,34 +146,463 @@ MainWnd::
 ~MainWnd( )
 {
   delete this->m_UI;
+  if( this->m_InputImage != NULL ) delete this->m_InputImage;
+  if( this->m_SegmentedImage != NULL ) delete this->m_SegmentedImage;
+}
+
+// -------------------------------------------------------------------------
+void MainWnd::
+_LoadApplicationPreferences( )
+{
+  this->m_ApplicationPreferences.clear( );
+  std::ifstream in( this->m_ApplicationPreferencesFile.c_str( ) );
+  if( in )
+  {
+    std::string line;
+    std::getline( in, line );
+    while( !( in.eof( ) ) )
+    {
+      long pos = line.find_last_of( "=" );
+      std::string key = line.substr( 0, pos );
+      std::string value = line.substr( pos + 1 );
+      key.erase(
+        std::remove_if( key.begin( ), key.end( ), isspace ), key.end( )
+        );
+      value.erase(
+        std::remove_if( value.begin( ), value.end( ), isspace ), value.end( )
+        );
+      this->m_ApplicationPreferences[ key ] = value;
+      std::getline( in, line );
+
+    } // elihw
+  }
+  else
+  {
+    this->m_ApplicationPreferences[ "data_dimensions" ] = "3";
+    this->m_ApplicationPreferences[ "input_image_type" ]  = "short";
+    this->m_ApplicationPreferences[ "segmented_image_type" ]  = "uchar";
+    this->m_ApplicationPreferences[ "mesh_type" ]  = "double";
+
+  } // fi
+  in.close( );
+}
+
+// -------------------------------------------------------------------------
+MainWnd::
+TPluginData* MainWnd::
+_LoadImage( const std::string& image_type, const std::string& image_dim )
+{
+  // Show dialog and check if it was accepted
+  QFileDialog dialog( this );
+  dialog.setFileMode( QFileDialog::ExistingFiles );
+  dialog.setDirectory( tr( this->m_LastOpenedFile.c_str( ) ) );
+  dialog.setNameFilter(
+    tr( "Medical image files (*.mhd *.bin *.dcm);;All files (*)" )
+    );
+  dialog.setDefaultSuffix( tr( "mhd" ) );
+  if( !( dialog.exec( ) ) )
+    return( NULL );
+
+  TPluginData* ret = NULL;
+  unsigned int nFiles = dialog.selectedFiles( ).size( );
+  if( nFiles == 1 )
+  {
+    if( this->m_ImageReaderClassName == "" )
+    {
+      QMessageBox::critical(
+        this,
+        tr( "No plugin to read a single image file found!" ),
+        tr( "No plugin to read a single image file found!" )
+        );
+      return( ret );
+
+    } // fi
+
+    std::string fname = dialog.selectedFiles( ).at( 0 ).toStdString( );
+    this->m_LastOpenedFile = fname;
+
+    TPlugin* reader =
+      dynamic_cast< TPlugin* >(
+        this->m_Plugins.CreateObject( this->m_ImageReaderClassName )
+        );
+
+    TParameters reader_params = reader->GetDefaultParameters( );
+    reader_params[ "FileName" ].second = fname;
+    reader_params[ "PixelType" ].second = image_type;
+    reader_params[ "ImageDimension" ].second = image_dim;
+    reader_params[ "IsColorImage" ].second = "0";
+    reader->SetParameters( reader_params );
+    std::string err = reader->Update( );
+
+    if( err == "" )
+    {
+      ret = reader->GetOutput( 0 );
+      reader->DisconnectOutputs( );
+    }
+    else
+      QMessageBox::critical(
+        this,
+        tr( "Error reading single image" ),
+        tr( err.c_str( ) )
+        );
+    delete reader;
+    return( ret );
+  }
+  else if( nFiles > 1 )
+  {
+    if( this->m_ImageSeriesReaderClassName == "" )
+    {
+      QMessageBox::critical(
+        this,
+        tr( "No plugin to read an image series found!" ),
+        tr( "No plugin to read an image series found!" )
+        );
+      return( ret );
+
+    } // fi
+
+    /* TODO
+       std::string fname = dialog.selectedFiles( ).at( 0 ).toStdString( );
+       this->m_LastOpenedFile = fname;
+    */
+    return( ret );
+
+  } // fi
+  return( ret );
 }
 
 // -------------------------------------------------------------------------
 void MainWnd::
 _UpdateEnabledFlags( )
 {
-  bool img = this->m_Image.IsNotNull( );
+  bool img = ( this->m_InputImage != NULL );
   this->m_UI->menuSegmentInputImage->setEnabled( img );
-  this->m_UI->aOpenSegmentedImage->setEnabled( img );
+  this->m_UI->actionOpenSegmentedImage->setEnabled( img );
   this->m_UI->m_3DVTK->setEnabled( img );
   this->m_UI->m_XPlaneVTK->setEnabled( img );
   this->m_UI->m_YPlaneVTK->setEnabled( img );
   this->m_UI->m_ZPlaneVTK->setEnabled( img );
   this->m_UI->m_AuxVTK->setEnabled( img );
 
-  bool seg = this->m_Segmentation.IsNotNull( );
-  this->m_UI->menuFilterSegmentedImage->setEnabled( seg );
-  this->m_UI->menuExtractMesh->setEnabled( seg );
-  this->m_UI->aOpenMesh->setEnabled( seg );
+  /* TODO
+     bool seg = this->m_Segmentation.IsNotNull( );
+     this->m_UI->menuFilterSegmentedImage->setEnabled( seg );
+     this->m_UI->menuExtractMesh->setEnabled( seg );
+     this->m_UI->actionOpenMesh->setEnabled( seg );
+
+     this->m_UI->actionNavigation->setEnabled( img && seg );
+     this->m_UI->actionSegmentationInteractiveDeformation->
+     setEnabled( img && seg );
+  */
+}
 
-  this->m_UI->aNavigation->setEnabled( img && seg );
-  this->m_UI->aSegmentationInteractiveDeformation->setEnabled( img && seg );
+// -------------------------------------------------------------------------
+void MainWnd::
+_triggered_actionReloadPlugins( )
+{
+  this->m_Plugins.UnloadAll( );
+
+  this->m_ImageReaderClassName = "";
+  this->m_ImageSeriesReaderClassName = "";
+  this->m_ImageWriterClassName = "";
+
+  std::ifstream in( this->m_PluginsConfigurationFile.c_str( ) );
+  if( in )
+  {
+    std::string plugin;
+    std::getline( in, plugin );
+    while( !( in.eof( ) ) )
+    {
+      if( this->m_Plugins.Load( plugin ) )
+      {
+        TPluginsInterface::TClassesIterator cIt =
+          this->m_Plugins.GetClasses( ).begin( );
+        TPluginsInterface::TClassesIterator end_cIt =
+          this->m_Plugins.GetClasses( ).end( );
+        for( ; cIt != end_cIt; ++cIt )
+        {
+          std::string c_name = cIt->first;
+          c_name = c_name.substr( c_name.find_last_of( ":" ) + 1 );
+          if( c_name == "ImageReader" )
+          {
+            this->m_ImageReaderClassName = cIt->first;
+          }
+          else if( c_name == "ImageWriter" )
+          {
+            this->m_ImageWriterClassName = cIt->first;
+          }
+          else
+          {
+          } // fi
+          
+        } // rof
+
+        /* TODO
+           TFilterPlugins::TClassesIterator cIt =
+           this->m_Plugins.BeginClasses( );
+           for( ; cIt != this->m_Plugins.EndClasses( ); ++cIt )
+           {
+           TFilterObject* filter =
+           this->m_Plugins.CreateObject( cIt->first );
+           if( filter == NULL )
+           continue;
+           std::string cat = filter->GetCategory( );
+           std::string catType = cat.substr( cat.find_last_of( ":" ) );
+           if( catType == ":BinaryImageToBinaryImageFilter" )
+           {
+           QAction* action = this->m_UI->menuFilterSegmentedImage->
+           addAction( QString( cIt->first.c_str( ) ) );
+           QObject::connect(
+           action, SIGNAL( triggered( ) ),
+           this, SLOT( triggered_aFilterSegmentedImage( ) )
+           );
+           }
+           else if( catType == ":ImageToMeshFilter" )
+           {
+           QAction* action = this->m_UI->menuExtractMesh->
+           addAction( QString( cIt->first.c_str( ) ) );
+           QObject::connect(
+           action, SIGNAL( triggered( ) ),
+           this, SLOT( triggered_aSegmentedImageToMesh( ) )
+           );
+
+           } // fi
+           delete filter;
+           } // rof
+        */
+      }
+      else
+      {
+        QMessageBox::warning(
+          this,
+          tr( "Ignoring plugin" ),
+          tr( plugin.c_str( ) )
+          );
+
+      } // fi
+      std::getline( in, plugin );
+
+    } // elihw
+  }
+  else
+  {
+    QMessageBox::critical(
+      this,
+      tr( "No plugins file loaded!" ),
+      tr( this->m_PluginsConfigurationFile.c_str( ) )
+      );
+
+  } // fi
+  in.close( );
+
+  if( this->m_ImageReaderClassName == "" )
+  {
+    QMessageBox::critical(
+      this,
+      tr( "No ImageReader found in plugins!" ),
+      tr( this->m_PluginsConfigurationFile.c_str( ) )
+      );
+
+  } // fi
+
+  if( this->m_ImageWriterClassName == "" )
+  {
+    QMessageBox::critical(
+      this,
+      tr( "No ImageWriter found in plugins!" ),
+      tr( this->m_PluginsConfigurationFile.c_str( ) )
+      );
+
+  } // fi
+  this->_UpdateEnabledFlags( );
+}
+
+// -------------------------------------------------------------------------
+void MainWnd::
+_triggered_actionOpenInputImage( )
+{
+  if( this->m_InputImage != NULL )
+    delete this->m_InputImage;
+  this->m_InputImage =
+    this->_LoadImage(
+      this->m_ApplicationPreferences[ "input_image_type" ],
+      this->m_ApplicationPreferences[ "data_dimensions" ]
+      );
+  if( this->m_InputImage != NULL )
+  {
+    cpPlugins::Interface::Image* img = 
+      dynamic_cast< cpPlugins::Interface::Image* >( this->m_InputImage );
+    this->m_ImageActors->Configure(
+      img->GetVTKImageData( ),
+      this->m_UI->m_XPlaneVTK->GetInteractor( ),
+      this->m_UI->m_YPlaneVTK->GetInteractor( ),
+      this->m_UI->m_ZPlaneVTK->GetInteractor( )
+      );
+    this->m_ImageActors->
+      AddAuxiliaryInteractor( this->m_UI->m_3DVTK->GetInteractor( ) );
+
+    // Associate actors
+    this->m_3DRenderer->AddActor(
+      this->m_ImageActors->GetImageOutlineActor( )
+      );
+    this->m_3DRenderer->AddActor(
+      this->m_ImageActors->GetXBoundsActor( )
+      );
+    this->m_3DRenderer->AddActor(
+      this->m_ImageActors->GetYBoundsActor( )
+      );
+    this->m_3DRenderer->AddActor(
+      this->m_ImageActors->GetZBoundsActor( )
+      );
+
+    // Reset all cameras
+    this->m_3DRenderer->ResetCamera( );
+    this->m_ImageActors->ResetCameras( );
+
+    // Ok, start!
+    this->m_UI->m_3DVTK->GetRenderWindow( )->Render( );
+    this->m_UI->m_XPlaneVTK->GetRenderWindow( )->Render( );
+    this->m_UI->m_YPlaneVTK->GetRenderWindow( )->Render( );
+    this->m_UI->m_ZPlaneVTK->GetRenderWindow( )->Render( );
+
+    // Update activations
+    this->_UpdateEnabledFlags( );
+    this->m_UI->actionNavigation->setChecked( true );
+    this->_triggered_actionSwitchMode( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void MainWnd::
+_triggered_actionOpenSegmentedImage( )
+{
+  if( this->m_SegmentedImage != NULL )
+    delete this->m_SegmentedImage;
+  this->m_SegmentedImage =
+    this->_LoadImage(
+      this->m_ApplicationPreferences[ "segmented_image_type" ],
+      this->m_ApplicationPreferences[ "data_dimensions" ]
+      );
+  if( this->m_SegmentedImage != NULL )
+  {
+    cpPlugins::Interface::Image* img = 
+      dynamic_cast< cpPlugins::Interface::Image* >( this->m_SegmentedImage );
+    this->m_ImageActors->SetSegmentation( img->GetVTKImageData( ) );
+
+    // Ok, start!
+    this->m_UI->m_XPlaneVTK->GetRenderWindow( )->Render( );
+    this->m_UI->m_YPlaneVTK->GetRenderWindow( )->Render( );
+    this->m_UI->m_ZPlaneVTK->GetRenderWindow( )->Render( );
+    this->_UpdateEnabledFlags( );
+
+    /*
+    this->m_ImageActors->Configure(
+    img->GetVTKImageData( ),
+      this->m_UI->m_XPlaneVTK->GetInteractor( ),
+      this->m_UI->m_YPlaneVTK->GetInteractor( ),
+      this->m_UI->m_ZPlaneVTK->GetInteractor( )
+      );
+    this->m_ImageActors->
+      AddAuxiliaryInteractor( this->m_UI->m_3DVTK->GetInteractor( ) );
+
+    // Associate actors
+    this->m_3DRenderer->AddActor(
+      this->m_ImageActors->GetImageOutlineActor( )
+      );
+    this->m_3DRenderer->AddActor(
+      this->m_ImageActors->GetXBoundsActor( )
+      );
+    this->m_3DRenderer->AddActor(
+      this->m_ImageActors->GetYBoundsActor( )
+      );
+    this->m_3DRenderer->AddActor(
+      this->m_ImageActors->GetZBoundsActor( )
+      );
+
+    // Reset all cameras
+    this->m_3DRenderer->ResetCamera( );
+    this->m_ImageActors->ResetCameras( );
+
+    // Ok, start!
+    this->m_UI->m_3DVTK->GetRenderWindow( )->Render( );
+    this->m_UI->m_XPlaneVTK->GetRenderWindow( )->Render( );
+    this->m_UI->m_YPlaneVTK->GetRenderWindow( )->Render( );
+    this->m_UI->m_ZPlaneVTK->GetRenderWindow( )->Render( );
+
+    // Update activations
+    this->_UpdateEnabledFlags( );
+    this->m_UI->actionNavigation->setChecked( true );
+    this->_triggered_actionSwitchMode( );
+    */
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void MainWnd::
+_triggered_actionSwitchMode( )
+{
+  QAction* snd = dynamic_cast< QAction* >( this->sender( ) );
+  if( snd == this->m_UI->actionNavigation )
+  {
+    this->m_UI->actionSegmentationInteractiveDeformation->setChecked(
+      !( this->m_UI->actionNavigation->isChecked( ) )
+      );
+  }
+  else if( snd == this->m_UI->actionSegmentationInteractiveDeformation )
+  {
+    this->m_UI->actionNavigation->setChecked(
+      !( this->m_UI->actionSegmentationInteractiveDeformation->isChecked( ) )
+      );
+  }
+  else
+  {
+    this->m_UI->actionNavigation->setChecked( true );
+    this->m_UI->actionSegmentationInteractiveDeformation->setChecked( false );
+
+  } // fi
 
   /* TODO
-     menuProcessMesh
+     if( this->m_UI->aNavigation->isChecked( ) )
+     {
+     this->m_XStyle->SetModeToNavigation( );
+     this->m_YStyle->SetModeToNavigation( );
+     this->m_ZStyle->SetModeToNavigation( );
+     this->m_ImageActors->HideRegion( 0 );
+     this->m_ImageActors->HideRegion( 1 );
+     this->m_ImageActors->HideRegion( 2 );
+     this->m_3DRenderer->RemoveActor(
+     this->m_ImageActors->GetCursorActor( )
+     );
+     this->m_3DRenderer->RemoveActor(
+     this->m_ImageActors->GetRegionActor( )
+     );
+     this->m_UI->m_3DVTK->GetRenderWindow( )->Render( );
+     }
+     else if( this->m_UI->aSegmentationInteractiveDeformation->isChecked( ) )
+     {
+     this->m_XStyle->SetModeToDeformation( );
+     this->m_YStyle->SetModeToDeformation( );
+     this->m_ZStyle->SetModeToDeformation( );
+     this->m_ImageActors->ShowRegion( 0 );
+     this->m_ImageActors->ShowRegion( 1 );
+     this->m_ImageActors->ShowRegion( 2 );
+     this->m_3DRenderer->AddActor(
+     this->m_ImageActors->GetCursorActor( )
+     );
+     this->m_3DRenderer->AddActor(
+     this->m_ImageActors->GetRegionActor( )
+     );
+     this->m_UI->m_3DVTK->GetRenderWindow( )->Render( );
+
+     } // fi
   */
 }
 
+// -------------------------------------------------------------------------
+/* TODO
+
 // -------------------------------------------------------------------------
 bool MainWnd::
 _ParametersDialog( TParameters& parameters )
@@ -319,217 +706,94 @@ _ParametersDialog( TParameters& parameters )
     return( true );
   }
   return( false );
-}
+  }
 
-// -------------------------------------------------------------------------
-template< class I >
-bool MainWnd::
-_LoadImage( typename I::Pointer& image )
-{
+  // -------------------------------------------------------------------------
+  template< class I >
+  bool MainWnd::
+  _LoadImage( typename I::Pointer& image )
+  {
   QStringList qList =
-    QFileDialog::getOpenFileNames(
-      this,
-      tr( "Open an image" ),
-      tr( this->m_LastOpenedFile.c_str( ) ),
-      tr( "Medical image files (*.mhd *.bin *.dcm);;All files (*)" )
-      );
+  QFileDialog::getOpenFileNames(
+  this,
+  tr( "Open an image" ),
+  tr( this->m_LastOpenedFile.c_str( ) ),
+  tr( "Medical image files (*.mhd *.bin *.dcm);;All files (*)" )
+  );
   if( qList.size( ) == 0 )
-    return( false );
+  return( false );
 
   bool ret = true;
   QStringList::Iterator fIt = qList.begin( );
   if( qList.size( ) == 1 )
   {
-    // Read a single image
-    std::string fn = fIt->toStdString( );
-    this->m_LastOpenedFile = fn;
-
-    typename itk::ImageFileReader< I >::Pointer reader =
-      itk::ImageFileReader< I >::New( );
-    reader->SetFileName( fn );
-    try
-    {
-      reader->Update( );
-    }
-    catch( itk::ExceptionObject& err )
-    {
-      QMessageBox::critical(
-        this,
-        tr( "Error opening single image!" ),
-        tr( err.GetDescription( ) )
-        );
-      ret = false;
-
-    } // yrt
-    image = reader->GetOutput( );
-    image->DisconnectPipeline( );
+  // Read a single image
+  std::string fn = fIt->toStdString( );
+  this->m_LastOpenedFile = fn;
+
+  typename itk::ImageFileReader< I >::Pointer reader =
+  itk::ImageFileReader< I >::New( );
+  reader->SetFileName( fn );
+  try
+  {
+  reader->Update( );
   }
-  else if( qList.size( ) > 1 )
+  catch( itk::ExceptionObject& err )
   {
-    typedef std::set< std::string > _TOrderedStringList;
-
-    // Read a slice set
-    _TOrderedStringList filenames;
-    for( ; fIt != qList.end( ); ++fIt )
-      filenames.insert( fIt->toStdString( ) );
-    typename itk::ImageSeriesReader< I >::Pointer reader =
-      itk::ImageSeriesReader< I >::New( );
-    reader->SetImageIO( itk::GDCMImageIO::New( ) );
-    _TOrderedStringList::const_iterator oIt = filenames.begin( );
-    for( ; oIt != filenames.end( ); ++oIt )
-    {
-      reader->AddFileName( *oIt );
-      this->m_LastOpenedFile = *oIt;
-
-    } // rof
-    try
-    {
-      reader->Update( );
-    }
-    catch( itk::ExceptionObject& err )
-    {
-      QMessageBox::critical(
-        this,
-        tr( "Error opening image series!" ),
-        tr( err.GetDescription( ) )
-        );
-      ret = false;
-
-    } // yrt
-    image = reader->GetOutput( );
-    image->DisconnectPipeline( );
-
-  } // fi
-  return( ret );
-}
+  QMessageBox::critical(
+  this,
+  tr( "Error opening single image!" ),
+  tr( err.GetDescription( ) )
+  );
+  ret = false;
 
-// -------------------------------------------------------------------------
-void MainWnd::
-triggered_aSwitchMode( )
-{
-  QAction* snd = dynamic_cast< QAction* >( this->sender( ) );
-  if( snd == this->m_UI->aNavigation )
-  {
-    this->m_UI->aSegmentationInteractiveDeformation->setChecked(
-      !( this->m_UI->aNavigation->isChecked( ) )
-      );
+  } // yrt
+  image = reader->GetOutput( );
+  image->DisconnectPipeline( );
   }
-  else if( snd == this->m_UI->aSegmentationInteractiveDeformation )
+  else if( qList.size( ) > 1 )
   {
-    this->m_UI->aNavigation->setChecked(
-      !( this->m_UI->aSegmentationInteractiveDeformation->isChecked( ) )
-      );
-  }
-  else
+  typedef std::set< std::string > _TOrderedStringList;
+
+  // Read a slice set
+  _TOrderedStringList filenames;
+  for( ; fIt != qList.end( ); ++fIt )
+  filenames.insert( fIt->toStdString( ) );
+  typename itk::ImageSeriesReader< I >::Pointer reader =
+  itk::ImageSeriesReader< I >::New( );
+  reader->SetImageIO( itk::GDCMImageIO::New( ) );
+  _TOrderedStringList::const_iterator oIt = filenames.begin( );
+  for( ; oIt != filenames.end( ); ++oIt )
   {
-    this->m_UI->aNavigation->setChecked( true );
-    this->m_UI->aSegmentationInteractiveDeformation->setChecked( false );
-
-  } // fi
+  reader->AddFileName( *oIt );
+  this->m_LastOpenedFile = *oIt;
 
-  if( this->m_UI->aNavigation->isChecked( ) )
+  } // rof
+  try
   {
-    this->m_XStyle->SetModeToNavigation( );
-    this->m_YStyle->SetModeToNavigation( );
-    this->m_ZStyle->SetModeToNavigation( );
-    this->m_ImageActors->HideRegion( 0 );
-    this->m_ImageActors->HideRegion( 1 );
-    this->m_ImageActors->HideRegion( 2 );
-    this->m_3DRenderer->RemoveActor(
-      this->m_ImageActors->GetCursorActor( )
-      );
-    this->m_3DRenderer->RemoveActor(
-      this->m_ImageActors->GetRegionActor( )
-      );
-    this->m_UI->m_3DVTK->GetRenderWindow( )->Render( );
+  reader->Update( );
   }
-  else if( this->m_UI->aSegmentationInteractiveDeformation->isChecked( ) )
-  {
-    this->m_XStyle->SetModeToDeformation( );
-    this->m_YStyle->SetModeToDeformation( );
-    this->m_ZStyle->SetModeToDeformation( );
-    this->m_ImageActors->ShowRegion( 0 );
-    this->m_ImageActors->ShowRegion( 1 );
-    this->m_ImageActors->ShowRegion( 2 );
-    this->m_3DRenderer->AddActor(
-      this->m_ImageActors->GetCursorActor( )
-      );
-    this->m_3DRenderer->AddActor(
-      this->m_ImageActors->GetRegionActor( )
-      );
-    this->m_UI->m_3DVTK->GetRenderWindow( )->Render( );
+  catch( itk::ExceptionObject& err )
+  {
+  QMessageBox::critical(
+  this,
+  tr( "Error opening image series!" ),
+  tr( err.GetDescription( ) )
+  );
+  ret = false;
+
+  } // yrt
+  image = reader->GetOutput( );
+  image->DisconnectPipeline( );
 
   } // fi
-}
+  return( ret );
+  }
 
 // -------------------------------------------------------------------------
 void MainWnd::
 triggered_aReloadPlugins( )
 {
-  this->m_FilterPlugins.UnloadAll( );
-
-  std::ifstream in( this->m_PluginsConfigurationFile.c_str( ) );
-  if( in )
-  {
-    std::string plugin;
-    std::getline( in, plugin );
-    while( !( in.eof( ) ) )
-    {
-      if( this->m_FilterPlugins.Load( plugin ) )
-      {
-        TFilterPlugins::TClassesIterator cIt =
-          this->m_FilterPlugins.BeginClasses( );
-        for( ; cIt != this->m_FilterPlugins.EndClasses( ); ++cIt )
-        {
-          TFilterObject* filter =
-            this->m_FilterPlugins.CreateObject( cIt->first );
-          if( filter == NULL )
-            continue;
-          std::string cat = filter->GetCategory( );
-          std::string catType = cat.substr( cat.find_last_of( ":" ) );
-          if( catType == ":BinaryImageToBinaryImageFilter" )
-          {
-            QAction* action = this->m_UI->menuFilterSegmentedImage->
-              addAction( QString( cIt->first.c_str( ) ) );
-            QObject::connect(
-              action, SIGNAL( triggered( ) ),
-              this, SLOT( triggered_aFilterSegmentedImage( ) )
-              );
-          }
-          else if( catType == ":ImageToMeshFilter" )
-          {
-            QAction* action = this->m_UI->menuExtractMesh->
-              addAction( QString( cIt->first.c_str( ) ) );
-            QObject::connect(
-              action, SIGNAL( triggered( ) ),
-              this, SLOT( triggered_aSegmentedImageToMesh( ) )
-              );
-
-          } // fi
-          delete filter;
-
-        } // rof
-      }
-      else
-        std::cerr
-          << std::endl
-          << "Ignoring \"" << plugin << "\""
-          << std::endl;
-      std::getline( in, plugin );
-
-    } // elihw
-  }
-  else
-  {
-    QMessageBox::critical(
-      this,
-      tr( "No plugins file loaded!" ),
-      tr( "No plugins file loaded!" )
-      );
-
-  } // fi
-  in.close( );
-  this->_UpdateEnabledFlags( );
 }
 
 // -------------------------------------------------------------------------
@@ -619,7 +883,7 @@ triggered_aFilterSegmentedImage( )
   std::string filter_name = action->text( ).toStdString( );
 
   // Create filter
-  TFilterObject* filter = this->m_FilterPlugins.CreateObject( filter_name );
+  TFilterObject* filter = this->m_Plugins.CreateObject( filter_name );
   if( filter == NULL )
     return;
 
@@ -631,14 +895,12 @@ triggered_aFilterSegmentedImage( )
   std::string result = filter->Update( );
 
   // Get modified segmentation
-  /* TODO
      this->m_Mesh = filter->GetCastedOutput< TMesh >( );
      if( this->m_Mesh.IsNotNull( ) )
      {
      this->m_Mesh->DisconnectPipeline( );
 
      } // fi
-  */
   // Ok, it seems to have runned fine
   delete filter;
 }
@@ -656,7 +918,7 @@ triggered_aSegmentedImageToMesh( )
   std::string filter_name = action->text( ).toStdString( );
 
   // Create filter
-  TFilterObject* filter = this->m_FilterPlugins.CreateObject( filter_name );
+  TFilterObject* filter = this->m_Plugins.CreateObject( filter_name );
   if( filter == NULL )
     return;
 
@@ -678,6 +940,7 @@ triggered_aSegmentedImageToMesh( )
   // Ok, it seems to have runned fine
   delete filter;
 }
+*/
 
 // -------------------------------------------------------------------------
 /*
index c1fe98f558dbee968460091d7ea4ac46f21e444d..d3bef88941c9b95640823a073623f54a67eddc1d 100644 (file)
@@ -1,24 +1,34 @@
 #ifndef __MAINWND__H__
 #define __MAINWND__H__
 
-#include <QMainWindow>
+// Standard stuff
+#include <map>
+#include <string>
 
-#include <itkImage.h>
-#include <itkImageToVTKImageFilter.h>
+// Qt stuff
+#include <QMainWindow>
 
+// vtk stuff
 #include <vtkOrientationMarkerWidget.h>
 #include <vtkRenderer.h>
 #include <vtkSmartPointer.h>
 
-#include <cpm/DataStructures/QuadEdgeMesh.h>
-
-#include <cpmPluginsInterface/Interface.h>
-#include <cpmPluginsInterface/Filter.h>
+// Plugins interface
+#include <cpPlugins/Interface/Interface.h>
+#include <cpPlugins/Interface/ProcessObject.h>
+#include <cpPlugins/Interface/DataObject.h>
 
+// Local stuff
 #include "InteractorStyleImage.h"
 #include "VolumeActors.h"
 
+
 /*
+  #include <itkImage.h>
+  #include <itkImageToVTKImageFilter.h>
+
+  #include <cpm/DataStructures/QuadEdgeMesh.h>
+
   #include <cpm/VTK/MeshMapper.h>
   #include <cpm/Algorithms/QuadEdge/MeshPlaneCutterFilter.h>
 */
@@ -39,39 +49,26 @@ class MainWnd
 
 public:
   // Plugins types
-  typedef cpmPluginsInterface::FilterProvider TFilterProvider;
-  typedef cpmPluginsInterface::Filter         TFilterObject;
-  typedef TFilterObject::TParameters          TParameters;
-  typedef
-  cpmPluginsInterface::Interface< TFilterProvider, TFilterObject >
-  TFilterPlugins;
-
-  // Data types
-  static const unsigned int Dimension = 3;
-  typedef short  TPixel;
-  typedef double TScalar;
-  typedef itk::Image< TPixel, Dimension >      TImage;
-  typedef itk::ImageToVTKImageFilter< TImage > TVTKImage;
-
-  typedef cpm::DataStructures::QuadEdgeMesh< TScalar, Dimension > TMesh;
-
-  /*
-    typedef cpm::VTK::MeshMapper< TTriangulation > TTriangulationMapper;
-    typedef
-    cpm::Algorithms::QuadEdge::MeshPlaneCutterFilter< TTriangulation >
-    TCutter;
-  */
+  typedef cpPlugins::Interface::Interface     TPluginsInterface;
+  typedef cpPlugins::Interface::DataObject    TPluginData;
+  typedef cpPlugins::Interface::ProcessObject TPlugin;
+  typedef TPlugin::TParameters                TParameters;
 
 public:
   explicit MainWnd( QWidget* parent = 0 );
   virtual ~MainWnd( );
 
 protected:
+  void _LoadApplicationPreferences( );
+  TPluginData* _LoadImage(
+    const std::string& image_type, const std::string& image_dim
+    );
   void _UpdateEnabledFlags( );
-  bool _ParametersDialog( TParameters& parameters );
 
-  template< class I >
-  bool _LoadImage( typename I::Pointer& image );
+  /* TODO
+     bool _ParametersDialog( TParameters& parameters );
+     template< class I >
+  */
 
   /*
     void _SliceMesh( int axis );
@@ -83,33 +80,52 @@ protected:
   */
 
 private slots:
-  void triggered_aSwitchMode( );
-  void triggered_aReloadPlugins( );
-  void triggered_aOpenInputImage( );
-  void triggered_aOpenSegmentedImage( );
-  void triggered_aFilterSegmentedImage( );
-  void triggered_aSegmentedImageToMesh( );
-  /*
-    void triggered_aLoadInputImage( );
-    void triggered_aLoadSegmentedImage( );
+  void _triggered_actionReloadPlugins( );
+  void _triggered_actionOpenInputImage( );
+  void _triggered_actionOpenSegmentedImage( );
+  void _triggered_actionSwitchMode( );
+  
+  /* TODO
+     void triggered_aOpenSegmentedImage( );
+     void triggered_aFilterSegmentedImage( );
+     void triggered_aSegmentedImageToMesh( );
+     void triggered_aLoadInputImage( );
+     void triggered_aLoadSegmentedImage( );
   */
 
 private:
   Ui::MainWnd* m_UI;
 
+  // Application preferences
+  std::string m_ApplicationPreferencesFile;
+  std::map< std::string, std::string > m_ApplicationPreferences;
+
   // Plugins objects
-  std::string m_PluginsConfigurationFile;
-  TFilterPlugins m_FilterPlugins;
-
-  // Inputs
-  std::string        m_LastOpenedFile;
-  TImage::Pointer    m_Image;
-  TImage::Pointer    m_Segmentation;
-  TMesh::Pointer     m_Mesh;
-  TVTKImage::Pointer m_VTKImage;
-  TVTKImage::Pointer m_VTKSegmentation;
-
-  // Renderers
+  std::string       m_PluginsConfigurationFile;
+  TPluginsInterface m_Plugins;
+
+  // Needed object from plugins
+  std::string m_ImageReaderClassName;
+  std::string m_ImageSeriesReaderClassName;
+  std::string m_ImageWriterClassName;
+
+  // Historic objects
+  std::string m_LastOpenedFile;
+
+  // Real data
+  TPluginData* m_InputImage;
+  TPluginData* m_SegmentedImage;
+
+  /* TODO
+     // Inputs
+     TImage::Pointer    m_Image;
+     TImage::Pointer    m_Segmentation;
+     TMesh::Pointer     m_Mesh;
+     TVTKImage::Pointer m_VTKImage;
+     TVTKImage::Pointer m_VTKSegmentation;
+  */
+
+  // Visualization stuff
   vtkSmartPointer< vtkRenderer >        m_3DRenderer;
   vtkSmartPointer< vtkRenderer >        m_XPlaneRenderer;
   vtkSmartPointer< vtkRenderer >        m_YPlaneRenderer;
@@ -119,8 +135,8 @@ private:
   vtkSmartPointer< idms::InteractorStyleImage > m_XStyle;
   vtkSmartPointer< idms::InteractorStyleImage > m_YStyle;
   vtkSmartPointer< idms::InteractorStyleImage > m_ZStyle;
-
   vtkSmartPointer< vtkOrientationMarkerWidget > m_3DOrientationWidget;
+
   /*
     TTriangulation::Pointer                 m_Mesh;
     vtkSmartPointer< TTriangulationMapper > m_MeshMapper;
index 9bea142871b277e9bc43bd4f7221ac8c70cb6a34..a533240baaeb83f07498e3aa28c2eb0925a0f556 100644 (file)
     <property name="title">
      <string>&amp;File</string>
     </property>
-    <addaction name="aOpenPlugins"/>
-    <addaction name="aReloadPlugins"/>
+    <addaction name="actionOpenPlugins"/>
+    <addaction name="actionReloadPlugins"/>
     <addaction name="separator"/>
-    <addaction name="aExit"/>
+    <addaction name="actionExit"/>
    </widget>
    <widget class="QMenu" name="menuHelp">
     <property name="title">
       <string>Segment</string>
      </property>
     </widget>
-    <addaction name="aOpenInputImage"/>
+    <addaction name="actionOpenInputImage"/>
     <addaction name="menuSegmentInputImage"/>
    </widget>
    <widget class="QMenu" name="menuSegmentedImage">
       <string>Extract mesh</string>
      </property>
     </widget>
-    <addaction name="aOpenSegmentedImage"/>
+    <addaction name="actionOpenSegmentedImage"/>
     <addaction name="menuFilterSegmentedImage"/>
     <addaction name="menuExtractMesh"/>
    </widget>
       <string>Process</string>
      </property>
     </widget>
-    <addaction name="aOpenMesh"/>
+    <addaction name="actionOpenMesh"/>
     <addaction name="menuProcessMesh"/>
    </widget>
    <addaction name="menuFile"/>
    <attribute name="toolBarBreak">
     <bool>false</bool>
    </attribute>
-   <addaction name="aNavigation"/>
-   <addaction name="aSegmentationInteractiveDeformation"/>
+   <addaction name="actionNavigation"/>
+   <addaction name="actionSegmentationInteractiveDeformation"/>
   </widget>
-  <action name="aOpenInputImage">
+  <action name="actionOpenInputImage">
+   <property name="enabled">
+    <bool>true</bool>
+   </property>
    <property name="text">
     <string>Open</string>
    </property>
   </action>
-  <action name="aOpenSegmentedImage">
+  <action name="actionOpenSegmentedImage">
    <property name="enabled">
-    <bool>false</bool>
+    <bool>true</bool>
    </property>
    <property name="text">
     <string>Open</string>
    </property>
   </action>
-  <action name="aOpenMesh">
+  <action name="actionOpenMesh">
    <property name="enabled">
-    <bool>false</bool>
+    <bool>true</bool>
    </property>
    <property name="text">
     <string>Open</string>
    </property>
   </action>
-  <action name="aOpenPlugins">
+  <action name="actionOpenPlugins">
    <property name="enabled">
     <bool>true</bool>
    </property>
     <string>Open plugins</string>
    </property>
   </action>
-  <action name="aReloadPlugins">
+  <action name="actionReloadPlugins">
    <property name="text">
     <string>Reload plugins</string>
    </property>
   </action>
-  <action name="aExit">
+  <action name="actionExit">
    <property name="text">
     <string>Exit</string>
    </property>
   </action>
-  <action name="aNavigation">
+  <action name="actionNavigation">
    <property name="checkable">
     <bool>true</bool>
    </property>
    <property name="enabled">
-    <bool>false</bool>
+    <bool>true</bool>
    </property>
    <property name="icon">
     <iconset resource="resources.qrc">
     <string>Navigation</string>
    </property>
   </action>
-  <action name="aSegmentationInteractiveDeformation">
+  <action name="actionSegmentationInteractiveDeformation">
    <property name="checkable">
     <bool>true</bool>
    </property>
    <property name="enabled">
-    <bool>false</bool>
+    <bool>true</bool>
    </property>
    <property name="icon">
     <iconset resource="resources.qrc">
  </resources>
  <connections>
   <connection>
-   <sender>aExit</sender>
+   <sender>actionExit</sender>
    <signal>triggered()</signal>
    <receiver>MainWnd</receiver>
    <slot>close()</slot>
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..12e417d0b192d16c730e63291a42771305e0139a 100644 (file)
@@ -0,0 +1 @@
+@cpPlugins_LIBRARY_NAME@
index 4a3fefe3958911ad581f95f1aa7577262a28aba2..5bede9d15397c3ec2f6db12895f5d61b33c14be4 100644 (file)
@@ -1,9 +1,11 @@
 #include "MainWnd.h"
+#include <cstdlib>
 #include <QApplication>
 
 // -------------------------------------------------------------------------
 int main( int argc, char* argv[] )
 {
+  ::setenv( "LC_NUMERIC", "POSIX", 1 );
   QApplication a( argc, argv );
   MainWnd w;
   w.show( );