]> Creatis software - cpPlugins.git/commitdiff
More plugins added
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Fri, 1 Apr 2016 00:10:24 +0000 (19:10 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Fri, 1 Apr 2016 00:10:24 +0000 (19:10 -0500)
36 files changed:
appli/PipelineEditor/PipelineEditor.cxx
appli/PipelineEditor/PipelineEditor.h
appli/examples/plugins/CMakeLists.txt
cmake/cpPluginsConfig.cmake.in
lib/cpExtensions/Algorithms/MultiScaleGaussianImageFilter.h
lib/cpExtensions/Algorithms/MultiScaleGaussianImageFilter.hxx
lib/cpExtensions/QT/SimpleMPRWidget.cxx
lib/cpExtensions/QT/SimpleMPRWidget.h
lib/cpPlugins/BaseQtMainWindow.cxx [new file with mode: 0644]
lib/cpPlugins/BaseQtMainWindow.h [new file with mode: 0644]
lib/cpPlugins/CMakeLists.txt
lib/cpPlugins/Image.hxx
lib/cpPlugins/Interface.cxx
lib/cpPlugins/Mesh.cxx
lib/cpPlugins_ITKInstances/Base.cxx
lib/cpPlugins_ITKInstances/Base_explicit_description.txt
lib/cpPlugins_ITKInstances/Image.cxx
lib/cpPlugins_ITKInstances/ImageFilters_explicit_description.txt
lib/cpPlugins_ITKInstances/Image_explicit_description.txt
lib/cpPlugins_ITKInstances/Mesh_explicit_description.txt
plugins/cpPluginsIO/CMakeLists.txt
plugins/cpPluginsImageFilters/CMakeLists.txt
plugins/cpPluginsImageFilters/ExtractImageFilter.cxx [new file with mode: 0644]
plugins/cpPluginsImageFilters/ExtractImageFilter.h [new file with mode: 0644]
plugins/cpPluginsImageFilters/IsoImageSlicer.cxx [new file with mode: 0644]
plugins/cpPluginsImageFilters/IsoImageSlicer.h [new file with mode: 0644]
plugins/cpPluginsImageFilters/JoinSeriesImageFilter.cxx [new file with mode: 0644]
plugins/cpPluginsImageFilters/JoinSeriesImageFilter.h [new file with mode: 0644]
plugins/cpPluginsImageFilters/MultiScaleGaussianImageFilter.cxx [new file with mode: 0644]
plugins/cpPluginsImageFilters/MultiScaleGaussianImageFilter.h [new file with mode: 0644]
plugins/cpPluginsImageFilters/ResampleImageFilter.cxx [new file with mode: 0644]
plugins/cpPluginsImageFilters/ResampleImageFilter.h [new file with mode: 0644]
plugins/cpPluginsImageMeshFilters/CMakeLists.txt
plugins/cpPluginsMeshFilters/CMakeLists.txt
plugins/cpPluginsVisualization/CMakeLists.txt
plugins/cpPluginsWidgets/CMakeLists.txt

index 2f7d7eabee3d7f4adf90e6a7fc8241dc7cf40901..eeaee071237b6a810e4f67c2f2e15ce12dbe6ddc 100644 (file)
 #include "ui_PipelineEditor.h"
 
 #include <cpPipelineEditor/Editor.h>
-
-#include <QFileDialog>
 #include <QMessageBox>
 
-#include <vtkImageData.h>
-#include <vtkPolyData.h>
-
-#include <cpPlugins/DataObject.h>
-
-// -------------------------------------------------------------------------
-#define PipelineEditor_ConnectAction( ACTION )          \
-  this->connect(                                        \
-    this->m_UI->Action##ACTION, SIGNAL( triggered( ) ), \
-    this, SLOT( _Action##ACTION( ) )                    \
-    )
-
-// -------------------------------------------------------------------------
-#define PipelineEditor_ConnectButton( BUTTON )          \
-  this->connect(                                        \
-    this->m_UI->Button##BUTTON, SIGNAL( clicked( ) ),   \
-    this, SLOT( _Button##BUTTON( ) )                    \
-    )
-
-// -------------------------------------------------------------------------
-bool PipelineEditor_Blocker::
-eventFilter( QObject* obj, QEvent* event )
-{
-  return( true ); // -> Block all events
-  /* NOTE: correct implementation:
-     switch( event->type( ) )
-     {
-     //list event you want to prevent here ...
-     case QEvent::KeyPress:
-     case QEvent::KeyRelease:
-     case QEvent::MouseButtonRelease:
-     case QEvent::MouseButtonPress:
-     case QEvent::MouseButtonDblClick:
-     //...
-     return( true );
-     } // hctiws
-     return( this->QObject::eventFilter( obj, event ) );
-  */
-}
-
 // -------------------------------------------------------------------------
 PipelineEditor::
 PipelineEditor( int argc, char* argv[], QApplication* app, QWidget* parent )
-  : QMainWindow( parent ),
-    m_UI( new Ui::PipelineEditor ),
-    m_Application( app ),
-    m_Workspace( NULL ),
-    m_PluginsPath( "." )
+  : Superclass( argc, argv, app, parent ),
+    m_UI( new Ui::PipelineEditor )
 {
+  // Basic configuration
   this->m_UI->setupUi( this );
-
-  // Prepare plugins interface
-  QFileInfo info( argv[ 0 ] );
-  if( info.exists( ) )
-  {
-    if( !( this->m_Interface.LoadConfiguration( cpPlugins_CONFIG_FILE ) ) )
-    {
-      this->m_PluginsPath = info.canonicalPath( ).toStdString( );
-      this->_LoadPluginsFromPath( this->m_PluginsPath );
-    }
-    /*
-      else
-      this->_UpdateLoadedPlugins( );
-    */
-
-  } // fi
-  QDir exec_dir( "." );
-  if( exec_dir.exists( ) )
-    this->_LoadPluginsFromPath( exec_dir.canonicalPath( ).toStdString( ) );
-
-  /* TODO
-     this->m_Interface = new cpPlugins::Interface( );
-     this->m_PluginsPath = info.canonicalPath( ).toStdString( );
-     if( !( this->m_Interface->LoadDefaultConfiguration( this->m_PluginsPath ) ) )
-     if( this->m_Interface->LoadFromFolder( this->m_PluginsPath, false ) != "" )
-     if( !( this->m_Interface->SaveDefaultConfiguration( this->m_PluginsPath ) ) )
-     QMessageBox::critical(
-     this,
-     "Error creating default plugins configuration",
-     "Could not save default plugins configuration"
-     );
-     this->_UpdateLoadedPlugins( );
-
-     } // fi
-  */
-
-  // Create an empty workspace
-  this->m_Workspace = new cpPlugins::Workspace( );
-  this->m_Workspace->SetInterface( &( this->m_Interface ) );
-  this->m_UI->Canvas->editor( )->setWorkspace( this->m_Workspace );
-  this->m_Workspace->SetMPRViewer( this->m_UI->Viewer );
+  this->_Configure(
+    this->m_UI->LoadedPlugins,
+    this->m_UI->Viewer,
+    this->m_UI->Canvas->editor( )
+    );
 
   // Connect actions to slots
-  PipelineEditor_ConnectButton( LoadPluginsFile );
-  PipelineEditor_ConnectButton( LoadPluginsPath );
-  PipelineEditor_ConnectAction( OpenWorkspace );
-  PipelineEditor_ConnectAction( SaveWorkspace );
+  this->connect(
+    this->m_UI->ButtonLoadPluginsFile, SIGNAL( clicked( ) ),
+    this, SLOT( _InteractiveLoadPlugins( ) )
+    );
+  this->connect(
+    this->m_UI->ButtonLoadPluginsPath, SIGNAL( clicked( ) ),
+    this, SLOT( _InteractiveLoadPluginsFromPath( ) )
+    );
+  this->connect(
+    this->m_UI->ActionOpenWorkspace, SIGNAL( triggered( ) ),
+    this, SLOT( _InteractiveLoadWorkspace( ) )
+    );
+  this->connect(
+    this->m_UI->ActionSaveWorkspace, SIGNAL( triggered( ) ),
+    this, SLOT( _InteractiveSaveWorkspace( ) )
+    );
   this->connect(
     this->m_UI->Canvas->editor( ),
     SIGNAL( execFilter( const std::string& ) ),
@@ -121,278 +53,9 @@ PipelineEditor( int argc, char* argv[], QApplication* app, QWidget* parent )
 PipelineEditor::
 ~PipelineEditor( )
 {
-  if( this->m_Workspace != NULL )
-    delete this->m_Workspace;
   delete this->m_UI;
 }
 
-// -------------------------------------------------------------------------
-void PipelineEditor::
-_LoadPluginsFromPath( const std::string& path )
-{
-  QDir dir( path.c_str( ) );
-  std::stringstream filters_str;
-  filters_str << "*." << cpPlugins_PLUGIN_EXT;
-  QStringList filters;
-  filters << filters_str.str( ).c_str( );
-  auto files = dir.entryList( filters );
-  for( auto fIt = files.begin( ); fIt != files.end( ); ++fIt )
-  {
-    try
-    {
-      this->m_Interface.LoadPluginFile(
-        ( dir.absolutePath( ) + QDir::separator( ) + *fIt ).toStdString( )
-        );
-    }
-    catch( std::exception& err )
-    {
-      // Just ignore un-loadable libraries
-    } // yrt
-
-  } // rof
-  this->_UpdateLoadedPlugins( );
-}
-
-// -------------------------------------------------------------------------
-void PipelineEditor::
-_UpdateLoadedPlugins( )
-{
-  this->_Block( );
-  auto filters = this->m_Interface.GetFilters( );
-  if( filters.size( ) == 0 )
-  {
-    QMessageBox::critical(
-      this,
-      "Error loading default plugins",
-      "No plugins loaded: remember to load some!!!"
-      );
-    this->_UnBlock( );
-    return;
-
-  } // fi
-
-  for( auto cIt = filters.begin( ); cIt != filters.end( ); ++cIt )
-  {
-    // Create or get category
-    QList< QTreeWidgetItem* > cat_items =
-      this->m_UI->LoadedPlugins->findItems(
-        cIt->first.c_str( ), Qt::MatchExactly | Qt::MatchRecursive
-        );
-    QTreeWidgetItem* cat = NULL;
-    if( cat_items.size( ) == 0 )
-    {
-      cat = new QTreeWidgetItem(
-        ( QTreeWidgetItem* )( NULL ), QStringList( cIt->first.c_str( ) )
-        );
-      this->m_UI->LoadedPlugins->addTopLevelItem( cat );
-    }
-    else
-      cat = cat_items[ 0 ];
-
-    // Create filters
-    auto fIt = cIt->second.begin( );
-    for( ; fIt != cIt->second.end( ); ++fIt )
-    {
-      QList< QTreeWidgetItem* > filter_items =
-        this->m_UI->LoadedPlugins->findItems(
-          fIt->c_str( ), Qt::MatchExactly | Qt::MatchRecursive
-          );
-      auto fiIt = filter_items.begin( );
-      auto found_fiIt = filter_items.end( );
-      for( ; fiIt != filter_items.end( ); ++fiIt )
-        if( ( *fiIt )->parent( ) == cat )
-          found_fiIt = fiIt;
-
-      // Add filter
-      if( found_fiIt == filter_items.end( ) )
-        QTreeWidgetItem* filter = new QTreeWidgetItem(
-          cat, QStringList( fIt->c_str( ) )
-          );
-
-    } // rof
-
-  } // rof
-  this->_UnBlock( );
-  this->m_Interface.SaveConfiguration( cpPlugins_CONFIG_FILE );
-}
-
-// -------------------------------------------------------------------------
-void PipelineEditor::
-_Block( )
-{
-  this->m_Application->setOverrideCursor( Qt::WaitCursor );
-  this->m_Application->installEventFilter( &( this->m_Blocker ) );
-}
-
-// -------------------------------------------------------------------------
-void PipelineEditor::
-_UnBlock( )
-{
-  while( this->m_Application->overrideCursor( ) )
-    this->m_Application->restoreOverrideCursor( );
-  this->m_Application->removeEventFilter( &( this->m_Blocker ) );
-}
-
-// -------------------------------------------------------------------------
-void PipelineEditor::
-_ButtonLoadPluginsFile( )
-{
-  QFileDialog dlg( this );
-  dlg.setFileMode( QFileDialog::ExistingFiles );
-  dlg.setDirectory( "." );
-
-  std::stringstream name_filter;
-  std::string suffix = std::string( cpPlugins_PLUGIN_EXT );
-  name_filter
-    << "Plugins file (*." << cpPlugins_PLUGIN_EXT << ");;All files (*)";
-  dlg.setNameFilter( name_filter.str( ).c_str( ) );
-  dlg.setDefaultSuffix( suffix.c_str( ) );
-
-  if( !( dlg.exec( ) ) )
-    return;
-
-  // Read
-  QStringList names = dlg.selectedFiles( );
-  std::stringstream err_str;
-  for( auto qIt = names.begin( ); qIt != names.end( ); ++qIt )
-  {
-    try
-    {
-      this->m_Interface.LoadPluginFile( qIt->toStdString( ) );
-    }
-    catch( std::exception& err )
-    {
-      err_str << err.what( ) << std::endl;
-
-    } // yrt
-
-  } // rof
-
-  // Show an error message
-  std::string err = err_str.str( );
-  if( err.size( ) > 0 )
-    QMessageBox::critical(
-      this,
-      "Error loading plugins",
-      err.c_str( )
-      );
-
-  // Update view
-  // TODO: this->m_Interface.SaveDefaultConfiguration( this->m_PluginsPath );
-  this->_UpdateLoadedPlugins( );
-}
-
-// -------------------------------------------------------------------------
-void PipelineEditor::
-_ButtonLoadPluginsPath( )
-{
-  /*
-    QFileDialog dlg( this );
-    dlg.setFileMode( QFileDialog::DirectoryOnly );
-    dlg.setDirectory( "." );
-    if( !( dlg.exec( ) ) )
-    return;
-
-    // Read
-    std::string dir = dlg.selectedFiles( ).begin( )->toStdString( );
-    std::string err = this->m_Interface->LoadFromFolder( dir, false );
-    if( err != "" )
-    QMessageBox::critical(
-    this,
-    "Error loading plugins directory",
-    err.c_str( )
-    );
-
-    // Update view
-    this->m_Interface->SaveDefaultConfiguration( this->m_PluginsPath );
-    this->_UpdateLoadedPlugins( );
-  */
-}
-
-// -------------------------------------------------------------------------
-void PipelineEditor::
-_ActionOpenWorkspace( )
-{
-  QFileDialog dlg( this );
-  dlg.setFileMode( QFileDialog::ExistingFile );
-  dlg.setDirectory( "." );
-  dlg.setNameFilter(
-    QFileDialog::tr( "Workspace file (*.wxml);;All files (*)" )
-    );
-  dlg.setDefaultSuffix( QFileDialog::tr( "wxml" ) );
-  if( !( dlg.exec( ) ) )
-    return;
-
-  std::string fname = dlg.selectedFiles( ).at( 0 ).toStdString( );
-  if( this->m_Workspace != NULL )
-    delete this->m_Workspace;
-  this->m_Workspace = new cpPlugins::Workspace( );
-  this->m_Workspace->SetInterface( &( this->m_Interface ) );
-  this->m_Workspace->SetMPRViewer( this->m_UI->Viewer );
-  std::string err = this->m_Workspace->LoadWorkspace( fname );
-  if( err != "" )
-  {
-    delete this->m_Workspace;
-    this->m_Workspace = NULL;
-    QMessageBox::critical(
-      this,
-      QMessageBox::tr( "Error loading workspace" ),
-      QMessageBox::tr( err.c_str( ) )
-      );
-  }
-  else
-    this->m_UI->Canvas->editor( )->setWorkspace( this->m_Workspace );
-}
-
-// -------------------------------------------------------------------------
-void PipelineEditor::
-_ActionSaveWorkspace( )
-{
-  if( this->m_Workspace == NULL )
-    return;
-
-  QFileDialog dlg( this );
-  dlg.setFileMode( QFileDialog::AnyFile );
-  dlg.setDirectory( "." );
-  dlg.setAcceptMode( QFileDialog::AcceptSave );
-  dlg.setNameFilter(
-    QFileDialog::tr( "Workspace file (*.wxml);;All files (*)" )
-    );
-  dlg.setDefaultSuffix( QFileDialog::tr( "wxml" ) );
-  if( !( dlg.exec( ) ) )
-    return;
-  std::string fname = dlg.selectedFiles( ).at( 0 ).toStdString( );
-
-  std::string err = this->m_Workspace->SaveWorkspace( fname );
-  if( err != "" )
-    QMessageBox::critical(
-      this,
-      QMessageBox::tr( "Error saving workspace" ),
-      QMessageBox::tr( err.c_str( ) )
-      );
-}
-
-
-// -------------------------------------------------------------------------
-void PipelineEditor::
-_ExecFilter( const std::string& filter_name )
-{
-  if( this->m_Workspace != NULL )
-  {
-    // Update filter, if needed
-    this->_Block( );
-    std::string err = this->m_Workspace->Execute( filter_name );
-    this->_UnBlock( );
-    if( err != "" )
-      QMessageBox::critical(
-        this,
-        QMessageBox::tr( "Error executing filter" ),
-        QMessageBox::tr( err.c_str( ) )
-        );
-
-  } // fi
-}
-
 // -------------------------------------------------------------------------
 void PipelineEditor::
 _ShowFilterOutput(
@@ -405,7 +68,7 @@ _ShowFilterOutput(
   this->_ExecFilter( filter_name );
 
   // Get output
-  auto filter = this->m_Workspace->GetFilter( filter_name );
+  auto filter = this->m_Workspace.GetFilter( filter_name );
   if( filter != NULL )
   {
     auto output = filter->GetOutputData( output_name );
@@ -446,18 +109,6 @@ _ShowFilterOutput(
           QMessageBox::tr( "No known VTK conversion!" )
           );
 
-      /* TODO
-         if( this->m_UI->Viewer->AddData( output, data_name, "" ) )
-         {
-         if( this->m_UI->Viewer->GetNumberOfData( ) > 1 )
-         this->m_UI->Viewer->SetDataColor( data_name, 1, 0, 0 );
-         else
-         this->m_UI->Viewer->SetMainImage( data_name );
-         this->m_UI->Viewer->ShowData( data_name );
-         }
-         else
-      */
-
     } // fi
 
   } // fi
index c5f12612fca2d41a95afbc6cd64f569258dec357..fa6f48ed537ae0e4b2a3eb5fc8cb1029837897c2 100644 (file)
@@ -1,20 +1,7 @@
 #ifndef __PIPELINEEDITOR__H__
 #define __PIPELINEEDITOR__H__
 
-// Qt stuff
-#include <QApplication>
-#include <QMainWindow>
-#include <cpPlugins/Interface.h>
-#include <cpPlugins/Workspace.h>
-
-/**
- */
-class PipelineEditor_Blocker
-  : public QObject
-{
-protected:
-  virtual bool eventFilter( QObject* obj, QEvent* event ) ITK_OVERRIDE;
-};
+#include <cpPlugins/BaseQtMainWindow.h>
 
 // -------------------------------------------------------------------------
 namespace Ui
@@ -25,13 +12,13 @@ namespace Ui
 /**
  */
 class PipelineEditor
-  : public QMainWindow
+  : public cpPlugins::BaseQtMainWindow
 {
   Q_OBJECT;
 
 public:
-  typedef PipelineEditor Self;
-  typedef QMainWindow    Superclass;
+  typedef PipelineEditor              Self;
+  typedef cpPlugins::BaseQtMainWindow Superclass;
 
 public:
   explicit PipelineEditor(
@@ -41,29 +28,13 @@ public:
     );
   virtual ~PipelineEditor( );
 
-protected:
-  void _LoadPluginsFromPath( const std::string& path );
-  void _UpdateLoadedPlugins( );
-  void _Block( );
-  void _UnBlock( );
-
 protected slots:
-  void _ButtonLoadPluginsFile( );
-  void _ButtonLoadPluginsPath( );
-  void _ActionOpenWorkspace( );
-  void _ActionSaveWorkspace( );
-  void _ExecFilter( const std::string& filter_name );
   void _ShowFilterOutput(
     const std::string& filter_name, const std::string& output_name
     );
 
 private:
-  Ui::PipelineEditor*    m_UI;
-  QApplication*          m_Application;
-  PipelineEditor_Blocker m_Blocker;
-  cpPlugins::Workspace*  m_Workspace;
-  cpPlugins::Interface   m_Interface;
-  std::string            m_PluginsPath;
+  Ui::PipelineEditor* m_UI;
 };
 
 #endif // __CPPIPELINEEDITOR__H__
index 752c62b7acf74a4284788acca52f5d803731a0de..24842051fc2ff5fc4a5b57326604145392930b0c 100644 (file)
@@ -8,7 +8,7 @@ SET(
 
 FOREACH(example ${examples_SOURCES})
   ADD_EXECUTABLE(${example} ${example}.cxx)
-  TARGET_LINK_LIBRARIES(${example} cpPlugins)
+  TARGET_LINK_LIBRARIES(${example} cpPlugins cpPipelineEditor)
 ENDFOREACH(example)
 
 ## eof - $RCSfile$
index 734e990200c6f5e8280b75114a971c1ebb7c58dd..8937069f925e08c477716ac8399a9ed4016343da 100644 (file)
@@ -83,7 +83,9 @@ ENDIF(MSVC)
 # ===================
 
 SET(cpExtensions_LIBRARY cpExtensions)
+SET(cpPlugins_tinyxml2_LIBRARY cpPlugins_tinyxml2)
 SET(cpPlugins_LIBRARY cpPlugins)
+SET(cpPipelineEditor_LIBRARY cpPipelineEditor)
 
 # ======================
 # -- Executable names --
index 5dba45bfb2e710a1a1da8055b941e182d7fd19b5..c0612a28eec649ea9c01afcc126d29d735d51a97 100644 (file)
@@ -29,14 +29,6 @@ namespace cpExtensions
 
       typedef std::set< double > TScalesContainer;
 
-      enum FilterId
-      {
-        Gradient = 0,
-        GradientMagnitude,
-        Hessian,
-        None
-      };
-
     protected:
       /**
        */
@@ -59,14 +51,6 @@ namespace cpExtensions
       itkTypeMacro( MultiScaleGaussianImageFilter, itkImageToImageFilter );
 
     public:
-      void SetFilterToGradient( );
-      void SetFilterToGradientMagnitude( );
-      void SetFilterToHessian( );
-
-      bool IsGradientFilter( ) const;
-      bool IsGradientMagnitudeFilter( ) const;
-      bool IsHessianFilter( ) const;
-
       void AddScale( const double& s );
       unsigned long GetNumberOfScales( ) const;
 
@@ -86,7 +70,6 @@ namespace cpExtensions
 
     protected:
       TScalesContainer m_Scales;
-      FilterId m_FilterId;
     };
 
   } // ecapseman
index c2e7cffa8cc4373acbe58b922851852365c0744b..aff0fd8575b5b145f856abdeb5d3a4fc9b826bd0 100644 (file)
@@ -14,9 +14,7 @@
 
 #include <itkBinaryFunctorImageFilter.h>
 #include <itkUnaryFunctorImageFilter.h>
-#include <itkGradientMagnitudeRecursiveGaussianImageFilter.h>
 #include <itkGradientRecursiveGaussianImageFilter.h>
-#include <itkHessianRecursiveGaussianImageFilter.h>
 
 // -------------------------------------------------------------------------
 template< class I, class O >
@@ -83,77 +81,6 @@ operator()( const _T& a, const _T& b ) const
   return( ( vb.magnitude( ) < va.magnitude( ) )? a: b );
 }
 
-// -------------------------------------------------------------------------
-template< class I, class O >
-void
-cpExtensions::Algorithms::
-MultiScaleGaussianImageFilter< I, O >::
-SetFilterToGradient( )
-{
-  if(
-    itk::NumericTraits< typename O::PixelType >::GetLength( ) ==
-    I::ImageDimension
-    )
-    this->m_FilterId = Self::Gradient;
-  else
-    this->m_FilterId = Self::None;
-  this->Modified( );
-}
-
-// -------------------------------------------------------------------------
-template< class I, class O >
-void
-cpExtensions::Algorithms::
-MultiScaleGaussianImageFilter< I, O >::
-SetFilterToGradientMagnitude( )
-{
-  if( itk::NumericTraits< typename O::PixelType >::GetLength( ) == 1 )
-    this->m_FilterId = Self::GradientMagnitude;
-  else
-    this->m_FilterId = Self::None;
-  this->Modified( );
-}
-
-// -------------------------------------------------------------------------
-template< class I, class O >
-void
-cpExtensions::Algorithms::
-MultiScaleGaussianImageFilter< I, O >::
-SetFilterToHessian( )
-{
-  itkExceptionMacro( << "Check for hessian definition." );
-}
-
-// -------------------------------------------------------------------------
-template< class I, class O >
-bool
-cpExtensions::Algorithms::
-MultiScaleGaussianImageFilter< I, O >::
-IsGradientFilter( ) const
-{
-  return( this->m_FilterId == Self::Gradient );
-}
-
-// -------------------------------------------------------------------------
-template< class I, class O >
-bool
-cpExtensions::Algorithms::
-MultiScaleGaussianImageFilter< I, O >::
-IsGradientMagnitudeFilter( ) const
-{
-  return( this->m_FilterId == Self::GradientMagnitude );
-}
-
-// -------------------------------------------------------------------------
-template< class I, class O >
-bool
-cpExtensions::Algorithms::
-MultiScaleGaussianImageFilter< I, O >::
-IsHessianFilter( ) const
-{
-  return( this->m_FilterId == Self::Hessian );
-}
-
 // -------------------------------------------------------------------------
 template< class I, class O >
 void
@@ -182,14 +109,6 @@ MultiScaleGaussianImageFilter< I, O >::
 MultiScaleGaussianImageFilter( )
   : Superclass( )
 {
-  this->SetFilterToGradientMagnitude( );
-  if( !this->IsGradientMagnitudeFilter( ) )
-  {
-    this->SetFilterToGradient( );
-    if( !this->IsGradientFilter( ) )
-      this->SetFilterToHessian( );
-
-  } // fi
 }
 
 // -------------------------------------------------------------------------
@@ -207,16 +126,8 @@ cpExtensions::Algorithms::
 MultiScaleGaussianImageFilter< I, O >::
 GenerateData( )
 {
-  typedef itk::GradientRecursiveGaussianImageFilter< I, O >          _TGF;
-  typedef itk::GradientMagnitudeRecursiveGaussianImageFilter< I, O > _TGMF;
-  typedef itk::HessianRecursiveGaussianImageFilter< I, O >           _THF;
-
-  if( this->IsGradientFilter( ) )
-    this->_GenerateData< _TGF >( );
-  else if( this->IsGradientMagnitudeFilter( ) )
-    this->_GenerateData< _TGMF >( );
-  else if( this->IsHessianFilter( ) )
-    this->_GenerateData< _THF >( );
+  typedef itk::GradientRecursiveGaussianImageFilter< I, O > _TGF;
+  this->_GenerateData< _TGF >( );
 }
 
 // -------------------------------------------------------------------------
index 98c8191b40fb0887795454bcfb29ba2aec1bfb21..ee2196e8ff4bd57ec7f801acae738a694e5479ec 100644 (file)
@@ -299,6 +299,27 @@ HideData( const std::string& name )
 {
 }
 
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::
+SetWindowLevel( const double& w, const double& l )
+{
+  this->m_MPRObjects->SetWindowLevel( w, l );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::QT::SimpleMPRWidget::
+GetWindow( ) const
+{
+  return( this->m_MPRObjects->GetWindow( ) );
+}
+
+// -------------------------------------------------------------------------
+double cpExtensions::QT::SimpleMPRWidget::
+GetLevel( ) const
+{
+  return( this->m_MPRObjects->GetLevel( ) );
+}
+
 // -------------------------------------------------------------------------
 vtkRenderWindowInteractor* cpExtensions::QT::SimpleMPRWidget::
 GetInteractor( unsigned int i )
index c4d5ec5e3e975cd94cc8500a373744ac531a2dcd..ba2b79b5777c72020f84a12bb6a7819ec6eb976b 100644 (file)
@@ -82,6 +82,9 @@ namespace cpExtensions
         );
       void ShowData( const std::string& name );
       void HideData( const std::string& name );
+      void SetWindowLevel( const double& w, const double& l );
+      double GetWindow( ) const;
+      double GetLevel( ) const;
 
       vtkRenderWindowInteractor* GetInteractor( unsigned int i );
 
diff --git a/lib/cpPlugins/BaseQtMainWindow.cxx b/lib/cpPlugins/BaseQtMainWindow.cxx
new file mode 100644 (file)
index 0000000..24953f0
--- /dev/null
@@ -0,0 +1,336 @@
+#include <cpPlugins/BaseQtMainWindow.h>
+
+#ifdef cpPlugins_QT4
+
+#include <cpExtensions/QT/SimpleMPRWidget.h>
+#include <cpPipelineEditor/Editor.h>
+#include <QApplication>
+#include <QDir>
+#include <QFileDialog>
+#include <QFileInfo>
+#include <QMessageBox>
+#include <QTreeWidget>
+
+// -------------------------------------------------------------------------
+bool cpPlugins::BaseQtMainWindow::_TBlocker::
+eventFilter( QObject* obj, QEvent* event )
+{
+  return( true ); // -> Block all events
+  /* NOTE: correct implementation:
+     switch( event->type( ) )
+     {
+     //list event you want to prevent here ...
+     case QEvent::KeyPress:
+     case QEvent::KeyRelease:
+     case QEvent::MouseButtonRelease:
+     case QEvent::MouseButtonPress:
+     case QEvent::MouseButtonDblClick:
+     //...
+     return( true );
+     } // hctiws
+     return( this->QObject::eventFilter( obj, event ) );
+  */
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::BaseQtMainWindow::
+BaseQtMainWindow(
+  int argc, char* argv[],
+  QApplication* app,
+  QWidget* parent
+  )
+  : Superclass( parent ),
+    m_Application( app ),
+    m_PluginsPath( "." ),
+    m_TreeWidget( NULL ),
+    m_Editor( NULL )
+{
+  // Prepare plugins interface
+  QFileInfo info( argv[ 0 ] );
+  if( info.exists( ) )
+  {
+    this->m_Interface.LoadConfiguration( cpPlugins_CONFIG_FILE );
+    this->_LoadPluginsFromPath( this->m_PluginsPath );
+    this->m_PluginsPath = info.canonicalPath( ).toStdString( );
+
+  } // fi
+  QDir exec_dir( "." );
+  if( exec_dir.exists( ) )
+  {
+    this->_LoadPluginsFromPath( exec_dir.canonicalPath( ).toStdString( ) );
+    this->m_PluginsPath = exec_dir.canonicalPath( ).toStdString( );
+
+  } // fi
+
+  // Prepare workspace
+  this->m_Workspace.SetInterface( &( this->m_Interface ) );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::BaseQtMainWindow::
+~BaseQtMainWindow( )
+{
+  this->m_Interface.UnloadAll( );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::BaseQtMainWindow::
+_Configure(
+  QTreeWidget* tree,
+  cpExtensions::QT::SimpleMPRWidget* mpr,
+  cpPipelineEditor::Editor* editor
+  )
+{
+  this->m_TreeWidget = tree;
+  if( this->m_TreeWidget != NULL )
+    this->_UpdateLoadedPlugins( );
+  this->m_Editor = editor;
+  if( this->m_Editor != NULL )
+    this->m_Editor->setWorkspace( &( this->m_Workspace ) );
+  if( mpr != NULL )
+    this->m_Workspace.SetMPRViewer( mpr );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::BaseQtMainWindow::
+_LoadPlugins( const std::string& filename )
+{
+  try
+  {
+    this->m_Interface.LoadPluginFile( filename );
+    this->_UpdateLoadedPlugins( );
+  }
+  catch( std::exception& err )
+  {
+    QMessageBox::critical(
+      this,
+      "Error loading plugins path",
+      err.what( )
+      );
+
+  } // yrt
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::BaseQtMainWindow::
+_LoadPluginsFromPath( const std::string& path )
+{
+  try
+  {
+    this->m_Interface.LoadPluginDir( path );
+    this->_UpdateLoadedPlugins( );
+  }
+  catch( std::exception& err )
+  {
+    QMessageBox::critical(
+      this,
+      "Error loading plugins path",
+      err.what( )
+      );
+
+  } // yrt
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::BaseQtMainWindow::
+_UpdateLoadedPlugins( )
+{
+  this->_Block( );
+  auto filters = this->m_Interface.GetFilters( );
+  if( filters.size( ) == 0 )
+  {
+    this->_UnBlock( );
+    QMessageBox::critical(
+      this,
+      "Error loading default plugins",
+      "No plugins loaded: remember to load some!!!"
+      );
+    return;
+
+  } // fi
+
+  if( this->m_TreeWidget != NULL )
+  {
+    for( auto cIt = filters.begin( ); cIt != filters.end( ); ++cIt )
+    {
+      // Create or get category
+      QList< QTreeWidgetItem* > cat_items =
+        this->m_TreeWidget->findItems(
+          cIt->first.c_str( ), Qt::MatchExactly | Qt::MatchRecursive
+          );
+      QTreeWidgetItem* cat = NULL;
+      if( cat_items.size( ) == 0 )
+      {
+        cat = new QTreeWidgetItem(
+          ( QTreeWidgetItem* )( NULL ), QStringList( cIt->first.c_str( ) )
+          );
+        this->m_TreeWidget->addTopLevelItem( cat );
+      }
+      else
+        cat = cat_items[ 0 ];
+
+      // Create filters
+      auto fIt = cIt->second.begin( );
+      for( ; fIt != cIt->second.end( ); ++fIt )
+      {
+        QList< QTreeWidgetItem* > filter_items =
+          this->m_TreeWidget->findItems(
+            fIt->c_str( ), Qt::MatchExactly | Qt::MatchRecursive
+            );
+        auto fiIt = filter_items.begin( );
+        auto found_fiIt = filter_items.end( );
+        for( ; fiIt != filter_items.end( ); ++fiIt )
+          if( ( *fiIt )->parent( ) == cat )
+            found_fiIt = fiIt;
+
+        // Add filter
+        if( found_fiIt == filter_items.end( ) )
+          QTreeWidgetItem* filter = new QTreeWidgetItem(
+            cat, QStringList( fIt->c_str( ) )
+            );
+
+      } // rof
+
+    } // rof
+
+  } // fi
+  this->_UnBlock( );
+  this->m_Interface.SaveConfiguration( cpPlugins_CONFIG_FILE );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::BaseQtMainWindow::
+_Block( )
+{
+  this->m_Application->setOverrideCursor( Qt::WaitCursor );
+  this->m_Application->installEventFilter( &( this->m_Blocker ) );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::BaseQtMainWindow::
+_UnBlock( )
+{
+  while( this->m_Application->overrideCursor( ) )
+    this->m_Application->restoreOverrideCursor( );
+  this->m_Application->removeEventFilter( &( this->m_Blocker ) );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::BaseQtMainWindow::
+_LoadWorkspace( const std::string& filename )
+{
+  std::string err = this->m_Workspace.LoadWorkspace( filename );
+  if( err != "" )
+  {
+    QMessageBox::critical(
+      this,
+      QMessageBox::tr( "Error loading workspace" ),
+      QMessageBox::tr( err.c_str( ) )
+      );
+  }
+  else
+  {
+    if( this->m_Editor != NULL )
+      this->m_Editor->setWorkspace( &( this->m_Workspace ) );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::BaseQtMainWindow::
+_SaveWorkspace( const std::string& filename )
+{
+  std::string err = this->m_Workspace.SaveWorkspace( filename );
+  if( err != "" )
+    QMessageBox::critical(
+      this,
+      QMessageBox::tr( "Error saving workspace" ),
+      QMessageBox::tr( err.c_str( ) )
+      );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::BaseQtMainWindow::
+_InteractiveLoadPlugins( )
+{
+  QFileDialog dlg( this );
+  dlg.setFileMode( QFileDialog::ExistingFiles );
+  dlg.setDirectory( this->m_PluginsPath.c_str( ) );
+
+  std::stringstream name_filter;
+  std::string suffix = std::string( cpPlugins_PLUGIN_EXT );
+  name_filter
+    << "Plugins file (*." << cpPlugins_PLUGIN_EXT << ");;All files (*)";
+  dlg.setNameFilter( name_filter.str( ).c_str( ) );
+  dlg.setDefaultSuffix( suffix.c_str( ) );
+  if( !( dlg.exec( ) ) )
+    return;
+
+  QStringList names = dlg.selectedFiles( );
+  for( auto qIt = names.begin( ); qIt != names.end( ); ++qIt )
+    this->_LoadPlugins( qIt->toStdString( ) );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::BaseQtMainWindow::
+_InteractiveLoadPluginsFromPath( )
+{
+  QFileDialog dlg( this );
+  dlg.setFileMode( QFileDialog::DirectoryOnly );
+  dlg.setDirectory( this->m_PluginsPath.c_str( ) );
+  if( !( dlg.exec( ) ) )
+    return;
+  this->_LoadPluginsFromPath( dlg.selectedFiles( ).begin( )->toStdString( ) );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::BaseQtMainWindow::
+_InteractiveLoadWorkspace( )
+{
+  QFileDialog dlg( this );
+  dlg.setFileMode( QFileDialog::ExistingFile );
+  dlg.setDirectory( "." );
+  dlg.setNameFilter(
+    QFileDialog::tr( "Workspace file (*.wxml);;All files (*)" )
+    );
+  dlg.setDefaultSuffix( QFileDialog::tr( "wxml" ) );
+  if( !( dlg.exec( ) ) )
+    return;
+  this->_LoadWorkspace( dlg.selectedFiles( ).begin( )->toStdString( ) );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::BaseQtMainWindow::
+_InteractiveSaveWorkspace( )
+{
+  QFileDialog dlg( this );
+  dlg.setFileMode( QFileDialog::AnyFile );
+  dlg.setDirectory( "." );
+  dlg.setAcceptMode( QFileDialog::AcceptSave );
+  dlg.setNameFilter(
+    QFileDialog::tr( "Workspace file (*.wxml);;All files (*)" )
+    );
+  dlg.setDefaultSuffix( QFileDialog::tr( "wxml" ) );
+  if( !( dlg.exec( ) ) )
+    return;
+  this->_SaveWorkspace( dlg.selectedFiles( ).begin( )->toStdString( ) );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::BaseQtMainWindow::
+_ExecFilter( const std::string& filter_name )
+{
+  this->_Block( );
+  std::string err = this->m_Workspace.Execute( filter_name );
+  this->_UnBlock( );
+  if( err != "" )
+    QMessageBox::critical(
+      this,
+      QMessageBox::tr( "Error executing filter" ),
+      QMessageBox::tr( err.c_str( ) )
+      );
+}
+
+#endif // cpPlugins_QT4
+
+// eof - $RCSfile$
diff --git a/lib/cpPlugins/BaseQtMainWindow.h b/lib/cpPlugins/BaseQtMainWindow.h
new file mode 100644 (file)
index 0000000..430de43
--- /dev/null
@@ -0,0 +1,95 @@
+#ifndef __CPPLUGINS__BASEQTMAINWINDOW__H__
+#define __CPPLUGINS__BASEQTMAINWINDOW__H__
+
+#include <cpPlugins/Config.h>
+
+#ifdef cpPlugins_QT4
+
+#include <QMainWindow>
+#include <cpPlugins/Interface.h>
+#include <cpPlugins/Workspace.h>
+
+namespace cpExtensions
+{
+  namespace QT
+  {
+    class SimpleMPRWidget;
+  }
+}
+namespace cpPipelineEditor
+{
+  class Editor;
+}
+class QTreeWidget;
+
+namespace cpPlugins
+{
+  /**
+   */
+  class cpPlugins_EXPORT BaseQtMainWindow
+    : public QMainWindow
+  {
+    Q_OBJECT;
+
+  public:
+    typedef BaseQtMainWindow Self;
+    typedef QMainWindow      Superclass;
+
+  protected:
+    /**
+     */
+    class _TBlocker
+      : public QObject
+    {
+    protected:
+      virtual bool eventFilter( QObject* obj, QEvent* event ) ITK_OVERRIDE;
+    };
+
+  public:
+    explicit BaseQtMainWindow(
+      int argc, char* argv[],
+      QApplication* app,
+      QWidget* parent = NULL
+      );
+    virtual ~BaseQtMainWindow( );
+
+  protected:
+    void _Configure(
+      QTreeWidget* tree,
+      cpExtensions::QT::SimpleMPRWidget* mpr,
+      cpPipelineEditor::Editor* editor
+      );
+    void _LoadPlugins( const std::string& filename );
+    void _LoadPluginsFromPath( const std::string& path );
+    void _UpdateLoadedPlugins( );
+    void _Block( );
+    void _UnBlock( );
+
+    void _LoadWorkspace( const std::string& filename );
+    void _SaveWorkspace( const std::string& filename );
+
+  protected slots:
+    void _InteractiveLoadPlugins( );
+    void _InteractiveLoadPluginsFromPath( );
+    void _InteractiveLoadWorkspace( );
+    void _InteractiveSaveWorkspace( );
+    void _ExecFilter( const std::string& filter_name );
+
+  protected:
+    QApplication* m_Application;
+    _TBlocker     m_Blocker;
+    Workspace     m_Workspace;
+    Interface     m_Interface;
+    std::string   m_PluginsPath;
+
+    QTreeWidget* m_TreeWidget;
+    cpPipelineEditor::Editor* m_Editor;
+  };
+
+} // ecapseman
+
+#endif // cpPlugins_QT4
+
+#endif // __CPPLUGINS__BASEQTMAINWINDOW__H__
+
+// eof - $RCSfile$
index 8cf91bd571e21a05131b35c25265ef2309ca16f3..b1d2741a781dafbe87c4e76b86a28b87c6ac9b53 100644 (file)
@@ -32,10 +32,12 @@ IF(USE_QT4)
     )
   SET(
     lib_QT_Headers
+    BaseQtMainWindow.h
     ParametersQtDialog.h
     )
   SET(
     lib_QT_Sources
+    BaseQtMainWindow.cxx
     ParametersQtDialog.cxx
     )
   SET(
index 47778ddf3b490dac9c09d7fd8fd90b4dead792b2..6caf7f073d565a7f9ffdaababccf6df7053ee605 100644 (file)
@@ -110,6 +110,9 @@ _ITK_2_VTK_2( itk::LightObject* o )
 #define cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, PIXEL, D )      \
   this->FUNC( dynamic_cast< itk::Image< PIXEL, D >* >( INPUT ) )
 
+#define cpPlugin_Image_Demangle_VectorPixel_Dim( FUNC, INPUT, VECTOR, PIXEL, D ) \
+  this->FUNC( dynamic_cast< itk::Image< VECTOR< PIXEL, D >, D >* >( INPUT ) )
+
 #define cpPlugin_Image_Demangle_Pixel_AllScalars( r, FUNC, INPUT, D )   \
   r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, char, D );        \
   if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, short, D ); \
@@ -144,6 +147,10 @@ _ITK_2_VTK_2( itk::LightObject* o )
   if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, itk::RGBAPixel< unsigned int >, D ); \
   if( r != "" ) r = cpPlugin_Image_Demangle_Pixel_Dim( FUNC, INPUT, itk::RGBAPixel< unsigned long >, D )
 
+#define cpPlugin_Image_Demangle_VectorPixel_AllFloats( r, FUNC, INPUT, VECTOR, D ) \
+  r = cpPlugin_Image_Demangle_VectorPixel_Dim( FUNC, INPUT, VECTOR, float, D ); \
+  if( r != "" ) r = cpPlugin_Image_Demangle_VectorPixel_Dim( FUNC, INPUT, VECTOR, double, D )
+
 #endif // __CPPLUGINS__IMAGE__HXX__
 
 // eof - $RCSfile$
index 58e468d29e114cc2b802a22fab6cb1b8f90d07f2..1d883736b1af1fffdf9350921c756e500626586a 100644 (file)
@@ -82,7 +82,9 @@ LoadPluginFile( const std::string& filename )
       );
 
   // Check if it was already loaded
-  if( this->m_DynLibraries.find( canonical_fn ) != this->m_DynLibraries.end( ) )
+  if(
+    this->m_DynLibraries.find( canonical_fn ) != this->m_DynLibraries.end( )
+    )
     return;
 
   // Ok, try to load the library
@@ -154,7 +156,11 @@ LoadPluginDir( const std::string& dirname )
     {
       try
       {
-        this->LoadPluginFile( ent->d_name );
+        this->LoadPluginFile(
+          dirname +
+          std::string( "/" ) +
+          ent->d_name
+          );
         count++;
       }
       catch( ... )
index 76bde83298cd9161ff3a8e9925e954db02a0b03e..76ba6dd22fc356253c9f2e20e351172fcacf0c2c 100644 (file)
@@ -1,7 +1,6 @@
 #include <cpPlugins/Mesh.h>
 
 #include <itkMesh.h>
-#include <itkQuadEdgeMesh.h>
 #include <itkLineCell.h>
 #include <itkTriangleCell.h>
 #include <itkPolygonCell.h>
@@ -17,10 +16,6 @@ SetITK( itk::LightObject* o )
   if( !r ) r = this->_ITK_2_VTK< itk::Mesh< double, 2 > >( o );
   if( !r ) r = this->_ITK_2_VTK< itk::Mesh< float, 3 > >( o );
   if( !r ) r = this->_ITK_2_VTK< itk::Mesh< double, 3 > >( o );
-  if( !r ) r = this->_ITK_2_VTK< itk::QuadEdgeMesh< float, 2 > >( o );
-  if( !r ) r = this->_ITK_2_VTK< itk::QuadEdgeMesh< double, 2 > >( o );
-  if( !r ) r = this->_ITK_2_VTK< itk::QuadEdgeMesh< float, 3 > >( o );
-  if( !r ) r = this->_ITK_2_VTK< itk::QuadEdgeMesh< double, 3 > >( o );
 }
 
 // -------------------------------------------------------------------------
index 4d792de68c04d0882247b2b37e359a4cffd40afe..ab205345137ad3c4df911e54240cc9dea9822add 100644 (file)
@@ -6,6 +6,11 @@
 
 namespace itk
 {
+  cpPlugins_ITKInstances_Base_ostream( FixedArray, float, 2 );
+  cpPlugins_ITKInstances_Base_ostream( FixedArray, double, 2 );
+  cpPlugins_ITKInstances_Base_ostream( FixedArray, float, 3 );
+  cpPlugins_ITKInstances_Base_ostream( FixedArray, double, 3 );
+
   cpPlugins_ITKInstances_Base_ostream( Point, float, 1 );
   cpPlugins_ITKInstances_Base_ostream( Vector, float, 1 );
   cpPlugins_ITKInstances_Base_ostream( Point, double, 1 );
index 7c156e564964d03a4f343315f37692d441d4a3b3..38010d4f9db9cc5666ad98fbcc2c98dcc9ed48dc 100644 (file)
@@ -4,6 +4,7 @@ i map
 i string
 i vector
 i itkArray.h
+i itkArray2D.h
 i itkConvertPixelBuffer.h
 i itkDefaultConvertPixelTraits.h
 i itkFixedArray.h
@@ -11,17 +12,25 @@ i itkImportImageContainer.h
 i itkIndex.h
 i itkMatrix.h
 i itkPoint.h
+i itkCovariantVector.h
 i itkVector.h
 i itkRGBPixel.h
 i itkRGBAPixel.h
 i itkSimpleDataObjectDecorator.h
+i itkDataObjectDecorator.h
+i itkAffineTransform.h
+i itkTransform.h
 c itk::Array< #1 >
 c itk::FixedArray< #1 , #2 >
 c itk::FixedArray< float , 6 >
 c itk::Point< #5 , #2 >
 c itk::Vector< #5 , #2 >
+c itk::CovariantVector< #5 , #2 >
 c itk::Matrix< #5 , #2 , #2 >
 c #7 < #1 >
+c itk::Array2D < #5 >
+c itk::Transform < #5 , #2 , #2 >
+c itk::DataObjectDecorator< itk::Transform < #5 , #2 , #2 > >
 c itk::SimpleDataObjectDecorator< #1 >
 c itk::SimpleDataObjectDecorator< #3 >
 c itk::SimpleDataObjectDecorator< std::vector< itk::Index< #6 > > >
@@ -33,6 +42,7 @@ c itk::ConvertPixelBuffer< #1 , #7 < #4 > , itk::DefaultConvertPixelTraits< #7 <
 c itk::ImportImageContainer< unsigned long , #1 >
 c itk::ImportImageContainer< unsigned long , std::complex< #5 > >
 c itk::ImportImageContainer< unsigned long , #7 < #1 > >
+c itk::ImportImageContainer< unsigned long , #8 < #5 , #2 > >
 a #1 = #integers;#floats
 a #2 = #all_dims
 a #3 = bool;std::string
@@ -40,3 +50,4 @@ a #4 = #integers;#floats
 a #5 = #floats
 a #6 = #all_visual_dims
 a #7 = itk::RGBPixel;itk::RGBAPixel
+a #8 = itk::Vector;itk::CovariantVector
index 9090add3c57082db1efc33970d80215340f4ad8d..4d9976ff87a8d4d104c4be1b6a69044342f85d2f 100644 (file)
@@ -1,4 +1,5 @@
 #include <cpPlugins_ITKInstances/Image.h>
+#include <itkFixedArray.h>
 
 // -------------------------------------------------------------------------
 #define cpPlugins_ITKInstances_Image_ImageRegion( D )                   \
index 73d0c8ea6bd8e0e42782c775918146ba992a2a21..88ed85c59c91994c4a06c56f8d8aaf27089e0118 100644 (file)
@@ -7,7 +7,10 @@ c itk::ImageSource< itk::Image< #1 , #2 > >
 c itk::ImageSource< itk::Image< std::complex< #3 > , #2 > >
 c itk::ImageSource< itk::Image< #5 < #1 > , #2 > >
 c itk::ImageToImageFilter< itk::Image< #1 , #2 > , itk::Image< #4 , #2 > >
+c itk::ImageToImageFilter< itk::Image< #1 , 2 > , itk::Image< #1 , 3 > >
+c itk::ImageToImageFilter< itk::Image< #1 , 3 > , itk::Image< #1 , 2 > >
 c itk::InPlaceImageFilter< itk::Image< #1 , #2 > , itk::Image< #4 , #2 > >
+c itk::InPlaceImageFilter< itk::Image< #1 , 3 > , itk::Image< #1 , 2 > >
 c itk::ImageTransformer< itk::Image< #1 , #2 > >
 a #1 = #integers;#floats
 a #2 = #all_dims
index 7b1708d6971052aaf365e1217f46ae0f0fab1bde..8811f6e3f26819223ebaf790a8967c91d17e3872 100644 (file)
@@ -13,6 +13,7 @@ c itk::ImageRegion< #2 >
 c itk::Image< #1 , #2 >
 c itk::Image< std::complex< #4 > , #2 >
 c itk::Image< #6 < #1 > , #2 >
+c itk::Image< #7 < #4 , #2 > , #2 >
 c itk::ImageToVTKImageFilter< itk::Image< #1 , #3 > >
 c itk::ImageToVTKImageFilter< itk::Image< #6 < #1 > , #3 > >
 a #1 = #integers;#floats
@@ -21,3 +22,4 @@ a #3 = #all_visual_dims
 a #4 = #floats
 a #5 = #integers_ptr;#floats_ptr
 a #6 = itk::RGBPixel;itk::RGBAPixel
+a #7 = itk::Vector;itk::CovariantVector
index 7cec3ab911d221e703d800202a99273d54e29467..91077f627c817030c650e84c618bd3646ba69ea0 100644 (file)
@@ -2,12 +2,10 @@ f cpPlugins_ITKInstances/Base.h
 i itkBoundingBox.h
 i itkPointSet.h
 i itkMesh.h
-i itkQuadEdgeMesh.h
 i itkLineCell.h
 i itkPolygonCell.h
 i itkTriangleCell.h
 c itk::VectorContainer< unsigned long, itk::Point< #1 , #2 > >
-c itk::MapContainer< unsigned long , itk::QuadEdgeMeshPoint< #1 , #2 , itk::GeometricalQuadEdge< unsigned long, unsigned long, bool, bool, true > > >
 c itk::BoundingBox< unsigned long , #2 , float, itk::VectorContainer< unsigned long , itk::Point< float , #2 > > >
 c itk::PointSet< #1 , #2 >
 c #4 < #1 , #2 >
@@ -15,4 +13,4 @@ c #3 < itk::CellInterface< #1 , itk::CellTraitsInfo< #2 , float , float , unsign
 a #1 = #floats
 a #2 = #all_visual_dims
 a #3 = itk::LineCell;itk::PolygonCell;itk::TriangleCell
-a #4 = itk::Mesh;itk::QuadEdgeMesh
+a #4 = itk::Mesh
index 1a8c84d682a5e05135f5a924d7e3eb3446ea53e5..1ee81a983d9d70b0b1fb0ec280c4bb611be240d1 100644 (file)
@@ -57,7 +57,7 @@ GENERATE_EXPORT_HEADER(
   EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/plugins/${lib_DIR}/${lib_NAME}_Export.h
   STATIC_DEFINE ${lib_NAME}_BUILT_AS_STATIC
   )
-TARGET_LINK_LIBRARIES(${lib_NAME} ${target_LIBRARIES})
+TARGET_LINK_LIBRARIES(${lib_NAME} cpPipelineEditor ${target_LIBRARIES})
 
 ## ========================
 ## -- Installation rules --
index 94af7c5b516fe4a23fcd6275f2a7ccb0be897ba2..262bca9e97f227649c52e693d664202b3ddd7452 100644 (file)
@@ -58,7 +58,7 @@ GENERATE_EXPORT_HEADER(
   EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/plugins/${lib_DIR}/${lib_NAME}_Export.h
   STATIC_DEFINE ${lib_NAME}_BUILT_AS_STATIC
   )
-TARGET_LINK_LIBRARIES(${lib_NAME} ${target_LIBRARIES})
+TARGET_LINK_LIBRARIES(${lib_NAME} cpPipelineEditor ${target_LIBRARIES})
 
 ## ========================
 ## -- Installation rules --
diff --git a/plugins/cpPluginsImageFilters/ExtractImageFilter.cxx b/plugins/cpPluginsImageFilters/ExtractImageFilter.cxx
new file mode 100644 (file)
index 0000000..ac2b1cd
--- /dev/null
@@ -0,0 +1,79 @@
+#include <cpPluginsImageFilters/ExtractImageFilter.h>
+#include <cpPlugins/Image.h>
+#include <cpPlugins_ITKInstances/ImageFilters.h>
+
+#include <itkExtractImageFilter.h>
+#include <itkExtractImageFilter.hxx>
+#include <itkImageAlgorithm.hxx>
+
+// -------------------------------------------------------------------------
+cpPluginsImageFilters::ExtractImageFilter::
+ExtractImageFilter( )
+  : Superclass( )
+{
+  this->_AddInput( "Input" );
+  this->_AddOutput< cpPlugins::Image >( "Output" );
+  this->m_Parameters.ConfigureAsBool( "ReduceDimension" );
+  this->m_Parameters.SetBool( "ReduceDimension", false );
+
+  /* TODO
+     std::vector< std::string > choices;
+     choices.push_back( "float" );
+     choices.push_back( "double" );
+     this->m_Parameters.ConfigureAsChoices( "ScalarType", choices );
+     this->m_Parameters.SetSelectedChoice( "ScalarType", "float" );
+     this->m_Parameters.ConfigureAsReal( "UpperThresholdValue" );
+     this->m_Parameters.ConfigureAsUint( "InsideValue" );
+     this->m_Parameters.ConfigureAsUint( "OutsideValue" );
+
+     this->m_Parameters.SetReal( "LowerThresholdValue", 0 );
+     this->m_Parameters.SetReal( "UpperThresholdValue", 10000 );
+     this->m_Parameters.SetReal( "InsideValue", 1 );
+     this->m_Parameters.SetReal( "OutsideValue", 0 );
+  */
+}
+
+// -------------------------------------------------------------------------
+cpPluginsImageFilters::ExtractImageFilter::
+~ExtractImageFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+std::string cpPluginsImageFilters::ExtractImageFilter::
+_GenerateData( )
+{
+  auto image = this->GetInputData( "Input" )->GetITK< itk::DataObject >( );
+  std::string cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 3 );
+  return( r );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage >
+std::string cpPluginsImageFilters::ExtractImageFilter::
+_GD0( _TImage* image )
+{
+  typedef
+    itk::Image< typename _TImage::PixelType, _TImage::ImageDimension - 1 >
+    _TOutImage;
+  typedef itk::ExtractImageFilter< _TImage, _TOutImage > _TFilter;
+
+  if( image == NULL )
+    return(
+      "ImageFilters::ExtractImageFilter: No valid input image."
+      );
+
+
+  // Configure filter
+  typename _TImage::RegionType reg;
+
+  _TFilter* filter = this->_CreateITK< _TFilter >( );
+  filter->SetInput( image );
+  filter->SetExtractionRegion( reg );
+
+  // Connect output
+  this->GetOutputData( "Output" )->SetITK( filter->GetOutput( ) );
+  return( "" );
+}
+
+// eof - $RCSfile$
diff --git a/plugins/cpPluginsImageFilters/ExtractImageFilter.h b/plugins/cpPluginsImageFilters/ExtractImageFilter.h
new file mode 100644 (file)
index 0000000..01ad545
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef __CPPLUGINSIMAGEFILTERS__EXTRACTIMAGEFILTER__H__
+#define __CPPLUGINSIMAGEFILTERS__EXTRACTIMAGEFILTER__H__
+
+#include <plugins/cpPluginsImageFilters/cpPluginsImageFilters_Export.h>
+#include <cpPlugins/ProcessObject.h>
+
+namespace cpPluginsImageFilters
+{
+  /**
+   */
+  class cpPluginsImageFilters_EXPORT ExtractImageFilter
+    : public cpPlugins::ProcessObject
+  {
+  public:
+    typedef ExtractImageFilter                  Self;
+    typedef cpPlugins::ProcessObject        Superclass;
+    typedef itk::SmartPointer< Self >       Pointer;
+    typedef itk::SmartPointer< const Self > ConstPointer;
+
+  public:
+    itkNewMacro( Self );
+    itkTypeMacro( ExtractImageFilter, cpPlugins::ProcessObject );
+    cpPlugins_Id_Macro( ExtractImageFilter, ImageFilters );
+
+  protected:
+    ExtractImageFilter( );
+    virtual ~ExtractImageFilter( );
+
+    virtual std::string _GenerateData( );
+
+    template< class _TImage >
+      inline std::string _GD0( _TImage* image );
+
+  private:
+    // Purposely not implemented
+    ExtractImageFilter( const Self& );
+    Self& operator=( const Self& );
+  };
+
+} // ecapseman
+
+#endif // __CPPLUGINSIMAGEFILTERS__EXTRACTIMAGEFILTER__H__
+
+// eof - $RCSfile$
diff --git a/plugins/cpPluginsImageFilters/IsoImageSlicer.cxx b/plugins/cpPluginsImageFilters/IsoImageSlicer.cxx
new file mode 100644 (file)
index 0000000..942a6e4
--- /dev/null
@@ -0,0 +1,116 @@
+#include <cpPluginsImageFilters/IsoImageSlicer.h>
+#include <cpPlugins/Image.h>
+#include <cpPlugins_ITKInstances/ImageFilters.h>
+
+#include <cpExtensions/Algorithms/IsoImageSlicer.h>
+#include <cpExtensions/Algorithms/IsoImageSlicer.hxx>
+#include <itkAffineTransform.hxx>
+#include <itkMatrixOffsetTransformBase.hxx>
+#include <itkVariableLengthVector.hxx>
+#include <itkDiffusionTensor3D.hxx>
+#include <itkOptimizerParameters.hxx>
+/*
+  #include <itkIsoImageSlicer.h>
+  #include <itkIsoImageSlicer.hxx>
+  #include <itkUnaryFunctorImageFilter.hxx>
+*/
+
+// -------------------------------------------------------------------------
+cpPluginsImageFilters::IsoImageSlicer::
+IsoImageSlicer( )
+  : Superclass( )
+{
+  this->_AddInput( "Input" );
+  this->_AddOutput< cpPlugins::Image >( "Output" );
+
+  std::vector< std::string > choices;
+  choices.push_back( "float" );
+  choices.push_back( "double" );
+  this->m_Parameters.ConfigureAsChoices( "ScalarType", choices );
+  this->m_Parameters.SetSelectedChoice( "ScalarType", "float" );
+  /* TODO
+     this->m_Parameters.ConfigureAsReal( "LowerThresholdValue" );
+     this->m_Parameters.ConfigureAsReal( "UpperThresholdValue" );
+     this->m_Parameters.ConfigureAsUint( "InsideValue" );
+     this->m_Parameters.ConfigureAsUint( "OutsideValue" );
+
+     this->m_Parameters.SetReal( "LowerThresholdValue", 0 );
+     this->m_Parameters.SetReal( "UpperThresholdValue", 10000 );
+     this->m_Parameters.SetReal( "InsideValue", 1 );
+     this->m_Parameters.SetReal( "OutsideValue", 0 );
+  */
+}
+
+// -------------------------------------------------------------------------
+cpPluginsImageFilters::IsoImageSlicer::
+~IsoImageSlicer( )
+{
+}
+
+// -------------------------------------------------------------------------
+std::string cpPluginsImageFilters::IsoImageSlicer::
+_GenerateData( )
+{
+  auto image = this->GetInputData( "Input" )->GetITK< itk::DataObject >( );
+  std::string cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 3 );
+  return( r );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage >
+std::string cpPluginsImageFilters::IsoImageSlicer::
+_GD0( _TImage* image )
+{
+  if( image != NULL )
+  {
+    auto choice = this->m_Parameters.GetSelectedChoice( "OutputResolution" );
+    if( choice == "float" )
+      return( this->_GD1< _TImage, float >( image ) );
+    else if( choice == "double" )
+      return( this->_GD1< _TImage, double >( image ) );
+    else return( "IsoImageSlicer: no valid scalar type." );
+  }
+  else
+    return(
+      "ImageFilters::IsoImageSlicer: No valid input image."
+      );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage, class _TScalar >
+std::string cpPluginsImageFilters::IsoImageSlicer::
+_GD1( _TImage* image )
+{
+  typedef
+    cpExtensions::Algorithms::IsoImageSlicer< _TImage, _TScalar >
+    _TFilter;
+  typedef typename _TFilter::TVector _TVector;
+  typedef typename _TFilter::TMatrix _TMatrix;
+
+  // Configure filter
+  _TFilter* filter = this->_CreateITK< _TFilter >( );
+  filter->SetInput( image );
+  filter->SetInterpolator( NULL );
+  filter->SetTranslation( _TVector( ) );
+  filter->SetRotation( _TMatrix( ) );
+  filter->SetSize( 1 );
+  /* TODO
+     filter->SetLowerThreshold( lower_val );
+     filter->SetUpperThreshold( upper_val );
+     filter->SetInsideValue( in_val );
+     filter->SetOutsideValue( out_val );
+     filter->Update( );
+  */
+
+  // Connect output
+  this->GetOutputData( "Output" )->SetITK( filter->GetOutput( ) );
+  return( "" );
+}
+
+#include <cpExtensions/Algorithms/BezierCurveFunction.h>
+#include <cpExtensions/Algorithms/BezierCurveFunction.hxx>
+
+template class cpPluginsImageFilters_EXPORT cpExtensions::Algorithms::BezierCurveFunction< itk::Vector< float, 3 > >;
+template class cpPluginsImageFilters_EXPORT cpExtensions::Algorithms::BezierCurveFunction< itk::Vector< double, 3 > >;
+
+// eof - $RCSfile$
diff --git a/plugins/cpPluginsImageFilters/IsoImageSlicer.h b/plugins/cpPluginsImageFilters/IsoImageSlicer.h
new file mode 100644 (file)
index 0000000..96868e8
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef __CPPLUGINSIMAGEFILTERS__ISOIMAGESLICER__H__
+#define __CPPLUGINSIMAGEFILTERS__ISOIMAGESLICER__H__
+
+#include <plugins/cpPluginsImageFilters/cpPluginsImageFilters_Export.h>
+#include <cpPlugins/ProcessObject.h>
+
+namespace cpPluginsImageFilters
+{
+  /**
+   */
+  class cpPluginsImageFilters_EXPORT IsoImageSlicer
+    : public cpPlugins::ProcessObject
+  {
+  public:
+    typedef IsoImageSlicer                  Self;
+    typedef cpPlugins::ProcessObject        Superclass;
+    typedef itk::SmartPointer< Self >       Pointer;
+    typedef itk::SmartPointer< const Self > ConstPointer;
+
+  public:
+    itkNewMacro( Self );
+    itkTypeMacro( IsoImageSlicer, cpPlugins::ProcessObject );
+    cpPlugins_Id_Macro( IsoImageSlicer, ImageFilters );
+
+  protected:
+    IsoImageSlicer( );
+    virtual ~IsoImageSlicer( );
+
+    virtual std::string _GenerateData( );
+
+    template< class _TImage >
+      inline std::string _GD0( _TImage* image );
+
+    template< class _TImage, class _TScalar >
+      inline std::string _GD1( _TImage* image );
+
+  private:
+    // Purposely not implemented
+    IsoImageSlicer( const Self& );
+    Self& operator=( const Self& );
+  };
+
+} // ecapseman
+
+#endif // __CPPLUGINSIMAGEFILTERS__ISOIMAGESLICER__H__
+
+// eof - $RCSfile$
diff --git a/plugins/cpPluginsImageFilters/JoinSeriesImageFilter.cxx b/plugins/cpPluginsImageFilters/JoinSeriesImageFilter.cxx
new file mode 100644 (file)
index 0000000..9b58be4
--- /dev/null
@@ -0,0 +1,64 @@
+#include <cpPluginsImageFilters/JoinSeriesImageFilter.h>
+#include <cpPlugins/Image.h>
+#include <cpPlugins_ITKInstances/ImageFilters.h>
+
+#include <itkJoinSeriesImageFilter.h>
+#include <itkJoinSeriesImageFilter.hxx>
+#include <itkImageAlgorithm.hxx>
+
+// -------------------------------------------------------------------------
+cpPluginsImageFilters::JoinSeriesImageFilter::
+JoinSeriesImageFilter( )
+  : Superclass( )
+{
+  this->_AddInput( "Input" );
+  this->_AddOutput< cpPlugins::Image >( "Output" );
+}
+
+// -------------------------------------------------------------------------
+cpPluginsImageFilters::JoinSeriesImageFilter::
+~JoinSeriesImageFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+std::string cpPluginsImageFilters::JoinSeriesImageFilter::
+_GenerateData( )
+{
+  auto image = this->GetInputData( "Input" )->GetITK< itk::DataObject >( );
+  std::string cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 2 );
+  return( r );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage >
+std::string cpPluginsImageFilters::JoinSeriesImageFilter::
+_GD0( _TImage* image )
+{
+  typedef
+    itk::Image< typename _TImage::PixelType, _TImage::ImageDimension + 1 >
+    _TOutImage;
+  typedef itk::JoinSeriesImageFilter< _TImage, _TOutImage > _TFilter;
+
+  if( image == NULL )
+    return(
+      "ImageFilters::JoinSeriesImageFilter: No valid input image."
+      );
+
+  // Configure filter
+  _TFilter* filter = this->_CreateITK< _TFilter >( );
+  filter->SetInput( image );
+  /* TODO
+     filter->SetLowerThreshold( lower_val );
+     filter->SetUpperThreshold( upper_val );
+     filter->SetInsideValue( in_val );
+     filter->SetOutsideValue( out_val );
+     filter->Update( );
+  */
+
+  // Connect output
+  this->GetOutputData( "Output" )->SetITK( filter->GetOutput( ) );
+  return( "" );
+}
+
+// eof - $RCSfile$
diff --git a/plugins/cpPluginsImageFilters/JoinSeriesImageFilter.h b/plugins/cpPluginsImageFilters/JoinSeriesImageFilter.h
new file mode 100644 (file)
index 0000000..02d1d49
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef __CPPLUGINSIMAGEFILTERS__JOINSERIESIMAGEFILTER__H__
+#define __CPPLUGINSIMAGEFILTERS__JOINSERIESIMAGEFILTER__H__
+
+#include <plugins/cpPluginsImageFilters/cpPluginsImageFilters_Export.h>
+#include <cpPlugins/ProcessObject.h>
+
+namespace cpPluginsImageFilters
+{
+  /**
+   */
+  class cpPluginsImageFilters_EXPORT JoinSeriesImageFilter
+    : public cpPlugins::ProcessObject
+  {
+  public:
+    typedef JoinSeriesImageFilter           Self;
+    typedef cpPlugins::ProcessObject        Superclass;
+    typedef itk::SmartPointer< Self >       Pointer;
+    typedef itk::SmartPointer< const Self > ConstPointer;
+
+  public:
+    itkNewMacro( Self );
+    itkTypeMacro( JoinSeriesImageFilter, cpPlugins::ProcessObject );
+    cpPlugins_Id_Macro( JoinSeriesImageFilter, ImageFilters );
+
+  protected:
+    JoinSeriesImageFilter( );
+    virtual ~JoinSeriesImageFilter( );
+
+    virtual std::string _GenerateData( );
+
+    template< class _TImage >
+      inline std::string _GD0( _TImage* image );
+
+    template< class _TImage, class _TScalar >
+      inline std::string _GD1( _TImage* image );
+
+  private:
+    // Purposely not implemented
+    JoinSeriesImageFilter( const Self& );
+    Self& operator=( const Self& );
+  };
+
+} // ecapseman
+
+#endif // __CPPLUGINSIMAGEFILTERS__JOINSERIESIMAGEFILTER__H__
+
+// eof - $RCSfile$
diff --git a/plugins/cpPluginsImageFilters/MultiScaleGaussianImageFilter.cxx b/plugins/cpPluginsImageFilters/MultiScaleGaussianImageFilter.cxx
new file mode 100644 (file)
index 0000000..07e5956
--- /dev/null
@@ -0,0 +1,107 @@
+#include <cpPluginsImageFilters/MultiScaleGaussianImageFilter.h>
+#include <cpPlugins/Image.h>
+#include <cpPlugins_ITKInstances/ImageFilters.h>
+
+#include <cpExtensions/Algorithms/MultiScaleGaussianImageFilter.h>
+#include <cpExtensions/Algorithms/MultiScaleGaussianImageFilter.hxx>
+#include <itkGradientRecursiveGaussianImageFilter.hxx>
+#include <itkImageAdaptor.hxx>
+#include <itkImageToImageFilter.hxx>
+#include <itkInPlaceImageFilter.hxx>
+#include <itkUnaryFunctorImageFilter.hxx>
+#include <itkRecursiveGaussianImageFilter.hxx>
+#include <itkImageConstIteratorWithIndex.hxx>
+#include <itkRecursiveSeparableImageFilter.hxx>
+#include <itkBinaryFunctorImageFilter.hxx>
+#include <itkImageRegionConstIterator.hxx>
+#include <itkImageScanlineIterator.hxx>
+#include <itkImageSource.hxx>
+#include <itkImageRegionIteratorWithIndex.hxx>
+#include <itkImageScanlineConstIterator.hxx>
+#include <itkImageRegionIterator.hxx>
+#include <itkSimpleDataObjectDecorator.hxx>
+#include <itkImageRegionConstIteratorWithIndex.hxx>
+
+// -------------------------------------------------------------------------
+cpPluginsImageFilters::MultiScaleGaussianImageFilter::
+MultiScaleGaussianImageFilter( )
+  : Superclass( )
+{
+  this->_AddInput( "Input" );
+  this->_AddOutput< cpPlugins::Image >( "Output" );
+
+  this->m_Parameters.ConfigureAsRealList( "Sigmas" );
+
+  std::vector< std::string > choices;
+  choices.push_back( "float" );
+  choices.push_back( "double" );
+  this->m_Parameters.ConfigureAsChoices( "ScalarType", choices );
+  this->m_Parameters.SetSelectedChoice( "ScalarType", "float" );
+}
+
+// -------------------------------------------------------------------------
+cpPluginsImageFilters::MultiScaleGaussianImageFilter::
+~MultiScaleGaussianImageFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+std::string cpPluginsImageFilters::MultiScaleGaussianImageFilter::
+_GenerateData( )
+{
+  auto image = this->GetInputData( "Input" )->GetITK< itk::DataObject >( );
+  std::string   cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 2 );
+  if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 3 );
+  return( r );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage >
+std::string cpPluginsImageFilters::MultiScaleGaussianImageFilter::
+_GD0( _TImage* image )
+{
+  if( image != NULL )
+  {
+    auto choice = this->m_Parameters.GetSelectedChoice( "ScalarType" );
+    if( choice == "float" )
+      return( this->_GD1< _TImage, float >( image ) );
+    else if( choice == "double" )
+      return( this->_GD1< _TImage, double >( image ) );
+    else return( "MultiScaleGaussianImageFilter: no valid scalar type." );
+  }
+  else
+    return(
+      "MultiScaleGaussianImageFilter: No valid input image."
+      );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage, class _TScalar >
+std::string cpPluginsImageFilters::MultiScaleGaussianImageFilter::
+_GD1( _TImage* image )
+{
+  typedef itk::CovariantVector< _TScalar, _TImage::ImageDimension > _TVector;
+  typedef itk::Image< _TVector, _TImage::ImageDimension > _TGradient;
+  typedef
+    cpExtensions::Algorithms::MultiScaleGaussianImageFilter< _TImage, _TGradient >
+    _TFilter;
+
+  auto sigmas = this->m_Parameters.GetRealList( "Sigmas" );
+  if( sigmas.size( ) == 0 )
+    return(
+      "MultiScaleGaussianImageFilter: No given sigmas."
+      );
+
+  // Configure filter
+  _TFilter* filter = this->_CreateITK< _TFilter >( );
+  filter->SetInput( image );
+  for( auto sIt = sigmas.begin( ); sIt != sigmas.end( ); ++sIt )
+    filter->AddScale( *sIt );
+  filter->Update( );
+
+  // Connect output
+  this->GetOutputData( "Output" )->SetITK( filter->GetOutput( ) );
+  return( "" );
+}
+
+// eof - $RCSfile$
diff --git a/plugins/cpPluginsImageFilters/MultiScaleGaussianImageFilter.h b/plugins/cpPluginsImageFilters/MultiScaleGaussianImageFilter.h
new file mode 100644 (file)
index 0000000..252c701
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef __CPPLUGINSIMAGEFILTERS__MULTISCALEGAUSSIANIMAGEFILTER__H__
+#define __CPPLUGINSIMAGEFILTERS__MULTISCALEGAUSSIANIMAGEFILTER__H__
+
+#include <plugins/cpPluginsImageFilters/cpPluginsImageFilters_Export.h>
+#include <cpPlugins/ProcessObject.h>
+
+namespace cpPluginsImageFilters
+{
+  /**
+   */
+  class cpPluginsImageFilters_EXPORT MultiScaleGaussianImageFilter
+    : public cpPlugins::ProcessObject
+  {
+  public:
+    typedef MultiScaleGaussianImageFilter   Self;
+    typedef cpPlugins::ProcessObject        Superclass;
+    typedef itk::SmartPointer< Self >       Pointer;
+    typedef itk::SmartPointer< const Self > ConstPointer;
+
+  public:
+    itkNewMacro( Self );
+    itkTypeMacro( MultiScaleGaussianImageFilter, cpPlugins::ProcessObject );
+    cpPlugins_Id_Macro( MultiScaleGaussianImageFilter, ImageFilters );
+
+  protected:
+    MultiScaleGaussianImageFilter( );
+    virtual ~MultiScaleGaussianImageFilter( );
+
+    virtual std::string _GenerateData( );
+
+    template< class _TImage >
+      inline std::string _GD0( _TImage* image );
+
+    template< class _TImage, class _TScalar >
+      inline std::string _GD1( _TImage* image );
+
+  private:
+    // Purposely not implemented
+    MultiScaleGaussianImageFilter( const Self& );
+    Self& operator=( const Self& );
+  };
+
+} // ecapseman
+
+#endif // __CPPLUGINSIMAGEFILTERS__MULTISCALEGAUSSIANIMAGEFILTER__H__
+
+// eof - $RCSfile$
diff --git a/plugins/cpPluginsImageFilters/ResampleImageFilter.cxx b/plugins/cpPluginsImageFilters/ResampleImageFilter.cxx
new file mode 100644 (file)
index 0000000..8c23956
--- /dev/null
@@ -0,0 +1,87 @@
+#include <cpPluginsImageFilters/ResampleImageFilter.h>
+#include <cpPlugins/Image.h>
+#include <cpPlugins_ITKInstances/ImageFilters.h>
+
+#include <itkResampleImageFilter.h>
+#include <itkResampleImageFilter.hxx>
+#include <itkImageFunction.hxx>
+#include <itkLinearInterpolateImageFunction.hxx>
+#include <itkImageAlgorithm.hxx>
+
+// -------------------------------------------------------------------------
+cpPluginsImageFilters::ResampleImageFilter::
+ResampleImageFilter( )
+  : Superclass( )
+{
+  this->_AddInput( "Input" );
+  this->_AddOutput< cpPlugins::Image >( "Output" );
+  std::vector< std::string > choices;
+  choices.push_back( "float" );
+  choices.push_back( "double" );
+  this->m_Parameters.ConfigureAsChoices( "ScalarType", choices );
+  this->m_Parameters.SetSelectedChoice( "ScalarType", "float" );
+}
+
+// -------------------------------------------------------------------------
+cpPluginsImageFilters::ResampleImageFilter::
+~ResampleImageFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+std::string cpPluginsImageFilters::ResampleImageFilter::
+_GenerateData( )
+{
+  auto image = this->GetInputData( "Input" )->GetITK< itk::DataObject >( );
+  std::string   cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 1 );
+  if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 2 );
+  if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 3 );
+  if( r != "" ) cpPlugin_Image_Demangle_Pixel_AllScalars( r, _GD0, image, 4 );
+  return( r );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage >
+std::string cpPluginsImageFilters::ResampleImageFilter::
+_GD0( _TImage* image )
+{
+  if( image != NULL )
+  {
+    auto choice = this->m_Parameters.GetSelectedChoice( "OutputResolution" );
+    if( choice == "float" )
+      return( this->_GD1< _TImage, float >( image ) );
+    else if( choice == "double" )
+      return( this->_GD1< _TImage, double >( image ) );
+    else return( "ResampleImageFilter: no valid scalar type." );
+  }
+  else
+    return(
+      "ResampleImageFilter: No valid input image."
+      );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage, class _TScalar >
+std::string cpPluginsImageFilters::ResampleImageFilter::
+_GD1( _TImage* image )
+{
+  typedef
+    itk::ResampleImageFilter< _TImage, _TImage, _TScalar, _TScalar >
+    _TFilter;
+
+  if( image == NULL )
+    return(
+      "ImageFilters::ResampleImageFilter: No valid input image."
+      );
+
+
+  // Configure filter
+  _TFilter* filter = this->_CreateITK< _TFilter >( );
+  filter->SetInput( image );
+
+  // Connect output
+  this->GetOutputData( "Output" )->SetITK( filter->GetOutput( ) );
+  return( "" );
+}
+
+// eof - $RCSfile$
diff --git a/plugins/cpPluginsImageFilters/ResampleImageFilter.h b/plugins/cpPluginsImageFilters/ResampleImageFilter.h
new file mode 100644 (file)
index 0000000..0d22ee3
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef __CPPLUGINSIMAGEFILTERS__RESAMPLEIMAGEFILTER__H__
+#define __CPPLUGINSIMAGEFILTERS__RESAMPLEIMAGEFILTER__H__
+
+#include <plugins/cpPluginsImageFilters/cpPluginsImageFilters_Export.h>
+#include <cpPlugins/ProcessObject.h>
+
+namespace cpPluginsImageFilters
+{
+  /**
+   */
+  class cpPluginsImageFilters_EXPORT ResampleImageFilter
+    : public cpPlugins::ProcessObject
+  {
+  public:
+    typedef ResampleImageFilter             Self;
+    typedef cpPlugins::ProcessObject        Superclass;
+    typedef itk::SmartPointer< Self >       Pointer;
+    typedef itk::SmartPointer< const Self > ConstPointer;
+
+  public:
+    itkNewMacro( Self );
+    itkTypeMacro( ResampleImageFilter, cpPlugins::ProcessObject );
+    cpPlugins_Id_Macro( ResampleImageFilter, ImageFilters );
+
+  protected:
+    ResampleImageFilter( );
+    virtual ~ResampleImageFilter( );
+
+    virtual std::string _GenerateData( );
+
+    template< class _TImage >
+      inline std::string _GD0( _TImage* image );
+
+    template< class _TImage, class _TScalar >
+      inline std::string _GD1( _TImage* image );
+
+  private:
+    // Purposely not implemented
+    ResampleImageFilter( const Self& );
+    Self& operator=( const Self& );
+  };
+
+} // ecapseman
+
+#endif // __CPPLUGINSIMAGEFILTERS__RESAMPLEIMAGEFILTER__H__
+
+// eof - $RCSfile$
index bda2804f8c08369395f12a2efd15ed3b0092b811..4f3c562da8b46760cc186c2c074a1ff1a802f8a8 100644 (file)
@@ -58,7 +58,7 @@ GENERATE_EXPORT_HEADER(
   EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/plugins/${lib_DIR}/${lib_NAME}_Export.h
   STATIC_DEFINE ${lib_NAME}_BUILT_AS_STATIC
   )
-TARGET_LINK_LIBRARIES(${lib_NAME} ${target_LIBRARIES})
+TARGET_LINK_LIBRARIES(${lib_NAME} cpPipelineEditor ${target_LIBRARIES})
 
 ## ========================
 ## -- Installation rules --
index 25b63c64d156e220bd5e81e8c11f4741fb290903..f707ff998f1ab22c39b9ac285ac1b71ec8e07e55 100644 (file)
@@ -58,7 +58,7 @@ GENERATE_EXPORT_HEADER(
   EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/plugins/${lib_DIR}/${lib_NAME}_Export.h
   STATIC_DEFINE ${lib_NAME}_BUILT_AS_STATIC
   )
-TARGET_LINK_LIBRARIES(${lib_NAME} ${target_LIBRARIES})
+TARGET_LINK_LIBRARIES(${lib_NAME} cpPipelineEditor ${target_LIBRARIES})
 
 ## ========================
 ## -- Installation rules --
index 14ab44665c9f6acc68fb602cc30b4e0cadb39103..c74f31493d5c3232d2b20650238155f647456b89 100644 (file)
@@ -58,7 +58,7 @@ GENERATE_EXPORT_HEADER(
   EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/plugins/${lib_DIR}/${lib_NAME}_Export.h
   STATIC_DEFINE ${lib_NAME}_BUILT_AS_STATIC
   )
-TARGET_LINK_LIBRARIES(${lib_NAME} ${target_LIBRARIES})
+TARGET_LINK_LIBRARIES(${lib_NAME} cpPipelineEditor ${target_LIBRARIES})
 
 ## ========================
 ## -- Installation rules --
index a01eca9cf489a7409bcc5f8a8c9b0ee27b4c039f..a8fb9971633ffe4e3fadadf7fcfc3fbeeb1d835a 100644 (file)
@@ -58,7 +58,7 @@ GENERATE_EXPORT_HEADER(
   EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/plugins/${lib_DIR}/${lib_NAME}_Export.h
   STATIC_DEFINE ${lib_NAME}_BUILT_AS_STATIC
   )
-TARGET_LINK_LIBRARIES(${lib_NAME} ${target_LIBRARIES})
+TARGET_LINK_LIBRARIES(${lib_NAME} cpPipelineEditor ${target_LIBRARIES})
 
 ## ========================
 ## -- Installation rules --