]> Creatis software - cpPlugins.git/commitdiff
...
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Tue, 29 Sep 2015 23:02:30 +0000 (18:02 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Tue, 29 Sep 2015 23:02:30 +0000 (18:02 -0500)
38 files changed:
CMakeLists.txt
appli/CMakeLists.txt
appli/ImageMPR/ImageMPR.cxx
appli/ImageMPR/ImageMPR.h
appli/bash/CMakeLists.txt [new file with mode: 0644]
appli/bash/cpPlugins_createHost.cxx [new file with mode: 0644]
appli/examples/CMakeLists.txt
appli/examples/example_LoadPlugins.cxx
appli/examples/example_ReadWriteImage.cxx
lib/cpExtensions/Visualization/MPRObjects.cxx
lib/cpExtensions/Visualization/MPRObjects.h
lib/cpPlugins/Interface/CMakeLists.txt
lib/cpPlugins/Interface/Instances_itkImage.cxx
lib/cpPlugins/Interface/Instances_itkVectorImage.cxx [new file with mode: 0644]
lib/cpPlugins/Interface/Macros.h
lib/cpPlugins/Plugins/BasicFilters/BinaryThresholdImageFilter.cxx [moved from lib/cpPlugins/Plugins/BinaryThresholdImageFilter.cxx with 90% similarity]
lib/cpPlugins/Plugins/BasicFilters/BinaryThresholdImageFilter.h [moved from lib/cpPlugins/Plugins/BinaryThresholdImageFilter.h with 90% similarity]
lib/cpPlugins/Plugins/BasicFilters/CMakeLists.txt [new file with mode: 0644]
lib/cpPlugins/Plugins/BasicFilters/MarchingCubes.cxx [moved from lib/cpPlugins/Plugins/MarchingCubes.cxx with 90% similarity]
lib/cpPlugins/Plugins/BasicFilters/MarchingCubes.h [moved from lib/cpPlugins/Plugins/MarchingCubes.h with 89% similarity]
lib/cpPlugins/Plugins/BasicFilters/MedianImageFilter.cxx [moved from lib/cpPlugins/Plugins/MedianImageFilter.cxx with 87% similarity]
lib/cpPlugins/Plugins/BasicFilters/MedianImageFilter.h [moved from lib/cpPlugins/Plugins/MedianImageFilter.h with 90% similarity]
lib/cpPlugins/Plugins/BasicFilters/OtsuThresholdImageFilter.cxx [moved from lib/cpPlugins/Plugins/OtsuThresholdImageFilter.cxx with 88% similarity]
lib/cpPlugins/Plugins/BasicFilters/OtsuThresholdImageFilter.h [moved from lib/cpPlugins/Plugins/OtsuThresholdImageFilter.h with 90% similarity]
lib/cpPlugins/Plugins/BasicFilters/RGBImageToOtherChannelsFilter.cxx [moved from lib/cpPlugins/Plugins/RGBImageToOtherChannelsFilter.cxx with 91% similarity]
lib/cpPlugins/Plugins/BasicFilters/RGBImageToOtherChannelsFilter.h [moved from lib/cpPlugins/Plugins/RGBImageToOtherChannelsFilter.h with 90% similarity]
lib/cpPlugins/Plugins/CMakeLists.txt
lib/cpPlugins/Plugins/Host.cxx [deleted file]
lib/cpPlugins/Plugins/IO/CMakeLists.txt [new file with mode: 0644]
lib/cpPlugins/Plugins/IO/ImageReader.cxx [new file with mode: 0644]
lib/cpPlugins/Plugins/IO/ImageReader.h [moved from lib/cpPlugins/Plugins/ImageReader.h with 88% similarity]
lib/cpPlugins/Plugins/IO/ImageWriter.cxx [moved from lib/cpPlugins/Plugins/ImageWriter.cxx with 90% similarity]
lib/cpPlugins/Plugins/IO/ImageWriter.h [moved from lib/cpPlugins/Plugins/ImageWriter.h with 91% similarity]
lib/cpPlugins/Plugins/IO/MeshReader.cxx [moved from lib/cpPlugins/Plugins/MeshReader.cxx with 89% similarity]
lib/cpPlugins/Plugins/IO/MeshReader.h [moved from lib/cpPlugins/Plugins/MeshReader.h with 92% similarity]
lib/cpPlugins/Plugins/IO/MeshWriter.cxx [moved from lib/cpPlugins/Plugins/MeshWriter.cxx with 87% similarity]
lib/cpPlugins/Plugins/IO/MeshWriter.h [moved from lib/cpPlugins/Plugins/MeshWriter.h with 91% similarity]
lib/cpPlugins/Plugins/ImageReader.cxx [deleted file]

index 83c4b843c7568a621d7a3c7fb8228d59d2cd736c..d1ed48acf920919462f47ef3eb936f4dfab48f51 100644 (file)
@@ -50,6 +50,12 @@ ENDIF(BUILD_SHARED_LIBRARIES)
 # Prepare header to build shared libs (windows)
 INCLUDE(GenerateExportHeader)
 
+# Find boost
+FIND_PACKAGE(Boost 1.30 COMPONENTS filesystem system REQUIRED)
+IF(Boost_FOUND)
+  INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
+ENDIF(Boost_FOUND)
+
 # Find ITK and VTK
 FIND_PACKAGE(ITK REQUIRED)
 FIND_PACKAGE(VTK REQUIRED)
index 7ca64d43ccc1308a2fce1060d3c872859574e387..2568ba0471039e5e1a052802f4e5ac4bd8673d57 100644 (file)
@@ -1,3 +1,7 @@
+SUBDIRS(
+  bash
+  )
+
 IF(BUILD_EXAMPLES)
   SUBDIRS(
     examples
index f9a7934562c921846f4aea4cc7ba7a3010997c9b..f9613cb9819b87332bda13b5eff45f4fd9b63912 100644 (file)
@@ -1,8 +1,6 @@
 #include "ImageMPR.h"
 #include "ui_ImageMPR.h"
 
-#include <cpPlugins/Interface/ParametersQtDialog.h>
-
 #include <vtkProperty.h>
 #include <vtkRenderWindow.h>
 
@@ -59,7 +57,7 @@ ImageMPR::ImageMPR( QWidget* parent )
   // Start: load all disponible plugins
   this->_LoadPlugins(
     std::string( PLUGIN_PREFIX ) +
-    std::string( "cpPlugins." ) +
+    std::string( "cpPluginsIO." ) +
     std::string( PLUGIN_EXT )
     );
 }
@@ -86,17 +84,12 @@ _LoadPlugins( const std::string& filename )
   this->m_ImageWriterClass = "";
   this->m_MeshReaderClass = "";
   this->m_MeshWriterClass = "";
-  this->m_ImageToImageFilters.clear( );
-  this->m_ImageToMeshFilters.clear( );
+  this->m_UI->MenuImageToImage->clear( );
+  this->m_UI->MenuImageToMesh->clear( );
 
-  this->m_Plugins.UnloadAll( );
   if( !( this->m_Plugins.Load( filename ) ) )
-  {
-    this->m_Plugins.UnloadAll( );
     return( false );
 
-  } // fi
-
   typedef TPluginsInterface::TClasses _TClasses;
   _TClasses::const_iterator cIt = this->m_Plugins.GetClasses( ).begin( );
   for( ; cIt != this->m_Plugins.GetClasses( ).end( ); ++cIt )
@@ -115,7 +108,6 @@ _LoadPlugins( const std::string& filename )
       this->m_MeshWriterClass = name;
     else if( category == "ImageToImageFilter" )
     {
-      this->m_ImageToImageFilters.insert( name );
       QAction* action =
         this->m_UI->MenuImageToImage->addAction( QString( name.c_str( ) ) );
       QObject::connect(
@@ -125,7 +117,6 @@ _LoadPlugins( const std::string& filename )
     }
     else if( category == "ImageToMeshFilter" )
     {
-      this->m_ImageToMeshFilters.insert( name );
       QAction* action =
         this->m_UI->MenuImageToMesh->addAction( QString( name.c_str( ) ) );
       QObject::connect(
@@ -142,6 +133,50 @@ _LoadPlugins( const std::string& filename )
   return( true );
 }
 
+// -------------------------------------------------------------------------
+std::string ImageMPR::
+_LoadImage( TPluginImage::Pointer& image, const QStringList& names )
+{
+  // Block application
+  QApplication::setOverrideCursor( Qt::WaitCursor );
+  this->setEnabled( false );
+
+  std::string ret = "";
+  image = NULL;
+
+  // Get a reader from loaded plugins
+  TPluginFilter::Pointer reader =
+    this->m_Plugins.CreateProcessObject( this->m_ImageReaderClass );
+  if( reader.IsNotNull( ) )
+  {
+    // Configure reader
+    TParameters params = reader->GetDefaultParameters( );
+    QStringList::const_iterator qIt = names.begin( );
+    for( ; qIt != names.end( ); ++qIt )
+      params.AddValueToStringList( "FileNames", qIt->toStdString( ) );
+    params.SetValueAsBool( "VectorType", false );
+    reader->SetParameters( params );
+
+    // Execute and get error message, if any
+    ret = reader->Update( );
+
+    // Assign fresh image, if any
+    if( ret == "" )
+    {
+      image = reader->GetOutput< TPluginImage >( 0 );
+      reader->DisconnectOutputs( );
+
+    } // fi
+  }
+  else
+    ret = "No suitable reader object found in loaded plugins.";
+  
+  // Finish reading
+  QApplication::restoreOverrideCursor( );
+  this->setEnabled( true );
+  return( ret );
+}
+
 // -------------------------------------------------------------------------
 void ImageMPR::
 _triggered_actionOpenPlugins( )
@@ -179,50 +214,25 @@ _triggered_actionOpenInputImage( )
   if( !( dialog.exec( ) ) )
     return;
   
-  this->m_InputImage = NULL;
-
-  // Get a reader from plugins
-  TPluginFilter::Pointer reader =
-    this->m_Plugins.CreateProcessObject( this->m_ImageReaderClass );
-
-  // Configure reader
-  TParameters reader_params = reader->GetDefaultParameters( );
-  QStringList q_fnames = dialog.selectedFiles( );
-  QStringList::const_iterator qIt = q_fnames.begin( );
-  for( ; qIt != q_fnames.end( ); ++qIt )
-    reader_params.AddValueToStringList( "FileNames", qIt->toStdString( ) );
-  reader->SetParameters( reader_params );
-
-  // Execute and get error message, if any
-  QApplication::setOverrideCursor( Qt::WaitCursor );
-  this->setEnabled( false );
-  std::string err = reader->Update( );
-  QApplication::restoreOverrideCursor( );
-  this->setEnabled( true );
-
-  // Assign fresh image, if any
+  // Read image
+  std::string err =
+    this->_LoadImage( this->m_InputImage, dialog.selectedFiles( ) );
   if( err == "" )
   {
-    this->m_InputImage = reader->GetOutput< TPluginImage >( 0 );
-    reader->DisconnectOutputs( );
-    if( this->m_InputImage.IsNotNull( ) )
+    vtkImageData* vtk_id = this->m_InputImage->GetVTKImageData( );
+    if( vtk_id != NULL )
     {
-      vtkImageData* vtk_id = this->m_InputImage->GetVTKImageData( );
-      if( vtk_id != NULL )
-      {
-        this->m_MPRObjects->SetImage( vtk_id );
-        this->m_MPRObjects->ActivateInteractors( );
-        this->m_MPRObjects->ResetCameras( );
-        this->m_MPRObjects->RenderAll( );
-      }
-      else
-        QMessageBox::critical(
-          this,
-          tr( "Error message" ),
-          tr( "Read image does not have a valid VTK converter." )
-          );
-
-    } // fi
+      this->m_MPRObjects->SetImage( vtk_id );
+      this->m_MPRObjects->ActivateInteractors( );
+      this->m_MPRObjects->ResetCameras( );
+      this->m_MPRObjects->RenderAll( );
+    }
+    else
+      QMessageBox::critical(
+        this,
+        tr( "Error message" ),
+        tr( "Read image does not have a valid VTK converter." )
+        );
   }
   else
     QMessageBox::critical(
@@ -236,6 +246,17 @@ _triggered_actionOpenInputImage( )
 void ImageMPR::
 _triggered_actionOpenSegmentation( )
 {
+  if( this->m_InputImage.IsNull( ) )
+  {
+    QMessageBox::critical(
+      this,
+      tr( "Error message" ),
+      tr( "Before reading a segmentation, first load a raw image." )
+      );
+    return;
+
+  } // fi
+
   // Show dialog and check if it was accepted
   QFileDialog dialog( this );
   dialog.setFileMode( QFileDialog::ExistingFiles );
@@ -247,51 +268,23 @@ _triggered_actionOpenSegmentation( )
   if( !( dialog.exec( ) ) )
     return;
   
-  this->m_InputImage = NULL;
-
-  // Get a reader from plugins
-  TPluginFilter::Pointer reader =
-    this->m_Plugins.CreateProcessObject( this->m_ImageReaderClass );
-
-  // Configure reader
-  TParameters reader_params = reader->GetDefaultParameters( );
-  QStringList q_fnames = dialog.selectedFiles( );
-  QStringList::const_iterator qIt = q_fnames.begin( );
-  for( ; qIt != q_fnames.end( ); ++qIt )
-    reader_params.AddValueToStringList( "FileNames", qIt->toStdString( ) );
-  reader->SetParameters( reader_params );
-
-  // Execute and get error message, if any
-  QApplication::setOverrideCursor( Qt::WaitCursor );
-  this->setEnabled( false );
-  std::string err = reader->Update( );
-  QApplication::restoreOverrideCursor( );
-  this->setEnabled( true );
-
-  // Assign fresh image, if any
+  // Read image
+  std::string err =
+    this->_LoadImage( this->m_InputSegmentation, dialog.selectedFiles( ) );
   if( err == "" )
   {
-    this->m_InputSegmentation = reader->GetOutput< TPluginImage >( 0 );
-    reader->DisconnectOutputs( );
-    if( this->m_InputSegmentation.IsNotNull( ) )
+    vtkImageData* vtk_id = this->m_InputSegmentation->GetVTKImageData( );
+    if( vtk_id != NULL )
     {
-      vtkImageData* vtk_id = this->m_InputSegmentation->GetVTKImageData( );
-      if( vtk_id != NULL )
-      {
-        /*
-          this->m_MPRObjects->SetImage( vtk_id );
-          this->m_MPRObjects->ResetCameras( );
-          this->m_MPRObjects->RenderAll( );
-        */
-      }
-      else
-        QMessageBox::critical(
-          this,
-          tr( "Error message" ),
-          tr( "Read image does not have a valid VTK converter." )
-          );
-
-    } // fi
+      this->m_MPRObjects->AddAuxiliaryImage( vtk_id );
+      this->m_MPRObjects->RenderAll( );
+    }
+    else
+      QMessageBox::critical(
+        this,
+        tr( "Error message" ),
+        tr( "Read image does not have a valid VTK converter." )
+        );
   }
   else
     QMessageBox::critical(
@@ -305,6 +298,7 @@ _triggered_actionOpenSegmentation( )
 void ImageMPR::
 _triggered_actionOpenInputPolyData( )
 {
+  /*
   // Show dialog and check if it was accepted
   QFileDialog dialog( this );
   dialog.setFileMode( QFileDialog::ExistingFile );
@@ -366,12 +360,14 @@ _triggered_actionOpenInputPolyData( )
       tr( "Error reading mesh" ),
       tr( err.c_str( ) )
       );
+  */
 }
 
 // -------------------------------------------------------------------------
 void ImageMPR::
 _triggered_actionImageToImage( )
 {
+  /*
   if( this->m_InputImage.IsNull( ) )
     return;
 
@@ -411,12 +407,14 @@ _triggered_actionImageToImage( )
       tr( "Error executing filter" ),
       tr( err.c_str( ) )
       );
+  */
 }
 
 // -------------------------------------------------------------------------
 void ImageMPR::
 _triggered_actionImageToMesh( )
 {
+  /*
   if( this->m_InputImage.IsNull( ) )
     return;
 
@@ -458,6 +456,7 @@ _triggered_actionImageToMesh( )
       tr( "Error executing filter" ),
       tr( err.c_str( ) )
       );
+      */
 }
 
 // eof - $RCSfile$
index 1b568051e9f8f5b06f76fa5a8c5698a3b1ede21e..cf3e5c1b5f3695955396cb7ad45331a8f1fec5a6 100644 (file)
@@ -1,9 +1,7 @@
 #ifndef __IMAGEMPR__H__
 #define __IMAGEMPR__H__
 
-// Standard stuff
-#include <map>
-#include <set>
+#include <vector>
 
 // Qt stuff
 #include <QMainWindow>
@@ -42,7 +40,6 @@ public:
   typedef cpPlugins::Interface::ProcessObject TPluginFilter;
   typedef cpPlugins::Interface::Parameters    TParameters;
 
-  typedef std::set< std::string > TStringContainer;
   typedef cpExtensions::Visualization::MPRObjects TMPRObjects;
 
 public:
@@ -51,6 +48,9 @@ public:
 
 protected:
   bool _LoadPlugins( const std::string& filename );
+  std::string _LoadImage(
+    TPluginImage::Pointer& image, const QStringList& names
+    );
 
 private slots:
   void _triggered_actionOpenPlugins( );
@@ -71,8 +71,6 @@ private:
   std::string m_ImageWriterClass;
   std::string m_MeshReaderClass;
   std::string m_MeshWriterClass;
-  TStringContainer m_ImageToImageFilters;
-  TStringContainer m_ImageToMeshFilters;
 
   // Real data
   TPluginImage::Pointer m_InputImage;
diff --git a/appli/bash/CMakeLists.txt b/appli/bash/CMakeLists.txt
new file mode 100644 (file)
index 0000000..33785d1
--- /dev/null
@@ -0,0 +1,15 @@
+## =========================
+## = Command line programs =
+## =========================
+
+SET(
+  BASH_PROGRAMS
+  cpPlugins_createHost
+  )
+
+FOREACH(prog ${BASH_PROGRAMS}) 
+  ADD_EXECUTABLE(${prog} ${prog}.cxx)
+  TARGET_LINK_LIBRARIES(${prog} ${Boost_LIBRARIES})
+ENDFOREACH(prog)
+
+## eof - $RCSfile$
diff --git a/appli/bash/cpPlugins_createHost.cxx b/appli/bash/cpPlugins_createHost.cxx
new file mode 100644 (file)
index 0000000..0914cca
--- /dev/null
@@ -0,0 +1,59 @@
+#include <fstream>
+#include <iostream>
+#include <string>
+
+#include <boost/filesystem/path.hpp>
+
+int main( int argc, char* argv[] )
+{
+  // Open file
+  if( argc < 4 )
+  {
+    std::cerr
+      << "Usage: " << argv[ 0 ]
+      << " output_code namespace filter1 filter2 ..."
+      << std::endl;
+    return( 1 );
+
+  } // fi
+  std::ofstream output_code( argv[ 1 ] );
+  if( !output_code )
+  {
+    std::cerr
+      << "Could not open file \"" << argv[ 1 ] << "\" for writing"
+      << std::endl;
+    return( 1 );
+
+  } // fi
+
+  output_code << "#include <Pluma/Connector.hpp>" << std::endl;
+  for( int i = 3; i < argc; ++i )
+    output_code << "#include \"" << argv[ i ] << "\"" << std::endl;
+  output_code
+    << std::endl
+    << "PLUMA_CONNECTOR" << std::endl
+    << "bool connect( pluma::Host& host )" << std::endl
+    << "{" << std::endl
+    << "  using namespace " << argv[ 2 ] << ";" << std::endl;
+
+  for( int i = 3; i < argc; ++i )
+  {
+    boost::filesystem::path p( argv[ i ] );
+    output_code
+      << "  host.add( new "
+      << p.stem( ).generic_string( )
+      << "Provider( ) );"
+      << std::endl;
+
+  } // rof
+
+  output_code
+    << "  return( true );" << std::endl
+    << "}" << std::endl;
+
+  // Finish
+  output_code.close( );
+  return( 0 );
+}
+
+// eof - $RCSfile$
index a4fb5d7995ea8a760cdb9c184002cbb17627edfe..59af9a6d6fb5567339d54851aac330089b743822 100644 (file)
@@ -8,14 +8,14 @@ SET(
   example_TestParameters
   example_LoadPlugins
   example_ReadWriteImage
-  example_MarchingCubes
-  example_OtsuFilter
-  example_RGBImageToHSVChannels
-  example_RGBImageToYPbPrChannels
+  ##example_MarchingCubes
+  ##example_OtsuFilter
+  ##example_RGBImageToHSVChannels
+  ##example_RGBImageToYPbPrChannels
   ## example_ReadImageSeriesWriteImage
   ## example_ReadQuadEdgeMesh
   ## example_RenderQuadEdgeMesh
-  example_MPR
+  ##example_MPR
   )
 
 
index e46a5db137487004897407233402a412596aa6b4..d090d38318e718f877c5726f5f28ff3affa85d46 100644 (file)
@@ -7,30 +7,30 @@ int main( int argc, char* argv[] )
 {
   if( argc < 2 )
   {
-    std::cerr << "Usage: " << argv[ 0 ] << " plugins_file" << std::endl;
+    std::cerr << "Usage: " << argv[ 0 ] << " plugins_file(s)" << std::endl;
     return( 1 );
 
   } // fi
-  std::string plugins_file = argv[ 1 ];
 
   // Create interface
   typedef cpPlugins::Interface::Interface TInterface;
   typedef TInterface::TClasses            TClasses;
 
   TInterface plugins;
-  if( !plugins.Load( plugins_file ) )
-  {
-    std::cerr << "Error loading plugins file." << std::endl;
-    return( 1 );
+  for( int i = 1; i < argc; ++i )
+    if( !plugins.Load( argv[ i ] ) )
+      std::cerr
+        << "Error loading plugins file \""
+        << argv[ i ] << "\""
+        << std::endl;
 
-  } // fi
-  
   std::cout << "---------------------------------------------" << std::endl;
   std::cout << "Loaded classes:" << std::endl;
   TClasses::const_iterator cIt = plugins.GetClasses( ).begin( );
   for( ; cIt != plugins.GetClasses( ).end( ); ++cIt )
     std::cout << "  := " << cIt->first << std::endl;
   std::cout << "---------------------------------------------" << std::endl;
+
   return( 0 );
 }
 
index 5f01b44bc569247dfaaa3f222fdc354bb55a9b7e..b051277e30cad06e532e62495f19a39c56153899 100644 (file)
@@ -4,9 +4,16 @@
 
 #include <cpPlugins/Interface/Interface.h>
 #include <cpPlugins/Interface/ProcessObject.h>
-
 #include <cpPlugins/Interface/Image.h>
 
+// -------------------------------------------------------------------------
+typedef cpPlugins::Interface::Interface     TInterface;
+typedef cpPlugins::Interface::ProcessObject TProcessObject;
+typedef cpPlugins::Interface::DataObject    TDataObject;
+typedef cpPlugins::Interface::Parameters    TParameters;
+typedef TInterface::TClasses                TClasses;
+
+// -------------------------------------------------------------------------
 int main( int argc, char* argv[] )
 {
   if( argc < 4 )
@@ -20,8 +27,6 @@ int main( int argc, char* argv[] )
   } // fi
 
   // Create interface
-  typedef cpPlugins::Interface::Interface TInterface;
-  typedef TInterface::TClasses            TClasses;
   TInterface plugins;
   if( !plugins.Load( argv[ 1 ] ) )
   {
@@ -31,21 +36,16 @@ int main( int argc, char* argv[] )
   } // fi
 
   // Create objects
-  typedef cpPlugins::Interface::ProcessObject TProcessObject;
-  typedef cpPlugins::Interface::DataObject    TDataObject;
-  typedef cpPlugins::Interface::Parameters    TParameters;
-  cpPlugins::Interface::ProcessObject::Pointer reader, writer;
-  reader = plugins.CreateProcessObject( "cpPlugins::ImageReader" );
-  if( reader.IsNull( ) )
+  TProcessObject::Pointer reader, writer;
+  reader = plugins.CreateProcessObject( "cpPlugins::IO::ImageReader" );
+  writer = plugins.CreateProcessObject( "cpPlugins::IO::ImageWriter" );
+  if( reader.IsNull( ) || writer.IsNull( ) )
   {
-    std::cerr << "No suitable reader found in plugins." << std::endl;
-    return( 1 );
-
-  } // fi
-  writer = plugins.CreateProcessObject( "cpPlugins::ImageWriter" );
-  if( writer.IsNull( ) )
-  {
-    std::cerr << "No suitable writer found in plugins." << std::endl;
+    std::cerr
+      << "No suitable reader found in plugins." << std::endl
+      << "Reader: " << reader.GetPointer( ) << std::endl
+      << "Writer: " << writer.GetPointer( ) << std::endl
+      << std::endl;
     return( 1 );
 
   } // fi
index aaadf31b1b61ede9daff48099bb27613b232f87f..ddc1747f9faed73e0b3b2b7d22af9f89c6e8064e 100644 (file)
@@ -68,6 +68,25 @@ SetImage( vtkImageData* image )
   this->RenderAll( );
 }
 
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+AddAuxiliaryImage( vtkImageData* image )
+{
+  this->m_MPRActors->AddInputData( image );
+
+#error Definir LUT de la nueva imagen
+
+  this->m_MPRActors->PushDataInto(
+    this->m_Renderers[ 0 ],
+    this->m_Renderers[ 1 ],
+    this->m_Renderers[ 2 ],
+    this->m_Renderers[ 3 ]
+    );
+
+  // Rendering
+  this->RenderAll( );
+}
+
 // -------------------------------------------------------------------------
 void cpExtensions::Visualization::MPRObjects::
 ActivateInteractors( )
index a348e91513d15c4379091677f4621ee48f3041f1..1a8135012044c928cd02d9af8171e60a879597b1 100644 (file)
@@ -35,6 +35,7 @@ namespace cpExtensions
         vtkRenderWindow* wz, vtkRenderWindow* w3D
         );
       void SetImage( vtkImageData* image );
+      void AddAuxiliaryImage( vtkImageData* image );
       void ActivateInteractors( );
 
       void ResetCamera( const int& id );
index 6d73928e24f27ea70b172cc1029df327c70674f9..a3990cc02c4b674d6d93e77bb94a7a4ef6f7ec27 100644 (file)
@@ -44,11 +44,12 @@ SET(
 
 SET(
   LIB_SOURCES_CXX
+  Instances_itkImage.cxx
+  Instances_itkVectorImage.cxx
+  Instances_itkMesh.cxx
   BaseProcessObjects.cxx
   DataObject.cxx
   Image.cxx
-  Instances_itkImage.cxx
-  Instances_itkMesh.cxx
   Interface.cxx
   Mesh.cxx
   Object.cxx
index 8fadae00bd0e3ff5c5d78e618ff933da14e09430..b9229dd4849ea8f9b05c99b27755e301cfe40945 100644 (file)
 #include <itkVector.h>
 
 // -------------------------------------------------------------------------
-#define cpPlugins_Image_Export( T, D )                                  \
-  cpPlugins_TEMPLATE_EXPORT(                                            \
-    2(class cpPlugins_Interface_EXPORT itk::Image< T, D >)              \
+#define cpPlugins_ITKImage_Export( T, D )                       \
+  cpPlugins_TEMPLATE_EXPORT(                                    \
+    2(class cpPlugins_Interface_EXPORT itk::Image< T, D >)      \
     )
 
 // -------------------------------------------------------------------------
-#define cpPlugins_VTKImage_Export( T, D )                               \
+#define cpPlugins_ITKArrayImage_Export( A, T, DA, DI )                  \
   cpPlugins_TEMPLATE_EXPORT(                                            \
-    2(                                                                  \
-      class cpPlugins_Interface_EXPORT                                  \
-      itk::ImageToVTKImageFilter< itk::Image< T, D > >                  \
-      )                                                                 \
+    3(class cpPlugins_Interface_EXPORT itk::Image< A< T, DA >, DI >)    \
     )
 
 // -------------------------------------------------------------------------
-#define cpPlugins_ImageArray_Export( A, T, DA, DI )                     \
-  cpPlugins_TEMPLATE_EXPORT(                                            \
-    3(                                                                  \
-      class cpPlugins_Interface_EXPORT                                  \
-      itk::Image< itk::A< T, DA >, DI >                                 \
-      )                                                                 \
-    )
+#define cpPlugins_ITKImage_AllDims_Export( T )  \
+  cpPlugins_ITKImage_Export( T, 2 );            \
+  cpPlugins_ITKImage_Export( T, 3 );            \
+  cpPlugins_ITKImage_Export( T, 4 )
 
 // -------------------------------------------------------------------------
-#define cpPlugins_VTKImageArray_Export( A, T, DA, DI )                  \
-  cpPlugins_TEMPLATE_EXPORT(                                            \
-    3(                                                                  \
-      class cpPlugins_Interface_EXPORT                                  \
-      itk::ImageToVTKImageFilter< itk::Image< itk::A< T, DA >, DI > >   \
-      )                                                                 \
+#define cpPlugins_ITKArrayImage_AllDims_Export( A, T )  \
+  cpPlugins_ITKArrayImage_Export( A, T, 2, 2 );         \
+  cpPlugins_ITKArrayImage_Export( A, T, 3, 3 );         \
+  cpPlugins_ITKArrayImage_Export( A, T, 4, 4 )
+
+// -------------------------------------------------------------------------
+#define cpPlugins_VTKImage_Export( T, D )               \
+  cpPlugins_TEMPLATE_EXPORT(                            \
+    2(                                                  \
+      class cpPlugins_Interface_EXPORT                  \
+      itk::ImageToVTKImageFilter< itk::Image< T, D > >  \
+      )                                                 \
     )
 
 // -------------------------------------------------------------------------
-#define cpPlugins_Image_Export_AllDimensions( T )       \
-  cpPlugins_Image_Export( T, 2 );                       \
-  cpPlugins_Image_Export( T, 3 );                       \
-  cpPlugins_Image_Export( T, 4 )
+#define cpPlugins_VTKArrayImage_Export( A, T, DA, DI )                  \
+  cpPlugins_TEMPLATE_EXPORT(                                            \
+    3(class                                                             \
+      cpPlugins_Interface_EXPORT                                        \
+      itk::ImageToVTKImageFilter< itk::Image< A< T, DA >, DI > >)       \
+    )
 
 // -------------------------------------------------------------------------
-#define cpPlugins_VTKImage_Export_AllDimensions( T )       \
-  cpPlugins_VTKImage_Export( T, 2 );                       \
+#define cpPlugins_VTKImage_AllDims_Export( T )  \
+  cpPlugins_VTKImage_Export( T, 2 );            \
   cpPlugins_VTKImage_Export( T, 3 )
 
 // -------------------------------------------------------------------------
-#define cpPlugins_ImageArray_Export_AllDimensions( A, T )             \
-  cpPlugins_ImageArray_Export( A, T, 2, 2 );                          \
-  cpPlugins_ImageArray_Export( A, T, 3, 3 );                          \
-  cpPlugins_ImageArray_Export( A, T, 4, 4 )
+#define cpPlugins_VTKArrayImage_AllDims_Export( A, T )  \
+  cpPlugins_VTKArrayImage_Export( A, T, 2, 2 );         \
+  cpPlugins_VTKArrayImage_Export( A, T, 3, 3 )
 
 // -------------------------------------------------------------------------
-#define cpPlugins_VTKImageArray_Export_AllDimensions( A, T )            \
-  cpPlugins_VTKImageArray_Export( A, T, 2, 2 );                         \
-  cpPlugins_VTKImageArray_Export( A, T, 3, 3 )
-
+#define cpPlugins_Image_Export( T, D )          \
+  cpPlugins_ITKImage_Export( T, D );            \
+  cpPlugins_VTKImage_Export( T, D )             \
+  
+// -------------------------------------------------------------------------
+#define cpPlugins_Image_AllDims_Export( T )     \
+  cpPlugins_ITKImage_AllDims_Export( T );       \
+  cpPlugins_VTKImage_AllDims_Export( T )        \
+  
+// -------------------------------------------------------------------------
+#define cpPlugins_ArrayImage_AllDims_Export( A, T )     \
+  cpPlugins_ITKArrayImage_AllDims_Export( A, T );       \
+  cpPlugins_VTKArrayImage_AllDims_Export( A, T )        \
+  
+// -------------------------------------------------------------------------
+// ITK-VTK base clases
 // -------------------------------------------------------------------------
-// ITK base clases
-cpPlugins_Image_Export_AllDimensions( char );
-cpPlugins_Image_Export_AllDimensions( short );
-cpPlugins_Image_Export_AllDimensions( int );
-cpPlugins_Image_Export_AllDimensions( long );
-cpPlugins_Image_Export_AllDimensions( unsigned char );
-cpPlugins_Image_Export_AllDimensions( unsigned short );
-cpPlugins_Image_Export_AllDimensions( unsigned int );
-cpPlugins_Image_Export_AllDimensions( unsigned long );
-cpPlugins_Image_Export_AllDimensions( float );
-cpPlugins_Image_Export_AllDimensions( double );
-
-cpPlugins_Image_Export_AllDimensions( std::complex< float > );
-cpPlugins_Image_Export_AllDimensions( std::complex< double > );
-
-cpPlugins_Image_Export_AllDimensions( itk::RGBPixel< char > );
-cpPlugins_Image_Export_AllDimensions( itk::RGBPixel< short > );
-cpPlugins_Image_Export_AllDimensions( itk::RGBPixel< int > );
-cpPlugins_Image_Export_AllDimensions( itk::RGBPixel< long > );
-cpPlugins_Image_Export_AllDimensions( itk::RGBPixel< unsigned char > );
-cpPlugins_Image_Export_AllDimensions( itk::RGBPixel< unsigned short > );
-cpPlugins_Image_Export_AllDimensions( itk::RGBPixel< unsigned int > );
-cpPlugins_Image_Export_AllDimensions( itk::RGBPixel< unsigned long > );
-cpPlugins_Image_Export_AllDimensions( itk::RGBPixel< float > );
-cpPlugins_Image_Export_AllDimensions( itk::RGBPixel< double > );
-
-cpPlugins_Image_Export_AllDimensions( itk::RGBAPixel< char > );
-cpPlugins_Image_Export_AllDimensions( itk::RGBAPixel< short > );
-cpPlugins_Image_Export_AllDimensions( itk::RGBAPixel< int > );
-cpPlugins_Image_Export_AllDimensions( itk::RGBAPixel< long > );
-cpPlugins_Image_Export_AllDimensions( itk::RGBAPixel< unsigned char > );
-cpPlugins_Image_Export_AllDimensions( itk::RGBAPixel< unsigned short > );
-cpPlugins_Image_Export_AllDimensions( itk::RGBAPixel< unsigned int > );
-cpPlugins_Image_Export_AllDimensions( itk::RGBAPixel< unsigned long > );
-cpPlugins_Image_Export_AllDimensions( itk::RGBAPixel< float > );
-cpPlugins_Image_Export_AllDimensions( itk::RGBAPixel< double > );
-
-cpPlugins_ImageArray_Export_AllDimensions( Vector, float );
-cpPlugins_ImageArray_Export_AllDimensions( Vector, double );
-
-cpPlugins_ImageArray_Export_AllDimensions( CovariantVector, float );
-cpPlugins_ImageArray_Export_AllDimensions( CovariantVector, double );
-
-cpPlugins_ImageArray_Export_AllDimensions( Point, float );
-cpPlugins_ImageArray_Export_AllDimensions( Point, double );
-
-cpPlugins_ImageArray_Export_AllDimensions(
-  SymmetricSecondRankTensor, float
-  );
-cpPlugins_ImageArray_Export_AllDimensions(
-  SymmetricSecondRankTensor, double
-  );
-
-cpPlugins_Image_Export( itk::DiffusionTensor3D< float >, 3 );
-cpPlugins_Image_Export( itk::DiffusionTensor3D< double >, 3 );
-cpPlugins_Image_Export( itk::DiffusionTensor3D< float >, 4 );
-cpPlugins_Image_Export( itk::DiffusionTensor3D< double >, 4 );
-cpPlugins_Image_Export( itk::Offset< 2 >, 2 );
-cpPlugins_Image_Export( itk::Offset< 3 >, 3 );
-cpPlugins_Image_Export( itk::Offset< 4 >, 4 );
 
+cpPlugins_Image_AllDims_Export( char );
+cpPlugins_Image_AllDims_Export( short );
+cpPlugins_Image_AllDims_Export( int );
+cpPlugins_Image_AllDims_Export( long );
+cpPlugins_Image_AllDims_Export( unsigned char );
+cpPlugins_Image_AllDims_Export( unsigned short );
+cpPlugins_Image_AllDims_Export( unsigned int );
+cpPlugins_Image_AllDims_Export( unsigned long );
+cpPlugins_Image_AllDims_Export( float );
+cpPlugins_Image_AllDims_Export( double );
+
+cpPlugins_Image_AllDims_Export( itk::RGBPixel< char > );
+cpPlugins_Image_AllDims_Export( itk::RGBPixel< short > );
+cpPlugins_Image_AllDims_Export( itk::RGBPixel< int > );
+cpPlugins_Image_AllDims_Export( itk::RGBPixel< long > );
+cpPlugins_Image_AllDims_Export( itk::RGBPixel< unsigned char > );
+cpPlugins_Image_AllDims_Export( itk::RGBPixel< unsigned short > );
+cpPlugins_Image_AllDims_Export( itk::RGBPixel< unsigned int > );
+cpPlugins_Image_AllDims_Export( itk::RGBPixel< unsigned long > );
+cpPlugins_Image_AllDims_Export( itk::RGBPixel< float > );
+cpPlugins_Image_AllDims_Export( itk::RGBPixel< double > );
+
+cpPlugins_Image_AllDims_Export( itk::RGBAPixel< char > );
+cpPlugins_Image_AllDims_Export( itk::RGBAPixel< short > );
+cpPlugins_Image_AllDims_Export( itk::RGBAPixel< int > );
+cpPlugins_Image_AllDims_Export( itk::RGBAPixel< long > );
+cpPlugins_Image_AllDims_Export( itk::RGBAPixel< unsigned char > );
+cpPlugins_Image_AllDims_Export( itk::RGBAPixel< unsigned short > );
+cpPlugins_Image_AllDims_Export( itk::RGBAPixel< unsigned int > );
+cpPlugins_Image_AllDims_Export( itk::RGBAPixel< unsigned long > );
+cpPlugins_Image_AllDims_Export( itk::RGBAPixel< float > );
+cpPlugins_Image_AllDims_Export( itk::RGBAPixel< double > );
+
+cpPlugins_Image_AllDims_Export( itk::DiffusionTensor3D< float > );
+cpPlugins_Image_AllDims_Export( itk::DiffusionTensor3D< double > );
+
+cpPlugins_ArrayImage_AllDims_Export( itk::Vector, float );
+cpPlugins_ArrayImage_AllDims_Export( itk::Vector, double );
+
+cpPlugins_ArrayImage_AllDims_Export( itk::CovariantVector, float );
+cpPlugins_ArrayImage_AllDims_Export( itk::CovariantVector, double );
+
+cpPlugins_ArrayImage_AllDims_Export( itk::Point, float );
+cpPlugins_ArrayImage_AllDims_Export( itk::Point, double );
+
+cpPlugins_ArrayImage_AllDims_Export( itk::SymmetricSecondRankTensor, float );
+cpPlugins_ArrayImage_AllDims_Export( itk::SymmetricSecondRankTensor, double );
+
+// -------------------------------------------------------------------------
+// ITK-only base clases
 // -------------------------------------------------------------------------
-// ITK<->VTK base clases
-cpPlugins_VTKImage_Export_AllDimensions( char );
-cpPlugins_VTKImage_Export_AllDimensions( short );
-cpPlugins_VTKImage_Export_AllDimensions( int );
-cpPlugins_VTKImage_Export_AllDimensions( long );
-cpPlugins_VTKImage_Export_AllDimensions( unsigned char );
-cpPlugins_VTKImage_Export_AllDimensions( unsigned short );
-cpPlugins_VTKImage_Export_AllDimensions( unsigned int );
-cpPlugins_VTKImage_Export_AllDimensions( unsigned long );
-cpPlugins_VTKImage_Export_AllDimensions( float );
-cpPlugins_VTKImage_Export_AllDimensions( double );
-
-cpPlugins_VTKImage_Export_AllDimensions( itk::RGBPixel< char > );
-cpPlugins_VTKImage_Export_AllDimensions( itk::RGBPixel< short > );
-cpPlugins_VTKImage_Export_AllDimensions( itk::RGBPixel< int > );
-cpPlugins_VTKImage_Export_AllDimensions( itk::RGBPixel< long > );
-cpPlugins_VTKImage_Export_AllDimensions( itk::RGBPixel< unsigned char > );
-cpPlugins_VTKImage_Export_AllDimensions( itk::RGBPixel< unsigned short > );
-cpPlugins_VTKImage_Export_AllDimensions( itk::RGBPixel< unsigned int > );
-cpPlugins_VTKImage_Export_AllDimensions( itk::RGBPixel< unsigned long > );
-
-cpPlugins_VTKImage_Export_AllDimensions( itk::RGBAPixel< char > );
-cpPlugins_VTKImage_Export_AllDimensions( itk::RGBAPixel< short > );
-cpPlugins_VTKImage_Export_AllDimensions( itk::RGBAPixel< int > );
-cpPlugins_VTKImage_Export_AllDimensions( itk::RGBAPixel< long > );
-cpPlugins_VTKImage_Export_AllDimensions( itk::RGBAPixel< unsigned char > );
-cpPlugins_VTKImage_Export_AllDimensions( itk::RGBAPixel< unsigned short > );
-cpPlugins_VTKImage_Export_AllDimensions( itk::RGBAPixel< unsigned int > );
-cpPlugins_VTKImage_Export_AllDimensions( itk::RGBAPixel< unsigned long > );
-
-cpPlugins_VTKImageArray_Export_AllDimensions( Vector, float );
-cpPlugins_VTKImageArray_Export_AllDimensions( Vector, double );
-
-cpPlugins_VTKImageArray_Export_AllDimensions( CovariantVector, float );
-cpPlugins_VTKImageArray_Export_AllDimensions( CovariantVector, double );
-
-cpPlugins_VTKImageArray_Export_AllDimensions( Point, float );
-cpPlugins_VTKImageArray_Export_AllDimensions( Point, double );
-
-cpPlugins_VTKImageArray_Export_AllDimensions(
-  SymmetricSecondRankTensor, float
-  );
-cpPlugins_VTKImageArray_Export_AllDimensions(
-  SymmetricSecondRankTensor, double
-  );
-
-cpPlugins_VTKImage_Export( itk::DiffusionTensor3D< float >, 3 );
-cpPlugins_VTKImage_Export( itk::DiffusionTensor3D< double >, 3 );
+
+cpPlugins_ITKImage_AllDims_Export( std::complex< float > );
+cpPlugins_ITKImage_AllDims_Export( std::complex< double > );
+
+cpPlugins_ITKImage_Export( itk::Offset< 2 >, 2 );
+cpPlugins_ITKImage_Export( itk::Offset< 3 >, 3 );
+cpPlugins_ITKImage_Export( itk::Offset< 4 >, 4 );
 
 // eof - $RCSfile$
diff --git a/lib/cpPlugins/Interface/Instances_itkVectorImage.cxx b/lib/cpPlugins/Interface/Instances_itkVectorImage.cxx
new file mode 100644 (file)
index 0000000..3db15c6
--- /dev/null
@@ -0,0 +1,100 @@
+#include <cpPlugins/Interface/Macros.h>
+
+#include <complex>
+
+#include <itkVectorImage.h>
+
+#include <itkCovariantVector.h>
+#include <itkDiffusionTensor3D.h>
+#include <itkPoint.h>
+#include <itkRGBPixel.h>
+#include <itkRGBAPixel.h>
+#include <itkSymmetricSecondRankTensor.h>
+#include <itkVector.h>
+
+// -------------------------------------------------------------------------
+#define cpPlugins_Image_Export( T, D )                                  \
+  cpPlugins_TEMPLATE_EXPORT(                                            \
+    2(class cpPlugins_Interface_EXPORT itk::VectorImage< T, D >)        \
+    )
+
+// -------------------------------------------------------------------------
+#define cpPlugins_ArrayImage_Export( A, T, DA, DI )                     \
+  cpPlugins_TEMPLATE_EXPORT(                                            \
+    3(class                                                             \
+      cpPlugins_Interface_EXPORT                                        \
+      itk::VectorImage< A< T, DA >, DI >)                               \
+    )
+
+// -------------------------------------------------------------------------
+#define cpPlugins_Image_AllDims_Export( T )  \
+  cpPlugins_Image_Export( T, 2 );            \
+  cpPlugins_Image_Export( T, 3 );            \
+  cpPlugins_Image_Export( T, 4 )
+
+// -------------------------------------------------------------------------
+#define cpPlugins_ArrayImage_AllDims_Export( A, T )     \
+  cpPlugins_ArrayImage_Export( A, T, 2, 2 );            \
+  cpPlugins_ArrayImage_Export( A, T, 3, 3 );            \
+  cpPlugins_ArrayImage_Export( A, T, 4, 4 )
+
+// -------------------------------------------------------------------------
+// ITK-VTK base clases
+// -------------------------------------------------------------------------
+
+cpPlugins_Image_AllDims_Export( char );
+cpPlugins_Image_AllDims_Export( short );
+cpPlugins_Image_AllDims_Export( int );
+cpPlugins_Image_AllDims_Export( long );
+cpPlugins_Image_AllDims_Export( unsigned char );
+cpPlugins_Image_AllDims_Export( unsigned short );
+cpPlugins_Image_AllDims_Export( unsigned int );
+cpPlugins_Image_AllDims_Export( unsigned long );
+cpPlugins_Image_AllDims_Export( float );
+cpPlugins_Image_AllDims_Export( double );
+
+cpPlugins_Image_AllDims_Export( std::complex< float > );
+cpPlugins_Image_AllDims_Export( std::complex< double > );
+
+cpPlugins_Image_Export( itk::Offset< 2 >, 2 );
+cpPlugins_Image_Export( itk::Offset< 3 >, 3 );
+cpPlugins_Image_Export( itk::Offset< 4 >, 4 );
+
+cpPlugins_Image_AllDims_Export( itk::RGBPixel< char > );
+cpPlugins_Image_AllDims_Export( itk::RGBPixel< short > );
+cpPlugins_Image_AllDims_Export( itk::RGBPixel< int > );
+cpPlugins_Image_AllDims_Export( itk::RGBPixel< long > );
+cpPlugins_Image_AllDims_Export( itk::RGBPixel< unsigned char > );
+cpPlugins_Image_AllDims_Export( itk::RGBPixel< unsigned short > );
+cpPlugins_Image_AllDims_Export( itk::RGBPixel< unsigned int > );
+cpPlugins_Image_AllDims_Export( itk::RGBPixel< unsigned long > );
+cpPlugins_Image_AllDims_Export( itk::RGBPixel< float > );
+cpPlugins_Image_AllDims_Export( itk::RGBPixel< double > );
+
+cpPlugins_Image_AllDims_Export( itk::RGBAPixel< char > );
+cpPlugins_Image_AllDims_Export( itk::RGBAPixel< short > );
+cpPlugins_Image_AllDims_Export( itk::RGBAPixel< int > );
+cpPlugins_Image_AllDims_Export( itk::RGBAPixel< long > );
+cpPlugins_Image_AllDims_Export( itk::RGBAPixel< unsigned char > );
+cpPlugins_Image_AllDims_Export( itk::RGBAPixel< unsigned short > );
+cpPlugins_Image_AllDims_Export( itk::RGBAPixel< unsigned int > );
+cpPlugins_Image_AllDims_Export( itk::RGBAPixel< unsigned long > );
+cpPlugins_Image_AllDims_Export( itk::RGBAPixel< float > );
+cpPlugins_Image_AllDims_Export( itk::RGBAPixel< double > );
+
+cpPlugins_Image_AllDims_Export( itk::DiffusionTensor3D< float > );
+cpPlugins_Image_AllDims_Export( itk::DiffusionTensor3D< double > );
+
+cpPlugins_ArrayImage_AllDims_Export( itk::Vector, float );
+cpPlugins_ArrayImage_AllDims_Export( itk::Vector, double );
+
+cpPlugins_ArrayImage_AllDims_Export( itk::CovariantVector, float );
+cpPlugins_ArrayImage_AllDims_Export( itk::CovariantVector, double );
+
+cpPlugins_ArrayImage_AllDims_Export( itk::Point, float );
+cpPlugins_ArrayImage_AllDims_Export( itk::Point, double );
+
+cpPlugins_ArrayImage_AllDims_Export( itk::SymmetricSecondRankTensor, float );
+cpPlugins_ArrayImage_AllDims_Export( itk::SymmetricSecondRankTensor, double );
+
+// eof - $RCSfile$
index 0a6bd60553ee5381f475f4de4d8f2a3dca8e4046..c85cd0c160f3efec4ed0ed482fccdf8fcc3da3dc 100644 (file)
 #define cpPlugins_TEMPLATE_IMPORT( X )          \
   extern template cpPlugins_TEMPLATE_##X;
 
-/* TODO
-   #define cpPlugins_EXPORT_TEMPLATE( E, c, T )                 \
-   cpPlugins_TEMPLATE_##c( cpPlugins_TEMPLATE_EXPORT, E, T )
-   #define cpPlugins_IMPORT_TEMPLATE( E, c, T )                 \
-   cpPlugins_TEMPLATE_##c( cpPlugins_TEMPLATE_IMPORT, E, T )
-*/
-
 #endif // __CPPLUGINS__INTERFACE__MACROS__H__
 
 // eof - $RCSfile$
similarity index 90%
rename from lib/cpPlugins/Plugins/BinaryThresholdImageFilter.cxx
rename to lib/cpPlugins/Plugins/BasicFilters/BinaryThresholdImageFilter.cxx
index 65195e200d0372c84fcee34c3e3b807dbcefe71d..d3d541e8527652d7bafebc8623b9c42ea650e246 100644 (file)
@@ -1,14 +1,14 @@
-#include <cpPlugins/Plugins/BinaryThresholdImageFilter.h>
+#include "BinaryThresholdImageFilter.h"
 #include <cpPlugins/Interface/Image.h>
 
 #include <itkBinaryThresholdImageFilter.h>
 
 // -------------------------------------------------------------------------
-cpPlugins::Plugins::BinaryThresholdImageFilter::
+cpPlugins::BasicFilters::BinaryThresholdImageFilter::
 BinaryThresholdImageFilter( )
   : Superclass( )
 {
-  this->m_ClassName = "cpPlugins::BinaryThresholdImageFilter";
+  this->m_ClassName = "cpPlugins::BasicFilters::BinaryThresholdImageFilter";
   this->m_ClassCategory = "ImageToImageFilter";
   this->SetNumberOfInputs( 1 );
   this->SetNumberOfOutputs( 1 );
@@ -38,13 +38,13 @@ BinaryThresholdImageFilter( )
 }
 
 // -------------------------------------------------------------------------
-cpPlugins::Plugins::BinaryThresholdImageFilter::
+cpPlugins::BasicFilters::BinaryThresholdImageFilter::
 ~BinaryThresholdImageFilter( )
 {
 }
 
 // -------------------------------------------------------------------------
-std::string cpPlugins::Plugins::BinaryThresholdImageFilter::
+std::string cpPlugins::BasicFilters::BinaryThresholdImageFilter::
 _GenerateData( )
 {
   cpPlugins::Interface::Image* image =
@@ -69,7 +69,7 @@ _GenerateData( )
 
 // -------------------------------------------------------------------------
 template< class I >
-std::string cpPlugins::Plugins::BinaryThresholdImageFilter::
+std::string cpPlugins::BasicFilters::BinaryThresholdImageFilter::
 _DemangleOutput( itk::DataObject* image )
 {
   return(
@@ -81,7 +81,7 @@ _DemangleOutput( itk::DataObject* image )
 
 // -------------------------------------------------------------------------
 template< class I, class O >
-inline std::string cpPlugins::Plugins::BinaryThresholdImageFilter::
+inline std::string cpPlugins::BasicFilters::BinaryThresholdImageFilter::
 _RealGD( itk::DataObject* image )
 {
   typedef itk::BinaryThresholdImageFilter< I, O > _F;
similarity index 90%
rename from lib/cpPlugins/Plugins/BinaryThresholdImageFilter.h
rename to lib/cpPlugins/Plugins/BasicFilters/BinaryThresholdImageFilter.h
index d108fb233b2756a7feb3f478bcd3cc56b7182779..b41015102473d38b54cad4e3add0c1adf4f093ad 100644 (file)
@@ -1,16 +1,16 @@
 #ifndef __CPPLUGINS__PLUGINS__BINARYTHRESHOLDIMAGEFILTER__H__
 #define __CPPLUGINS__PLUGINS__BINARYTHRESHOLDIMAGEFILTER__H__
 
-#include <cpPlugins/Plugins/cpPlugins_Export.h>
+#include <cpPlugins/BasicFilters/cpPluginsBasicFilters_Export.h>
 #include <cpPlugins/Interface/BaseProcessObjects.h>
 
 namespace cpPlugins
 {
-  namespace Plugins
+  namespace BasicFilters
   {
     /**
      */
-    class cpPlugins_EXPORT BinaryThresholdImageFilter
+    class cpPluginsBasicFilters_EXPORT BinaryThresholdImageFilter
       : public cpPlugins::Interface::ImageToImageFilter
     {
     public:
diff --git a/lib/cpPlugins/Plugins/BasicFilters/CMakeLists.txt b/lib/cpPlugins/Plugins/BasicFilters/CMakeLists.txt
new file mode 100644 (file)
index 0000000..820b54d
--- /dev/null
@@ -0,0 +1,56 @@
+SET(LIBRARY_NAME cpPluginsBasicFilters)
+
+## ===============
+## = Source code =
+## ===============
+
+FILE(GLOB LIB_HEADERS_H   "*.h")
+FILE(GLOB LIB_HEADERS_HPP "*.hpp")
+FILE(GLOB LIB_HEADERS_HXX "*.hxx")
+FILE(GLOB LIB_SOURCES_C   "*.c")
+FILE(GLOB LIB_SOURCES_CPP "*.cpp")
+FILE(GLOB LIB_SOURCES_CXX "*.cxx")
+
+## =====================
+## = Compilation rules =
+## =====================
+
+ADD_CUSTOM_COMMAND(
+  OUTPUT ${LIBRARY_NAME}_Host.cxx
+  DEPENDS ${PROJECT_BINARY_DIR}/cpPlugins_createHost ${LIB_HEADERS_H} ${LIB_HEADERS_HPP} ${LIB_HEADERS_HXX}
+  COMMAND ${PROJECT_BINARY_DIR}/cpPlugins_createHost ${LIBRARY_NAME}_Host.cxx cpPlugins::BasicFilters ${LIB_HEADERS_H}
+  )
+
+ADD_LIBRARY(
+  ${LIBRARY_NAME}
+  SHARED
+  ${LIBRARY_NAME}_Host.cxx
+  ${LIB_SOURCES_C}
+  ${LIB_SOURCES_CPP}
+  ${LIB_SOURCES_CXX}
+  )
+GENERATE_EXPORT_HEADER(
+  ${LIBRARY_NAME}
+  BASE_NAME ${LIBRARY_NAME}
+  EXPORT_MACRO_NAME ${LIBRARY_NAME}_EXPORT
+  EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/lib/cpPlugins/BasicFilters/${LIBRARY_NAME}_Export.h
+  STATIC_DEFINE ${LIBRARY_NAME}_BUILT_AS_STATIC
+  )
+TARGET_LINK_LIBRARIES(
+  ${LIBRARY_NAME}
+  cpPlugins_Interface
+  cpExtensions
+  )
+
+## ========================
+## -- Installation rules --
+## ========================
+
+INSTALL(
+  TARGETS ${LIBRARY_NAME}
+  RUNTIME DESTINATION bin
+  LIBRARY DESTINATION lib
+  ARCHIVE DESTINATION lib/static
+  )
+
+## eof - $RCSfile$
similarity index 90%
rename from lib/cpPlugins/Plugins/MarchingCubes.cxx
rename to lib/cpPlugins/Plugins/BasicFilters/MarchingCubes.cxx
index 94af090e1c2831d1cf09d5bb1818037d4e9b1078..38f7dbc848c987daa95e1b45a69fe58d1cdc7275 100644 (file)
@@ -1,4 +1,4 @@
-#include <cpPlugins/Plugins/MarchingCubes.h>
+#include "MarchingCubes.h"
 #include <cpPlugins/Interface/Image.h>
 #include <cpPlugins/Interface/Mesh.h>
 
@@ -7,12 +7,12 @@
 #include <vtkMarchingSquares.h>
 
 // -------------------------------------------------------------------------
-cpPlugins::Plugins::MarchingCubes::
+cpPlugins::BasicFilters::MarchingCubes::
 MarchingCubes( )
   : Superclass( ),
     m_Algorithm( NULL )
 {
-  this->m_ClassName = "cpPlugins::MarchingCubes";
+  this->m_ClassName = "cpPlugins::BasicFilters::MarchingCubes";
   this->m_ClassCategory = "ImageToMeshFilter";
 
   this->SetNumberOfInputs( 1 );
@@ -25,7 +25,7 @@ MarchingCubes( )
 }
 
 // -------------------------------------------------------------------------
-cpPlugins::Plugins::MarchingCubes::
+cpPlugins::BasicFilters::MarchingCubes::
 ~MarchingCubes( )
 {
   if( this->m_Algorithm != NULL )
@@ -33,7 +33,7 @@ cpPlugins::Plugins::MarchingCubes::
 }
 
 // -------------------------------------------------------------------------
-std::string cpPlugins::Plugins::MarchingCubes::
+std::string cpPlugins::BasicFilters::MarchingCubes::
 _GenerateData( )
 {
   // Get input
similarity index 89%
rename from lib/cpPlugins/Plugins/MarchingCubes.h
rename to lib/cpPlugins/Plugins/BasicFilters/MarchingCubes.h
index b675bba69ac30c217df5f5539cf8e44f8895884e..a5790e9ac157024c76eed4bca67b71ef48263820 100644 (file)
@@ -1,18 +1,18 @@
 #ifndef __CPPLUGINS__PLUGINS__MARCHINGCUBES__H__
 #define __CPPLUGINS__PLUGINS__MARCHINGCUBES__H__
 
-#include <cpPlugins/Plugins/cpPlugins_Export.h>
+#include <cpPlugins/BasicFilters/cpPluginsBasicFilters_Export.h>
 #include <cpPlugins/Interface/BaseProcessObjects.h>
 
 class vtkPolyDataAlgorithm;
 
 namespace cpPlugins
 {
-  namespace Plugins
+  namespace BasicFilters
   {
     /**
      */
-    class cpPlugins_EXPORT MarchingCubes
+    class cpPluginsBasicFilters_EXPORT MarchingCubes
       : public cpPlugins::Interface::ImageToMeshFilter
     {
     public:
similarity index 87%
rename from lib/cpPlugins/Plugins/MedianImageFilter.cxx
rename to lib/cpPlugins/Plugins/BasicFilters/MedianImageFilter.cxx
index e2079677270de494a6f38a9a230f44f43dd681ba..53a9d28c5d9a867e83ede882be432df25c3a34e5 100644 (file)
@@ -1,14 +1,14 @@
-#include <cpPlugins/Plugins/MedianImageFilter.h>
+#include "MedianImageFilter.h"
 #include <cpPlugins/Interface/Image.h>
 
 #include <itkMedianImageFilter.h>
 
 // -------------------------------------------------------------------------
-cpPlugins::Plugins::MedianImageFilter::
+cpPlugins::BasicFilters::MedianImageFilter::
 MedianImageFilter( )
   : Superclass( )
 {
-  this->m_ClassName = "cpPlugins::MedianImageFilter";
+  this->m_ClassName = "cpPlugins::BasicFilters::MedianImageFilter";
   this->m_ClassCategory = "ImageToImageFilter";
   this->SetNumberOfInputs( 1 );
   this->SetNumberOfOutputs( 1 );
@@ -23,13 +23,13 @@ MedianImageFilter( )
 }
 
 // -------------------------------------------------------------------------
-cpPlugins::Plugins::MedianImageFilter::
+cpPlugins::BasicFilters::MedianImageFilter::
 ~MedianImageFilter( )
 {
 }
 
 // -------------------------------------------------------------------------
-std::string cpPlugins::Plugins::MedianImageFilter::
+std::string cpPlugins::BasicFilters::MedianImageFilter::
 _GenerateData( )
 {
   cpPlugins::Interface::Image* image =
@@ -54,7 +54,7 @@ _GenerateData( )
 
 // -------------------------------------------------------------------------
 template< class I >
-std::string cpPlugins::Plugins::MedianImageFilter::
+std::string cpPlugins::BasicFilters::MedianImageFilter::
 _DemangleOutput( itk::DataObject* image )
 {
   return(
@@ -66,7 +66,7 @@ _DemangleOutput( itk::DataObject* image )
 
 // -------------------------------------------------------------------------
 template< class I, class O >
-inline std::string cpPlugins::Plugins::MedianImageFilter::
+inline std::string cpPlugins::BasicFilters::MedianImageFilter::
 _RealGD( itk::DataObject* image )
 {
   typedef itk::MedianImageFilter< I, O > _F;
similarity index 90%
rename from lib/cpPlugins/Plugins/MedianImageFilter.h
rename to lib/cpPlugins/Plugins/BasicFilters/MedianImageFilter.h
index 3ee8db491db356c0ccfc54201a546acc88ae0385..a4d4679c29378ca2bb7a06d614108b376b167e29 100644 (file)
@@ -1,16 +1,16 @@
 #ifndef __CPPLUGINS__PLUGINS__MEDIANIMAGEFILTER__H__
 #define __CPPLUGINS__PLUGINS__MEDIANIMAGEFILTER__H__
 
-#include <cpPlugins/Plugins/cpPlugins_Export.h>
+#include <cpPlugins/BasicFilters/cpPluginsBasicFilters_Export.h>
 #include <cpPlugins/Interface/BaseProcessObjects.h>
 
 namespace cpPlugins
 {
-  namespace Plugins
+  namespace BasicFilters
   {
     /**
      */
-    class cpPlugins_EXPORT MedianImageFilter
+    class cpPluginsBasicFilters_EXPORT MedianImageFilter
       : public cpPlugins::Interface::ImageToImageFilter
     {
     public:
similarity index 88%
rename from lib/cpPlugins/Plugins/OtsuThresholdImageFilter.cxx
rename to lib/cpPlugins/Plugins/BasicFilters/OtsuThresholdImageFilter.cxx
index dc6fd942f2c70a0f378352e94b435d4cb49e9dae..6e0d36fa29b72d8ee354129fbf3c45f82df53f0d 100644 (file)
@@ -1,14 +1,14 @@
-#include <cpPlugins/Plugins/OtsuThresholdImageFilter.h>
+#include "OtsuThresholdImageFilter.h"
 #include <cpPlugins/Interface/Image.h>
 
 #include <itkOtsuThresholdImageFilter.h>
 
 // -------------------------------------------------------------------------
-cpPlugins::Plugins::OtsuThresholdImageFilter::
+cpPlugins::BasicFilters::OtsuThresholdImageFilter::
 OtsuThresholdImageFilter( )
   : Superclass( )
 {
-  this->m_ClassName = "cpPlugins::OtsuThresholdImageFilter";
+  this->m_ClassName = "cpPlugins::BasicFilters::OtsuThresholdImageFilter";
   this->m_ClassCategory = "ImageToImageFilter";
   this->SetNumberOfInputs( 1 );
   this->SetNumberOfOutputs( 1 );
@@ -27,13 +27,13 @@ OtsuThresholdImageFilter( )
 }
 
 // -------------------------------------------------------------------------
-cpPlugins::Plugins::OtsuThresholdImageFilter::
+cpPlugins::BasicFilters::OtsuThresholdImageFilter::
 ~OtsuThresholdImageFilter( )
 {
 }
 
 // -------------------------------------------------------------------------
-std::string cpPlugins::Plugins::OtsuThresholdImageFilter::
+std::string cpPlugins::BasicFilters::OtsuThresholdImageFilter::
 _GenerateData( )
 {
   cpPlugins::Interface::Image* image =
@@ -58,7 +58,7 @@ _GenerateData( )
 
 // -------------------------------------------------------------------------
 template< class I >
-std::string cpPlugins::Plugins::OtsuThresholdImageFilter::
+std::string cpPlugins::BasicFilters::OtsuThresholdImageFilter::
 _DemangleOutput( itk::DataObject* image )
 {
   return(
@@ -70,7 +70,7 @@ _DemangleOutput( itk::DataObject* image )
 
 // -------------------------------------------------------------------------
 template< class I, class O >
-inline std::string cpPlugins::Plugins::OtsuThresholdImageFilter::
+inline std::string cpPlugins::BasicFilters::OtsuThresholdImageFilter::
 _RealGD( itk::DataObject* image )
 {
   typedef itk::OtsuThresholdImageFilter< I, O > _F;
similarity index 90%
rename from lib/cpPlugins/Plugins/OtsuThresholdImageFilter.h
rename to lib/cpPlugins/Plugins/BasicFilters/OtsuThresholdImageFilter.h
index 3d35287ec24b15e4a5de2cd888f44a878b98d6fe..6a112d0d4cb8adf3973ebdb433cfe8a4f2b2be15 100644 (file)
@@ -1,16 +1,16 @@
 #ifndef __CPPLUGINS__PLUGINS__OTSUTHRESHOLDIMAGEFILTER__H__
 #define __CPPLUGINS__PLUGINS__OTSUTHRESHOLDIMAGEFILTER__H__
 
-#include <cpPlugins/Plugins/cpPlugins_Export.h>
+#include <cpPlugins/BasicFilters/cpPluginsBasicFilters_Export.h>
 #include <cpPlugins/Interface/BaseProcessObjects.h>
 
 namespace cpPlugins
 {
-  namespace Plugins
+  namespace BasicFilters
   {
     /**
      */
-    class cpPlugins_EXPORT OtsuThresholdImageFilter
+    class cpPluginsBasicFilters_EXPORT OtsuThresholdImageFilter
       : public cpPlugins::Interface::ImageToImageFilter
     {
     public:
similarity index 91%
rename from lib/cpPlugins/Plugins/RGBImageToOtherChannelsFilter.cxx
rename to lib/cpPlugins/Plugins/BasicFilters/RGBImageToOtherChannelsFilter.cxx
index 6cc0d1ca96a45eba1b813aeb3f00fd2464912d44..7f5b1fc8f923860d20694910bab28c39c0368127 100644 (file)
@@ -1,4 +1,4 @@
-#include <cpPlugins/Plugins/RGBImageToOtherChannelsFilter.h>
+#include "RGBImageToOtherChannelsFilter.h"
 #include <cpPlugins/Interface/Image.h>
 
 #include <cpExtensions/Algorithms/RGBImageToOtherChannelsFilter.h>
@@ -7,13 +7,13 @@
 #include <cpExtensions/Algorithms/RGBToYPbPrFunction.h>
 
 // -------------------------------------------------------------------------
-cpPlugins::Plugins::RGBImageToOtherChannelsFilter::
+cpPlugins::BasicFilters::RGBImageToOtherChannelsFilter::
 RGBImageToOtherChannelsFilter( )
   : Superclass( )
 {
   typedef cpPlugins::Interface::Parameters TParameters;
 
-  this->m_ClassName = "cpPlugins::RGBImageToOtherChannelsFilter";
+  this->m_ClassName = "cpPlugins::BasicFilters::RGBImageToOtherChannelsFilter";
   this->m_ClassCategory = "ImageToImageFilter";
   this->SetNumberOfInputs( 1 );
   this->SetNumberOfOutputs( 1 );
@@ -24,7 +24,7 @@ RGBImageToOtherChannelsFilter( )
 }
 
 // -------------------------------------------------------------------------
-cpPlugins::Plugins::RGBImageToOtherChannelsFilter::
+cpPlugins::BasicFilters::RGBImageToOtherChannelsFilter::
 ~RGBImageToOtherChannelsFilter( )
 {
 }
@@ -49,7 +49,7 @@ cpPlugins::Plugins::RGBImageToOtherChannelsFilter::
     )
 
 // -------------------------------------------------------------------------
-std::string cpPlugins::Plugins::RGBImageToOtherChannelsFilter::
+std::string cpPlugins::BasicFilters::RGBImageToOtherChannelsFilter::
 _GenerateData( )
 {
   cpPlugins::Interface::Image* image =
@@ -74,7 +74,7 @@ _GenerateData( )
 
 // -------------------------------------------------------------------------
 template< class I >
-std::string cpPlugins::Plugins::RGBImageToOtherChannelsFilter::
+std::string cpPlugins::BasicFilters::RGBImageToOtherChannelsFilter::
 _DemangleOutput( itk::DataObject* image )
 {
   typedef typename I::PixelType _P;
@@ -98,7 +98,7 @@ _DemangleOutput( itk::DataObject* image )
 
 // -------------------------------------------------------------------------
 template< class I, class C >
-std::string cpPlugins::Plugins::RGBImageToOtherChannelsFilter::
+std::string cpPlugins::BasicFilters::RGBImageToOtherChannelsFilter::
 _RealGD( itk::DataObject* image )
 {
   typedef itk::Image< itk::RGBPixel< double >, I::ImageDimension > _O;
similarity index 90%
rename from lib/cpPlugins/Plugins/RGBImageToOtherChannelsFilter.h
rename to lib/cpPlugins/Plugins/BasicFilters/RGBImageToOtherChannelsFilter.h
index 0ccb16cf7b225c212f24be87b1a3af8e5d617baa..6d215f1ff840e1d1395ec079881fcf987bde703a 100644 (file)
@@ -1,16 +1,16 @@
 #ifndef __CPPLUGINS__PLUGINS__RGBIMAGETOOTHERCHANNELSFILTER__H__
 #define __CPPLUGINS__PLUGINS__RGBIMAGETOOTHERCHANNELSFILTER__H__
 
-#include <cpPlugins/Plugins/cpPlugins_Export.h>
+#include <cpPlugins/BasicFilters/cpPluginsBasicFilters_Export.h>
 #include <cpPlugins/Interface/BaseProcessObjects.h>
 
 namespace cpPlugins
 {
-  namespace Plugins
+  namespace BasicFilters
   {
     /**
      */
-    class cpPlugins_EXPORT RGBImageToOtherChannelsFilter
+    class cpPluginsBasicFilters_EXPORT RGBImageToOtherChannelsFilter
       : public cpPlugins::Interface::ImageToImageFilter
     {
     public:
index d908e42381522f7b20c88317362cf6aaf677b418..477f5007fe29127c8203e2b8d6d3f9e7e712f2e3 100644 (file)
@@ -1,49 +1,61 @@
-SET(LIBRARY_NAME cpPlugins)
-
-## ===============
-## = Source code =
-## ===============
-
-FILE(GLOB LIB_HEADERS_H   "*.h")
-FILE(GLOB LIB_HEADERS_HPP "*.hpp")
-FILE(GLOB LIB_HEADERS_HXX "*.hxx")
-FILE(GLOB LIB_SOURCES_C   "*.c")
-FILE(GLOB LIB_SOURCES_CPP "*.cpp")
-FILE(GLOB LIB_SOURCES_CXX "*.cxx")
-
-## =====================
-## = Compilation rules =
-## =====================
-
-ADD_LIBRARY(
-  ${LIBRARY_NAME}
-  SHARED
-  ${LIB_SOURCES_C}
-  ${LIB_SOURCES_CPP}
-  ${LIB_SOURCES_CXX}
-  )
-GENERATE_EXPORT_HEADER(
-  ${LIBRARY_NAME}
-  BASE_NAME ${LIBRARY_NAME}
-  EXPORT_MACRO_NAME ${LIBRARY_NAME}_EXPORT
-  EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/lib/cpPlugins/Plugins/${LIBRARY_NAME}_Export.h
-  STATIC_DEFINE ${LIBRARY_NAME}_BUILT_AS_STATIC
-  )
-TARGET_LINK_LIBRARIES(
-  ${LIBRARY_NAME}
-  cpExtensions
-  cpPlugins_Interface
+SUBDIRS(
+  IO
+  BasicFilters
   )
 
-## ========================
-## -- Installation rules --
-## ========================
+# SET(LIBRARY_NAME cpPlugins)
 
-INSTALL(
-  TARGETS ${LIBRARY_NAME}
-  RUNTIME DESTINATION bin
-  LIBRARY DESTINATION lib
-  ARCHIVE DESTINATION lib/static
-  )
+# ## ===============
+# ## = Source code =
+# ## ===============
+
+# FILE(GLOB LIB_HEADERS_H   "*.h")
+# FILE(GLOB LIB_HEADERS_HPP "*.hpp")
+# FILE(GLOB LIB_HEADERS_HXX "*.hxx")
+# FILE(GLOB LIB_SOURCES_C   "*.c")
+# FILE(GLOB LIB_SOURCES_CPP "*.cpp")
+# FILE(GLOB LIB_SOURCES_CXX "*.cxx")
+
+# ## =====================
+# ## = Compilation rules =
+# ## =====================
+
+# ADD_CUSTOM_COMMAND(
+#   OUTPUT ${LIBRARY_NAME}_Host.cxx
+#   DEPENDS ${PROJECT_BINARY_DIR}/cpPlugins_createHost ${LIB_HEADERS_H} ${LIB_HEADERS_HPP} ${LIB_HEADERS_HXX}
+#   COMMAND ${PROJECT_BINARY_DIR}/cpPlugins_createHost ${LIBRARY_NAME}_Host.cxx cpPlugins::Plugins ${LIB_HEADERS_H}
+#   )
+
+# ADD_LIBRARY(
+#   ${LIBRARY_NAME}
+#   SHARED
+#   ${LIBRARY_NAME}_Host.cxx
+#   ${LIB_SOURCES_C}
+#   ${LIB_SOURCES_CPP}
+#   ${LIB_SOURCES_CXX}
+#   )
+# GENERATE_EXPORT_HEADER(
+#   ${LIBRARY_NAME}
+#   BASE_NAME ${LIBRARY_NAME}
+#   EXPORT_MACRO_NAME ${LIBRARY_NAME}_EXPORT
+#   EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/lib/cpPlugins/Plugins/${LIBRARY_NAME}_Export.h
+#   STATIC_DEFINE ${LIBRARY_NAME}_BUILT_AS_STATIC
+#   )
+# TARGET_LINK_LIBRARIES(
+#   ${LIBRARY_NAME}
+#   cpExtensions
+#   cpPlugins_Interface
+#   )
+
+# ## ========================
+# ## -- Installation rules --
+# ## ========================
+
+# INSTALL(
+#   TARGETS ${LIBRARY_NAME}
+#   RUNTIME DESTINATION bin
+#   LIBRARY DESTINATION lib
+#   ARCHIVE DESTINATION lib/static
+#   )
 
-## eof - $RCSfile$
+# ## eof - $RCSfile$
diff --git a/lib/cpPlugins/Plugins/Host.cxx b/lib/cpPlugins/Plugins/Host.cxx
deleted file mode 100644 (file)
index e16e01e..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <Pluma/Connector.hpp>
-#include <cpPlugins/Plugins/ImageReader.h>
-#include <cpPlugins/Plugins/ImageWriter.h>
-#include <cpPlugins/Plugins/MeshReader.h>
-#include <cpPlugins/Plugins/MeshWriter.h>
-#include <cpPlugins/Plugins/MarchingCubes.h>
-#include <cpPlugins/Plugins/OtsuThresholdImageFilter.h>
-#include <cpPlugins/Plugins/RGBImageToOtherChannelsFilter.h>
-#include <cpPlugins/Plugins/SecondRankDiffusionTensorToPolyData.h>
-#include <cpPlugins/Plugins/BinaryThresholdImageFilter.h>
-#include <cpPlugins/Plugins/MedianImageFilter.h>
-
-/// TODO: doc
-PLUMA_CONNECTOR
-bool connect( pluma::Host& host )
-{
-  using namespace cpPlugins::Plugins;
-
-  host.add( new ImageReaderProvider( ) );
-  host.add( new ImageWriterProvider( ) );
-  host.add( new MeshReaderProvider( ) );
-  host.add( new MeshWriterProvider( ) );
-  host.add( new MarchingCubesProvider( ) );
-  host.add( new OtsuThresholdImageFilterProvider( ) );
-  host.add( new RGBImageToOtherChannelsFilterProvider( ) );
-  host.add( new SecondRankDiffusionTensorToPolyDataProvider( ) );
-  host.add( new BinaryThresholdImageFilterProvider( ) );
-  host.add( new MedianImageFilterProvider( ) );
-
-  return( true );
-}
-
-// eof - $RCSfile$
diff --git a/lib/cpPlugins/Plugins/IO/CMakeLists.txt b/lib/cpPlugins/Plugins/IO/CMakeLists.txt
new file mode 100644 (file)
index 0000000..f1a7a46
--- /dev/null
@@ -0,0 +1,55 @@
+SET(LIBRARY_NAME cpPluginsIO)
+
+## ===============
+## = Source code =
+## ===============
+
+FILE(GLOB LIB_HEADERS_H   "*.h")
+FILE(GLOB LIB_HEADERS_HPP "*.hpp")
+FILE(GLOB LIB_HEADERS_HXX "*.hxx")
+FILE(GLOB LIB_SOURCES_C   "*.c")
+FILE(GLOB LIB_SOURCES_CPP "*.cpp")
+FILE(GLOB LIB_SOURCES_CXX "*.cxx")
+
+## =====================
+## = Compilation rules =
+## =====================
+
+ADD_CUSTOM_COMMAND(
+  OUTPUT ${LIBRARY_NAME}_Host.cxx
+  DEPENDS ${PROJECT_BINARY_DIR}/cpPlugins_createHost ${LIB_HEADERS_H} ${LIB_HEADERS_HPP} ${LIB_HEADERS_HXX}
+  COMMAND ${PROJECT_BINARY_DIR}/cpPlugins_createHost ${LIBRARY_NAME}_Host.cxx cpPlugins::IO ${LIB_HEADERS_H}
+  )
+
+ADD_LIBRARY(
+  ${LIBRARY_NAME}
+  SHARED
+  ${LIBRARY_NAME}_Host.cxx
+  ${LIB_SOURCES_C}
+  ${LIB_SOURCES_CPP}
+  ${LIB_SOURCES_CXX}
+  )
+GENERATE_EXPORT_HEADER(
+  ${LIBRARY_NAME}
+  BASE_NAME ${LIBRARY_NAME}
+  EXPORT_MACRO_NAME ${LIBRARY_NAME}_EXPORT
+  EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/lib/cpPlugins/IO/${LIBRARY_NAME}_Export.h
+  STATIC_DEFINE ${LIBRARY_NAME}_BUILT_AS_STATIC
+  )
+TARGET_LINK_LIBRARIES(
+  ${LIBRARY_NAME}
+  cpPlugins_Interface
+  )
+
+## ========================
+## -- Installation rules --
+## ========================
+
+INSTALL(
+  TARGETS ${LIBRARY_NAME}
+  RUNTIME DESTINATION bin
+  LIBRARY DESTINATION lib
+  ARCHIVE DESTINATION lib/static
+  )
+
+## eof - $RCSfile$
diff --git a/lib/cpPlugins/Plugins/IO/ImageReader.cxx b/lib/cpPlugins/Plugins/IO/ImageReader.cxx
new file mode 100644 (file)
index 0000000..38739df
--- /dev/null
@@ -0,0 +1,396 @@
+#include "ImageReader.h"
+#include <cpPlugins/Interface/Image.h>
+
+#include <set>
+
+#include <itkImageFileReader.h>
+#include <itkImageSeriesReader.h>
+
+// -------------------------------------------------------------------------
+cpPlugins::IO::ImageReader::
+ImageReader( )
+  : Superclass( )
+{
+  this->m_ClassName = "cpPlugins::IO::ImageReader";
+  this->m_ClassCategory = "ImageReader";
+
+  this->SetNumberOfOutputs( 1 );
+  this->_MakeOutput< cpPlugins::Interface::Image >( 0 );
+
+  using namespace cpPlugins::Interface;
+  this->m_DefaultParameters.Configure( Parameters::StringList, "FileNames" );
+  this->m_DefaultParameters.Configure( Parameters::Bool, "VectorType" );
+  this->m_DefaultParameters.SetValueAsBool( "VectorType", false );
+  this->m_Parameters = this->m_DefaultParameters;
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::IO::ImageReader::
+~ImageReader( )
+{
+}
+
+// -------------------------------------------------------------------------
+std::string cpPlugins::IO::ImageReader::
+_GenerateData( )
+{
+  // Get filenames
+  TStringList names;
+  this->m_Parameters.GetValueAsStringList( names, "FileNames" );
+
+  std::string r = "";
+  if( names.size( ) >= 1 )
+  {
+    // Guess image properties
+    itk::ImageIOBase::Pointer io =
+      itk::ImageIOFactory::CreateImageIO(
+        names[ 0 ].c_str( ),
+        itk::ImageIOFactory::ReadMode
+        );
+    if( io.IsNotNull( ) )
+    {
+      io->SetFileName( names[ 0 ] );
+      io->ReadImageInformation( );
+      if( names.size( ) >= 1 )
+      {
+        switch( io->GetNumberOfDimensions( ) )
+        {
+        case 2: r = this->_GD0< 2 >( io, names ); break;
+        case 3: r = this->_GD0< 3 >( io, names ); break;
+        case 4: r = this->_GD0< 4 >( io, names ); break;
+        default:
+          r = "ImageReader: Image dimension not supported.";
+          break;
+        } // hctiws
+
+      } // fi
+    }
+    else
+      r = "ImageReader: Could not CreateImageIO for \"" + names[ 0 ] + "\"";
+  }
+  else
+    r = "No image files given";
+  return( r );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int D >
+std::string cpPlugins::IO::ImageReader::
+_GD0( itk::ImageIOBase* io, const TStringList& names )
+{
+  itk::ImageIOBase::IOComponentType ct = io->GetComponentType( );
+  itk::ImageIOBase::IOPixelType pt = io->GetPixelType( );
+  std::string r = "";
+
+  if( pt == itk::ImageIOBase::SCALAR )
+  {
+    switch( ct )
+    {
+    case itk::ImageIOBase::UCHAR:
+      r = this->_GD1< unsigned char, D >( names );
+      break;
+    case itk::ImageIOBase::CHAR:
+      r = this->_GD1< char, D >( names );
+      break;
+    case itk::ImageIOBase::USHORT:
+      r = this->_GD1< unsigned short, D >( names );
+      break;
+    case itk::ImageIOBase::SHORT:
+      r = this->_GD1< short, D >( names );
+      break;
+    case itk::ImageIOBase::UINT:
+      r = this->_GD1< unsigned int, D >( names );
+      break;
+    case itk::ImageIOBase::INT:
+      r = this->_GD1< int, D >( names );
+      break;
+    case itk::ImageIOBase::ULONG:
+      r = this->_GD1< unsigned long, D >( names );
+      break;
+    case itk::ImageIOBase::LONG:
+      r = this->_GD1< long, D >( names );
+      break;
+    case itk::ImageIOBase::FLOAT:
+      r = this->_GD1< float, D >( names );
+      break;
+    case itk::ImageIOBase::DOUBLE:
+      r = this->_GD1< double, D >( names );
+      break;
+    default:
+      r = "ImageReader: Scalar pixel type not supported.";
+      break;
+    } // hctiws
+  }
+  else if( pt == itk::ImageIOBase::RGB )
+  {
+    switch( ct )
+    {
+    case itk::ImageIOBase::UCHAR:
+      r = this->_GD1< itk::RGBPixel< unsigned char >, D >( names );
+      break;
+    case itk::ImageIOBase::CHAR:
+      r = this->_GD1< itk::RGBPixel< char >, D >( names );
+      break;
+    case itk::ImageIOBase::USHORT:
+      r = this->_GD1< itk::RGBPixel< unsigned short >, D >( names );
+      break;
+    case itk::ImageIOBase::SHORT:
+      r = this->_GD1< itk::RGBPixel< short >, D >( names );
+      break;
+    case itk::ImageIOBase::UINT:
+      r = this->_GD1< itk::RGBPixel< unsigned int >, D >( names );
+      break;
+    case itk::ImageIOBase::INT:
+      r = this->_GD1< itk::RGBPixel< int >, D >( names );
+      break;
+    case itk::ImageIOBase::ULONG:
+      r = this->_GD1< itk::RGBPixel< unsigned long >, D >( names );
+      break;
+    case itk::ImageIOBase::LONG:
+      r = this->_GD1< itk::RGBPixel< long >, D >( names );
+      break;
+    case itk::ImageIOBase::FLOAT:
+      r = this->_GD1< itk::RGBPixel< float >, D >( names );
+      break;
+    case itk::ImageIOBase::DOUBLE:
+      r = this->_GD1< itk::RGBPixel< double >, D >( names );
+      break;
+    default:
+      r = "ImageReader: RGB pixel type not supported.";
+      break;
+    } // hctiws
+  }
+  else if( pt == itk::ImageIOBase::RGBA )
+  {
+    switch( ct )
+    {
+    case itk::ImageIOBase::UCHAR:
+      r = this->_GD1< itk::RGBAPixel< unsigned char >, D >( names );
+      break;
+    case itk::ImageIOBase::CHAR:
+      r = this->_GD1< itk::RGBAPixel< char >, D >( names );
+      break;
+    case itk::ImageIOBase::USHORT:
+      r = this->_GD1< itk::RGBAPixel< unsigned short >, D >( names );
+      break;
+    case itk::ImageIOBase::SHORT:
+      r = this->_GD1< itk::RGBAPixel< short >, D >( names );
+      break;
+    case itk::ImageIOBase::UINT:
+      r = this->_GD1< itk::RGBAPixel< unsigned int >, D >( names );
+      break;
+    case itk::ImageIOBase::INT:
+      r = this->_GD1< itk::RGBAPixel< int >, D >( names );
+      break;
+    case itk::ImageIOBase::ULONG:
+      r = this->_GD1< itk::RGBAPixel< unsigned long >, D >( names );
+      break;
+    case itk::ImageIOBase::LONG:
+      r = this->_GD1< itk::RGBAPixel< long >, D >( names );
+      break;
+    case itk::ImageIOBase::FLOAT:
+      r = this->_GD1< itk::RGBAPixel< float >, D >( names );
+      break;
+    case itk::ImageIOBase::DOUBLE:
+      r = this->_GD1< itk::RGBAPixel< double >, D >( names );
+      break;
+    default:
+      r = "ImageReader: RGBA pixel type not supported.";
+      break;
+    } // hctiws
+  }
+  else if( pt == itk::ImageIOBase::VECTOR )
+  {
+    switch( ct )
+    {
+    case itk::ImageIOBase::FLOAT:
+      r = this->_GD1< itk::Vector< float, D >, D >( names );
+      break;
+    case itk::ImageIOBase::DOUBLE:
+      r = this->_GD1< itk::Vector< double, D >, D >( names );
+      break;
+    default:
+      r = "ImageReader: Vector type not supported.";
+      break;
+    } // hctiws
+  }
+  else if( pt == itk::ImageIOBase::POINT )
+  {
+    switch( ct )
+    {
+    case itk::ImageIOBase::FLOAT:
+      r = this->_GD1< itk::Point< float, D >, D >( names );
+      break;
+    case itk::ImageIOBase::DOUBLE:
+      r = this->_GD1< itk::Point< double, D >, D >( names );
+      break;
+    default:
+      r = "ImageReader: Point type not supported.";
+      break;
+    } // hctiws
+  }
+  else if( pt == itk::ImageIOBase::COVARIANTVECTOR )
+  {
+    switch( ct )
+    {
+    case itk::ImageIOBase::FLOAT:
+      r = this->_GD1< itk::CovariantVector< float, D >, D >( names );
+      break;
+    case itk::ImageIOBase::DOUBLE:
+      r = this->_GD1< itk::CovariantVector< double, D >, D >( names );
+      break;
+    default:
+      r = "ImageReader: CovariantVector type not supported.";
+      break;
+    } // hctiws
+  }
+  else if( pt == itk::ImageIOBase::SYMMETRICSECONDRANKTENSOR )
+  {
+    switch( ct )
+    {
+    case itk::ImageIOBase::FLOAT:
+      r =
+        this->_GD1< itk::SymmetricSecondRankTensor< float, D >, D >(
+          names
+          );
+      break;
+    case itk::ImageIOBase::DOUBLE:
+      r =
+        this->_GD1< itk::SymmetricSecondRankTensor< double, D >, D >(
+          names
+          );
+      break;
+    default:
+      r = "ImageReader: Vector type not supported.";
+      break;
+    } // hctiws
+  }
+  else if( pt == itk::ImageIOBase::DIFFUSIONTENSOR3D )
+  {
+    switch( ct )
+    {
+    case itk::ImageIOBase::FLOAT:
+      r = this->_GD1< itk::DiffusionTensor3D< float >, D >( names );
+      break;
+    case itk::ImageIOBase::DOUBLE:
+      r = this->_GD1< itk::DiffusionTensor3D< double >, D >( names );
+      break;
+    default:
+      r = "ImageReader: Diffusion tensor type not supported.";
+      break;
+    } // hctiws
+  }
+  else if( pt == itk::ImageIOBase::COMPLEX )
+  {
+    switch( ct )
+    {
+    case itk::ImageIOBase::FLOAT:
+      r = this->_GD1< std::complex< float >, D >( names );
+      break;
+    case itk::ImageIOBase::DOUBLE:
+      r = this->_GD1< std::complex< double >, D >( names );
+      break;
+    default:
+      r = "ImageReader: Complex type not supported.";
+      break;
+    } // hctiws
+  }
+  else if( pt == itk::ImageIOBase::OFFSET )
+    r = this->_GD1< itk::Offset< D >, D >( names );
+  else
+    r = "ImageReader: Image pixel type not yet supported.";
+  /* TODO
+     itk::ImageIOBase::FIXEDARRAY
+     itk::ImageIOBase::MATRIX
+  */
+  return( r );
+}
+
+// -------------------------------------------------------------------------
+template< class P, unsigned int D >
+std::string cpPlugins::IO::ImageReader::
+_GD1( const TStringList& names )
+{
+  if( this->m_Parameters.GetValueAsBool( "VectorType" ) )
+    return( this->_RealGD< itk::VectorImage< P, D > >( names ) );
+  else
+    return( this->_RealGD< itk::Image< P, D > >( names ) );
+}
+
+// -------------------------------------------------------------------------
+template< class I >
+std::string cpPlugins::IO::ImageReader::
+_RealGD( const TStringList& names )
+{
+  cpPlugins::Interface::Image* out =
+    this->GetOutput< cpPlugins::Interface::Image >( 0 );
+  if( out == NULL )
+    return( "ImageReader: No output object properly created." );
+
+  std::string r = "";
+  if( names.size( ) == 1 )
+  {
+    // Read single image
+    typedef itk::ImageFileReader< I > _SR;
+    _SR* reader =
+      dynamic_cast< _SR* >( this->m_RealProcessObject.GetPointer( ) );
+    if( reader == NULL )
+    {
+      this->m_RealProcessObject = _SR::New( );
+      reader =
+        dynamic_cast< _SR* >( this->m_RealProcessObject.GetPointer( ) );
+
+    } // fi
+    reader->SetFileName( names[ 0 ] );
+    try
+    {
+      reader->Update( );
+      out->SetITKImage< I >( reader->GetOutput( ) );
+    }
+    catch( itk::ExceptionObject& err )
+    {
+      r = "ImageReader: " + std::string( err.GetDescription( ) );
+      out->SetITKImage< I >( NULL );
+
+    } // yrt
+  }
+  else if( names.size( ) > 1 )
+  {
+    // Read image series
+    std::set< std::string > ordered_names;
+    for( unsigned int i = 0; i < names.size( ); ++i )
+      ordered_names.insert( names[ i ] );
+
+    typedef itk::ImageSeriesReader< I > _MR;
+    _MR* reader =
+      dynamic_cast< _MR* >( this->m_RealProcessObject.GetPointer( ) );
+    if( reader == NULL )
+    {
+      this->m_RealProcessObject = _MR::New( );
+      reader =
+        dynamic_cast< _MR* >( this->m_RealProcessObject.GetPointer( ) );
+
+    } // fi
+    std::set< std::string >::const_iterator fnIt = ordered_names.begin( );
+    for( ; fnIt != ordered_names.end( ); ++fnIt )
+    {
+      reader->AddFileName( *fnIt );
+    }
+    try
+    {
+      reader->Update( );
+      out->SetITKImage< I >( reader->GetOutput( ) );
+    }
+    catch( itk::ExceptionObject& err )
+    {
+      r = "ImageReader: " + std::string( err.GetDescription( ) );
+      out->SetITKImage< I >( NULL );
+
+    } // yrt
+  }
+  else
+    r = "ImageReader: No image files given";
+  return( r );
+}
+
+// eof - $RCSfile$
similarity index 88%
rename from lib/cpPlugins/Plugins/ImageReader.h
rename to lib/cpPlugins/Plugins/IO/ImageReader.h
index 1bcf6aec5fff1c8c327894c3dd450dbd818444ae..803e5f81189ef745767708e121d707893c802c41 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <vector>
 
-#include <cpPlugins/Plugins/cpPlugins_Export.h>
+#include <cpPlugins/IO/cpPluginsIO_Export.h>
 #include <cpPlugins/Interface/BaseProcessObjects.h>
 
 namespace itk
@@ -13,11 +13,11 @@ namespace itk
 
 namespace cpPlugins
 {
-  namespace Plugins
+  namespace IO
   {
     /**
      */
-    class cpPlugins_EXPORT ImageReader
+    class cpPluginsIO_EXPORT ImageReader
       : public cpPlugins::Interface::ImageSource
     {
     public:
@@ -44,6 +44,9 @@ namespace cpPlugins
         std::string _GD0( itk::ImageIOBase* io, const TStringList& names );
 
       template< class P, unsigned int D >
+        std::string _GD1( const TStringList& names );
+
+      template< class I >
         std::string _RealGD( const TStringList& names );
 
     private:
similarity index 90%
rename from lib/cpPlugins/Plugins/ImageWriter.cxx
rename to lib/cpPlugins/Plugins/IO/ImageWriter.cxx
index 59dbe83795e526d3f4f041e8a3d75725e20a216b..6a0de2ed09dc730cdeab376e3c7ce3c9684e7b43 100644 (file)
@@ -1,14 +1,14 @@
-#include <cpPlugins/Plugins/ImageWriter.h>
+#include "ImageWriter.h"
 #include <cpPlugins/Interface/Image.h>
 
 #include <itkImageFileWriter.h>
 
 // -------------------------------------------------------------------------
-cpPlugins::Plugins::ImageWriter::
+cpPlugins::IO::ImageWriter::
 ImageWriter( )
   : Superclass( )
 {
-  this->m_ClassName = "cpPlugins::ImageWriter";
+  this->m_ClassName = "cpPlugins::IO::ImageWriter";
   this->m_ClassCategory = "ImageWriter";
   this->SetNumberOfInputs( 1 );
 
@@ -18,13 +18,13 @@ ImageWriter( )
 }
 
 // -------------------------------------------------------------------------
-cpPlugins::Plugins::ImageWriter::
+cpPlugins::IO::ImageWriter::
 ~ImageWriter( )
 {
 }
 
 // -------------------------------------------------------------------------
-std::string cpPlugins::Plugins::ImageWriter::
+std::string cpPlugins::IO::ImageWriter::
 _GenerateData( )
 {
   cpPlugins::Interface::Image* image =
@@ -58,7 +58,7 @@ _GenerateData( )
 
 // -------------------------------------------------------------------------
 template< class I >
-std::string cpPlugins::Plugins::ImageWriter::
+std::string cpPlugins::IO::ImageWriter::
 _RealGD( itk::DataObject* image )
 {
   typedef itk::ImageFileWriter< I > _W;
similarity index 91%
rename from lib/cpPlugins/Plugins/ImageWriter.h
rename to lib/cpPlugins/Plugins/IO/ImageWriter.h
index 4fc04f5a34545eb862e2093c1ad6077d6fa580e3..9c3b0ceebaadfb50c4093acdd5af8838fd3cb1b9 100644 (file)
@@ -1,16 +1,16 @@
 #ifndef __CPPLUGINS__PLUGINS__IMAGEWRITER__H__
 #define __CPPLUGINS__PLUGINS__IMAGEWRITER__H__
 
-#include <cpPlugins/Plugins/cpPlugins_Export.h>
+#include <cpPlugins/IO/cpPluginsIO_Export.h>
 #include <cpPlugins/Interface/BaseProcessObjects.h>
 
 namespace cpPlugins
 {
-  namespace Plugins
+  namespace IO
   {
     /**
      */
-    class cpPlugins_EXPORT ImageWriter
+    class cpPluginsIO_EXPORT ImageWriter
       : public cpPlugins::Interface::ImageSink
     {
     public:
similarity index 89%
rename from lib/cpPlugins/Plugins/MeshReader.cxx
rename to lib/cpPlugins/Plugins/IO/MeshReader.cxx
index 199325954b24e817bc063e99784bbec405cb5b7c..67069046163d768395fc55d2e23c5b8a871f6497 100644 (file)
@@ -1,16 +1,16 @@
-#include <cpPlugins/Plugins/MeshReader.h>
+#include "MeshReader.h"
 #include <cpPlugins/Interface/Mesh.h>
 
 #include <vtkPolyData.h>
 #include <vtkPolyDataReader.h>
 
 // -------------------------------------------------------------------------
-cpPlugins::Plugins::MeshReader::
+cpPlugins::IO::MeshReader::
 MeshReader( )
   : Superclass( ),
     m_Reader( NULL )
 {
-  this->m_ClassName = "cpPlugins::MeshReader";
+  this->m_ClassName = "cpPlugins::IO::MeshReader";
   this->m_ClassCategory = "MeshReader";
 
   this->SetNumberOfOutputs( 1 );
@@ -26,7 +26,7 @@ MeshReader( )
 }
 
 // -------------------------------------------------------------------------
-cpPlugins::Plugins::MeshReader::
+cpPlugins::IO::MeshReader::
 ~MeshReader( )
 {
   if( this->m_Reader != NULL )
@@ -34,7 +34,7 @@ cpPlugins::Plugins::MeshReader::
 }
 
 // -------------------------------------------------------------------------
-std::string cpPlugins::Plugins::MeshReader::
+std::string cpPlugins::IO::MeshReader::
 _GenerateData( )
 {
   using namespace cpPlugins::Interface;
@@ -49,7 +49,7 @@ _GenerateData( )
 
 // -------------------------------------------------------------------------
 template< unsigned int D >
-std::string cpPlugins::Plugins::MeshReader::
+std::string cpPlugins::IO::MeshReader::
 _GD0( )
 {
   using namespace cpPlugins::Interface;
@@ -62,7 +62,7 @@ _GD0( )
 
 // -------------------------------------------------------------------------
 template< class P, unsigned int D >
-std::string cpPlugins::Plugins::MeshReader::
+std::string cpPlugins::IO::MeshReader::
 _GD1( )
 {
   // Get filename
similarity index 92%
rename from lib/cpPlugins/Plugins/MeshReader.h
rename to lib/cpPlugins/Plugins/IO/MeshReader.h
index 394f6a80bfe652447a761d282aace6d75d974193..224cc039d935f7704b7545592c4e57e138b8ac5c 100644 (file)
@@ -1,18 +1,18 @@
 #ifndef __CPPLUGINS__PLUGINS__MESHREADER__H__
 #define __CPPLUGINS__PLUGINS__MESHREADER__H__
 
-#include <cpPlugins/Plugins/cpPlugins_Export.h>
+#include <cpPlugins/IO/cpPluginsIO_Export.h>
 #include <cpPlugins/Interface/BaseProcessObjects.h>
 
 class vtkDataReader;
 
 namespace cpPlugins
 {
-  namespace Plugins
+  namespace IO
   {
     /**
      */
-    class cpPlugins_EXPORT MeshReader
+    class cpPluginsIO_EXPORT MeshReader
       : public cpPlugins::Interface::MeshSource
     {
     public:
similarity index 87%
rename from lib/cpPlugins/Plugins/MeshWriter.cxx
rename to lib/cpPlugins/Plugins/IO/MeshWriter.cxx
index 6cc7841982c87ce2fcb98d405783076dd9090bdb..ade28b87e5b8b85e8d8952ac6e358443151a047d 100644 (file)
@@ -1,4 +1,4 @@
-#include <cpPlugins/Plugins/MeshWriter.h>
+#include "MeshWriter.h"
 #include <cpPlugins/Interface/Mesh.h>
 
 #include <vtkSmartPointer.h>
@@ -6,12 +6,12 @@
 #include <vtkPolyDataWriter.h>
 
 // -------------------------------------------------------------------------
-cpPlugins::Plugins::MeshWriter::
+cpPlugins::IO::MeshWriter::
 MeshWriter( )
   : Superclass( ),
     m_Writer( NULL )
 {
-  this->m_ClassName = "cpPlugins::MeshWriter";
+  this->m_ClassName = "cpPlugins::IO::MeshWriter";
   this->m_ClassCategory = "MeshWriter";
   this->SetNumberOfInputs( 1 );
 
@@ -21,7 +21,7 @@ MeshWriter( )
 }
 
 // -------------------------------------------------------------------------
-cpPlugins::Plugins::MeshWriter::
+cpPlugins::IO::MeshWriter::
 ~MeshWriter( )
 {
   if( this->m_Writer != NULL )
@@ -29,7 +29,7 @@ cpPlugins::Plugins::MeshWriter::
 }
 
 // -------------------------------------------------------------------------
-std::string cpPlugins::Plugins::MeshWriter::
+std::string cpPlugins::IO::MeshWriter::
 _GenerateData( )
 {
   cpPlugins::Interface::Mesh* mesh =
similarity index 91%
rename from lib/cpPlugins/Plugins/MeshWriter.h
rename to lib/cpPlugins/Plugins/IO/MeshWriter.h
index d1fc2cc5b8637a8060e5f12ae74f460606465be6..cd776f61b7db07bbb9397afc65e264fda0009eb8 100644 (file)
@@ -1,18 +1,18 @@
 #ifndef __CPPLUGINS__PLUGINS__MESHWRITER__H__
 #define __CPPLUGINS__PLUGINS__MESHWRITER__H__
 
-#include <cpPlugins/Plugins/cpPlugins_Export.h>
+#include <cpPlugins/IO/cpPluginsIO_Export.h>
 #include <cpPlugins/Interface/BaseProcessObjects.h>
 
 class vtkDataWriter;
 
 namespace cpPlugins
 {
-  namespace Plugins
+  namespace IO
   {
     /**
      */
-    class cpPlugins_EXPORT MeshWriter
+    class cpPluginsIO_EXPORT MeshWriter
       : public cpPlugins::Interface::MeshSink
     {
     public:
diff --git a/lib/cpPlugins/Plugins/ImageReader.cxx b/lib/cpPlugins/Plugins/ImageReader.cxx
deleted file mode 100644 (file)
index 73611cb..0000000
+++ /dev/null
@@ -1,586 +0,0 @@
-#include <cpPlugins/Plugins/ImageReader.h>
-#include <cpPlugins/Interface/Image.h>
-
-#include <set>
-
-#include <itkImageFileReader.h>
-#include <itkImageSeriesReader.h>
-
-// -------------------------------------------------------------------------
-cpPlugins::Plugins::ImageReader::
-ImageReader( )
-  : Superclass( )
-{
-  this->m_ClassName = "cpPlugins::ImageReader";
-  this->m_ClassCategory = "ImageReader";
-
-  this->SetNumberOfOutputs( 1 );
-  this->_MakeOutput< cpPlugins::Interface::Image >( 0 );
-
-  using namespace cpPlugins::Interface;
-  this->m_DefaultParameters.Configure( Parameters::StringList, "FileNames" );
-  this->m_Parameters = this->m_DefaultParameters;
-}
-
-// -------------------------------------------------------------------------
-cpPlugins::Plugins::ImageReader::
-~ImageReader( )
-{
-}
-
-// -------------------------------------------------------------------------
-std::string cpPlugins::Plugins::ImageReader::
-_GenerateData( )
-{
-  // Get filenames
-  TStringList names;
-  this->m_Parameters.GetValueAsStringList( names, "FileNames" );
-
-  std::string r = "";
-  if( names.size( ) >= 1 )
-  {
-    // Guess image properties
-    itk::ImageIOBase::Pointer io =
-      itk::ImageIOFactory::CreateImageIO(
-        names[ 0 ].c_str( ),
-        itk::ImageIOFactory::ReadMode
-        );
-    if( io.IsNotNull( ) )
-    {
-      io->SetFileName( names[ 0 ] );
-      io->ReadImageInformation( );
-      if( names.size( ) >= 1 )
-      {
-        switch( io->GetNumberOfDimensions( ) )
-        {
-        case 2: r = this->_GD0< 2 >( io, names ); break;
-        case 3: r = this->_GD0< 3 >( io, names ); break;
-        case 4: r = this->_GD0< 4 >( io, names ); break;
-        default:
-          r = "ImageReader: Image dimension not supported.";
-          break;
-        } // hctiws
-
-      } // fi
-    }
-    else
-      r = "ImageReader: Could not CreateImageIO for \"" + names[ 0 ] + "\"";
-  }
-  else
-    r = "No image files given";
-  return( r );
-}
-
-// -------------------------------------------------------------------------
-template< unsigned int D >
-std::string cpPlugins::Plugins::ImageReader::
-_GD0( itk::ImageIOBase* io, const TStringList& names )
-{
-  itk::ImageIOBase::IOComponentType ct = io->GetComponentType( );
-  itk::ImageIOBase::IOPixelType pt = io->GetPixelType( );
-  std::string r = "";
-
-  if( pt == itk::ImageIOBase::SCALAR )
-  {
-    switch( ct )
-    {
-    case itk::ImageIOBase::UCHAR:
-      r = this->_RealGD< unsigned char, D >( names );
-      break;
-    case itk::ImageIOBase::CHAR:
-      r = this->_RealGD< char, D >( names );
-      break;
-    case itk::ImageIOBase::USHORT:
-      r = this->_RealGD< unsigned short, D >( names );
-      break;
-    case itk::ImageIOBase::SHORT:
-      r = this->_RealGD< short, D >( names );
-      break;
-    case itk::ImageIOBase::UINT:
-      r = this->_RealGD< unsigned int, D >( names );
-      break;
-    case itk::ImageIOBase::INT:
-      r = this->_RealGD< int, D >( names );
-      break;
-    case itk::ImageIOBase::ULONG:
-      r = this->_RealGD< unsigned long, D >( names );
-      break;
-    case itk::ImageIOBase::LONG:
-      r = this->_RealGD< long, D >( names );
-      break;
-    case itk::ImageIOBase::FLOAT:
-      r = this->_RealGD< float, D >( names );
-      break;
-    case itk::ImageIOBase::DOUBLE:
-      r = this->_RealGD< double, D >( names );
-      break;
-    default:
-      r = "ImageReader: Scalar pixel type not supported.";
-      break;
-    } // hctiws
-  }
-  else if( pt == itk::ImageIOBase::RGB )
-  {
-    if( D == 2 )
-    {
-      switch( ct )
-      {
-      case itk::ImageIOBase::UCHAR:
-        r = this->_RealGD< itk::RGBPixel< unsigned char >, 2 >( names );
-        break;
-      case itk::ImageIOBase::CHAR:
-        r = this->_RealGD< itk::RGBPixel< char >, 2 >( names );
-        break;
-      case itk::ImageIOBase::USHORT:
-        r = this->_RealGD< itk::RGBPixel< unsigned short >, 2 >( names );
-        break;
-      case itk::ImageIOBase::SHORT:
-        r = this->_RealGD< itk::RGBPixel< short >, 2 >( names );
-        break;
-      case itk::ImageIOBase::UINT:
-        r = this->_RealGD< itk::RGBPixel< unsigned int >, 2 >( names );
-        break;
-      case itk::ImageIOBase::INT:
-        r = this->_RealGD< itk::RGBPixel< int >, 2 >( names );
-        break;
-      case itk::ImageIOBase::ULONG:
-        r = this->_RealGD< itk::RGBPixel< unsigned long >, 2 >( names );
-        break;
-      case itk::ImageIOBase::LONG:
-        r = this->_RealGD< itk::RGBPixel< long >, 2 >( names );
-        break;
-      case itk::ImageIOBase::FLOAT:
-        r = this->_RealGD< itk::RGBPixel< float >, 2 >( names );
-        break;
-      case itk::ImageIOBase::DOUBLE:
-        r = this->_RealGD< itk::RGBPixel< double >, 2 >( names );
-        break;
-      default:
-        r = "ImageReader: RGB pixel type not supported.";
-        break;
-      } // hctiws
-    }
-    else if( D == 3 )
-    {
-      switch( ct )
-      {
-      case itk::ImageIOBase::UCHAR:
-        r = this->_RealGD< itk::RGBPixel< unsigned char >, 3 >( names );
-        break;
-      case itk::ImageIOBase::CHAR:
-        r = this->_RealGD< itk::RGBPixel< char >, 3 >( names );
-        break;
-      case itk::ImageIOBase::USHORT:
-        r = this->_RealGD< itk::RGBPixel< unsigned short >, 3 >( names );
-        break;
-      case itk::ImageIOBase::SHORT:
-        r = this->_RealGD< itk::RGBPixel< short >, 3 >( names );
-        break;
-      case itk::ImageIOBase::UINT:
-        r = this->_RealGD< itk::RGBPixel< unsigned int >, 3 >( names );
-        break;
-      case itk::ImageIOBase::INT:
-        r = this->_RealGD< itk::RGBPixel< int >, 3 >( names );
-        break;
-      case itk::ImageIOBase::ULONG:
-        r = this->_RealGD< itk::RGBPixel< unsigned long >, 3 >( names );
-        break;
-      case itk::ImageIOBase::LONG:
-        r = this->_RealGD< itk::RGBPixel< long >, 3 >( names );
-        break;
-      case itk::ImageIOBase::FLOAT:
-        r = this->_RealGD< itk::RGBPixel< float >, 3 >( names );
-        break;
-      case itk::ImageIOBase::DOUBLE:
-        r = this->_RealGD< itk::RGBPixel< double >, 3 >( names );
-        break;
-      default:
-        r = "ImageReader: RGB pixel type not supported.";
-        break;
-      } // hctiws
-    }
-    else if( D == 4 )
-    {
-      switch( ct )
-      {
-      case itk::ImageIOBase::UCHAR:
-        r = this->_RealGD< itk::RGBPixel< unsigned char >, 4 >( names );
-        break;
-      case itk::ImageIOBase::CHAR:
-        r = this->_RealGD< itk::RGBPixel< char >, 4 >( names );
-        break;
-      case itk::ImageIOBase::USHORT:
-        r = this->_RealGD< itk::RGBPixel< unsigned short >, 4 >( names );
-        break;
-      case itk::ImageIOBase::SHORT:
-        r = this->_RealGD< itk::RGBPixel< short >, 4 >( names );
-        break;
-      case itk::ImageIOBase::UINT:
-        r = this->_RealGD< itk::RGBPixel< unsigned int >, 4 >( names );
-        break;
-      case itk::ImageIOBase::INT:
-        r = this->_RealGD< itk::RGBPixel< int >, 4 >( names );
-        break;
-      case itk::ImageIOBase::ULONG:
-        r = this->_RealGD< itk::RGBPixel< unsigned long >, 4 >( names );
-        break;
-      case itk::ImageIOBase::LONG:
-        r = this->_RealGD< itk::RGBPixel< long >, 4 >( names );
-        break;
-      case itk::ImageIOBase::FLOAT:
-        r = this->_RealGD< itk::RGBPixel< float >, 4 >( names );
-        break;
-      case itk::ImageIOBase::DOUBLE:
-        r = this->_RealGD< itk::RGBPixel< double >, 4 >( names );
-        break;
-      default:
-        r = "ImageReader: RGB pixel type not supported.";
-        break;
-      } // hctiws
-
-    } // fi
-  }
-  else if( pt == itk::ImageIOBase::RGBA )
-  {
-    if( D == 2 )
-    {
-      switch( ct )
-      {
-      case itk::ImageIOBase::UCHAR:
-        r = this->_RealGD< itk::RGBAPixel< unsigned char >, 2 >( names );
-        break;
-      case itk::ImageIOBase::CHAR:
-        r = this->_RealGD< itk::RGBAPixel< char >, 2 >( names );
-        break;
-      case itk::ImageIOBase::USHORT:
-        r = this->_RealGD< itk::RGBAPixel< unsigned short >, 2 >( names );
-        break;
-      case itk::ImageIOBase::SHORT:
-        r = this->_RealGD< itk::RGBAPixel< short >, 2 >( names );
-        break;
-      case itk::ImageIOBase::UINT:
-        r = this->_RealGD< itk::RGBAPixel< unsigned int >, 2 >( names );
-        break;
-      case itk::ImageIOBase::INT:
-        r = this->_RealGD< itk::RGBAPixel< int >, 2 >( names );
-        break;
-      case itk::ImageIOBase::ULONG:
-        r = this->_RealGD< itk::RGBAPixel< unsigned long >, 2 >( names );
-        break;
-      case itk::ImageIOBase::LONG:
-        r = this->_RealGD< itk::RGBAPixel< long >, 2 >( names );
-        break;
-      case itk::ImageIOBase::FLOAT:
-        r = this->_RealGD< itk::RGBAPixel< float >, 2 >( names );
-        break;
-      case itk::ImageIOBase::DOUBLE:
-        r = this->_RealGD< itk::RGBAPixel< double >, 2 >( names );
-        break;
-      default:
-        r = "ImageReader: RGBA pixel type not supported.";
-        break;
-      } // hctiws
-    }
-    else if( D == 3 )
-    {
-      switch( ct )
-      {
-      case itk::ImageIOBase::UCHAR:
-        r = this->_RealGD< itk::RGBAPixel< unsigned char >, 3 >( names );
-        break;
-      case itk::ImageIOBase::CHAR:
-        r = this->_RealGD< itk::RGBAPixel< char >, 3 >( names );
-        break;
-      case itk::ImageIOBase::USHORT:
-        r = this->_RealGD< itk::RGBAPixel< unsigned short >, 3 >( names );
-        break;
-      case itk::ImageIOBase::SHORT:
-        r = this->_RealGD< itk::RGBAPixel< short >, 3 >( names );
-        break;
-      case itk::ImageIOBase::UINT:
-        r = this->_RealGD< itk::RGBAPixel< unsigned int >, 3 >( names );
-        break;
-      case itk::ImageIOBase::INT:
-        r = this->_RealGD< itk::RGBAPixel< int >, 3 >( names );
-        break;
-      case itk::ImageIOBase::ULONG:
-        r = this->_RealGD< itk::RGBAPixel< unsigned long >, 3 >( names );
-        break;
-      case itk::ImageIOBase::LONG:
-        r = this->_RealGD< itk::RGBAPixel< long >, 3 >( names );
-        break;
-      case itk::ImageIOBase::FLOAT:
-        r = this->_RealGD< itk::RGBAPixel< float >, 3 >( names );
-        break;
-      case itk::ImageIOBase::DOUBLE:
-        r = this->_RealGD< itk::RGBAPixel< double >, 3 >( names );
-        break;
-      default:
-        r = "ImageReader: RGBA pixel type not supported.";
-        break;
-      } // hctiws
-    }
-    else if( D == 4 )
-    {
-      switch( ct )
-      {
-      case itk::ImageIOBase::UCHAR:
-        r = this->_RealGD< itk::RGBAPixel< unsigned char >, 4 >( names );
-        break;
-      case itk::ImageIOBase::CHAR:
-        r = this->_RealGD< itk::RGBAPixel< char >, 4 >( names );
-        break;
-      case itk::ImageIOBase::USHORT:
-        r = this->_RealGD< itk::RGBAPixel< unsigned short >, 4 >( names );
-        break;
-      case itk::ImageIOBase::SHORT:
-        r = this->_RealGD< itk::RGBAPixel< short >, 4 >( names );
-        break;
-      case itk::ImageIOBase::UINT:
-        r = this->_RealGD< itk::RGBAPixel< unsigned int >, 4 >( names );
-        break;
-      case itk::ImageIOBase::INT:
-        r = this->_RealGD< itk::RGBAPixel< int >, 4 >( names );
-        break;
-      case itk::ImageIOBase::ULONG:
-        r = this->_RealGD< itk::RGBAPixel< unsigned long >, 4 >( names );
-        break;
-      case itk::ImageIOBase::LONG:
-        r = this->_RealGD< itk::RGBAPixel< long >, 4 >( names );
-        break;
-      case itk::ImageIOBase::FLOAT:
-        r = this->_RealGD< itk::RGBAPixel< float >, 4 >( names );
-        break;
-      case itk::ImageIOBase::DOUBLE:
-        r = this->_RealGD< itk::RGBAPixel< double >, 4 >( names );
-        break;
-      default:
-        r = "ImageReader: RGBA pixel type not supported.";
-        break;
-      } // hctiws
-
-    } // fi
-  }
-  else if( pt == itk::ImageIOBase::OFFSET )
-  {
-    switch( D )
-    {
-    case 2:
-      r = this->_RealGD< itk::Offset< 2 >, 2 >( names );
-      break;
-    case 3:
-      r = this->_RealGD< itk::Offset< 3 >, 3 >( names );
-      break;
-    case 4:
-      r = this->_RealGD< itk::Offset< 4 >, 4 >( names );
-      break;
-    default:
-      r = "ImageReader: Offset pixel dimension not supported.";
-      break;
-    } // hctiws
-  }
-  else if( pt == itk::ImageIOBase::VECTOR )
-  {
-    switch( ct )
-    {
-    case itk::ImageIOBase::FLOAT:
-      r = this->_RealGD< itk::Vector< float, D >, D >( names );
-      break;
-    case itk::ImageIOBase::DOUBLE:
-      r = this->_RealGD< itk::Vector< double, D >, D >( names );
-      break;
-    default:
-      r = "ImageReader: Vector type not supported.";
-      break;
-    } // hctiws
-  }
-  else if( pt == itk::ImageIOBase::POINT )
-  {
-    switch( ct )
-    {
-    case itk::ImageIOBase::FLOAT:
-      r = this->_RealGD< itk::Point< float, D >, D >( names );
-      break;
-    case itk::ImageIOBase::DOUBLE:
-      r = this->_RealGD< itk::Point< double, D >, D >( names );
-      break;
-    default:
-      r = "ImageReader: Point type not supported.";
-      break;
-    } // hctiws
-  }
-  else if( pt == itk::ImageIOBase::COVARIANTVECTOR )
-  {
-    switch( ct )
-    {
-    case itk::ImageIOBase::FLOAT:
-      r = this->_RealGD< itk::CovariantVector< float, D >, D >( names );
-      break;
-    case itk::ImageIOBase::DOUBLE:
-      r = this->_RealGD< itk::CovariantVector< double, D >, D >( names );
-      break;
-    default:
-      r = "ImageReader: CovariantVector type not supported.";
-      break;
-    } // hctiws
-  }
-  else if( pt == itk::ImageIOBase::SYMMETRICSECONDRANKTENSOR )
-  {
-    switch( ct )
-    {
-    case itk::ImageIOBase::FLOAT:
-      r =
-        this->_RealGD< itk::SymmetricSecondRankTensor< float, D >, D >(
-          names
-          );
-      break;
-    case itk::ImageIOBase::DOUBLE:
-      r =
-        this->_RealGD< itk::SymmetricSecondRankTensor< double, D >, D >(
-          names
-          );
-      break;
-    default:
-      r = "ImageReader: Vector type not supported.";
-      break;
-    } // hctiws
-  }
-  else if( pt == itk::ImageIOBase::DIFFUSIONTENSOR3D )
-  {
-    if( D == 3 )
-    {
-      switch( ct )
-      {
-      case itk::ImageIOBase::FLOAT:
-        r = this->_RealGD< itk::DiffusionTensor3D< float >, 3 >( names );
-        break;
-      case itk::ImageIOBase::DOUBLE:
-        r = this->_RealGD< itk::DiffusionTensor3D< double >, 3 >( names );
-        break;
-      default:
-        r = "ImageReader: Diffusion tensor type not supported.";
-        break;
-      } // hctiws
-    }
-    else if( D == 4 )
-    {
-      switch( ct )
-      {
-      case itk::ImageIOBase::FLOAT:
-        r = this->_RealGD< itk::DiffusionTensor3D< float >, 4 >( names );
-        break;
-      case itk::ImageIOBase::DOUBLE:
-        r = this->_RealGD< itk::DiffusionTensor3D< double >, 4 >( names );
-        break;
-      default:
-        r = "ImageReader: Diffusion tensor type not supported.";
-        break;
-      } // hctiws
-    }
-    else
-      r = "ImageReader: Diffusion tensor dimension not supported.";
-  }
-  else if( pt == itk::ImageIOBase::COMPLEX )
-  {
-    switch( ct )
-    {
-    case itk::ImageIOBase::FLOAT:
-      r = this->_RealGD< std::complex< float >, D >( names );
-      break;
-    case itk::ImageIOBase::DOUBLE:
-      r = this->_RealGD< std::complex< double >, D >( names );
-      break;
-    default:
-      r = "ImageReader: Complex type not supported.";
-      break;
-    } // hctiws
-  }
-  else
-    r = "ImageReader: Image pixel type not yet supported.";
-  /* TODO
-     itk::ImageIOBase::FIXEDARRAY
-     itk::ImageIOBase::MATRIX
-  */
-
-  return( r );
-}
-
-// -------------------------------------------------------------------------
-template< class P, unsigned int D >
-std::string cpPlugins::Plugins::ImageReader::
-_RealGD( const TStringList& names )
-{
-  typedef itk::Image< P, D > _I;
-
-  cpPlugins::Interface::Image* out =
-    this->GetOutput< cpPlugins::Interface::Image >( 0 );
-  if( out == NULL )
-    return( "ImageReader: No output object properly created." );
-
-  std::string r = "";
-  if( names.size( ) == 1 )
-  {
-    // Read single image
-    typedef itk::ImageFileReader< _I > _SR;
-    _SR* reader =
-      dynamic_cast< _SR* >( this->m_RealProcessObject.GetPointer( ) );
-    if( reader == NULL )
-    {
-      this->m_RealProcessObject = _SR::New( );
-      reader =
-        dynamic_cast< _SR* >( this->m_RealProcessObject.GetPointer( ) );
-
-    } // fi
-    reader->SetFileName( names[ 0 ] );
-    try
-    {
-      reader->Update( );
-      out->SetITKImage< _I >( reader->GetOutput( ) );
-    }
-    catch( itk::ExceptionObject& err )
-    {
-      r = "ImageReader: " + std::string( err.GetDescription( ) );
-      out->SetITKImage< _I >( NULL );
-
-    } // yrt
-  }
-  else if( names.size( ) > 1 )
-  {
-    // Read image series
-    std::set< std::string > ordered_names;
-    for( unsigned int i = 0; i < names.size( ); ++i )
-      ordered_names.insert( names[ i ] );
-
-    typedef itk::ImageSeriesReader< _I > _MR;
-    _MR* reader =
-      dynamic_cast< _MR* >( this->m_RealProcessObject.GetPointer( ) );
-    if( reader == NULL )
-    {
-      this->m_RealProcessObject = _MR::New( );
-      reader =
-        dynamic_cast< _MR* >( this->m_RealProcessObject.GetPointer( ) );
-
-    } // fi
-    std::set< std::string >::const_iterator fnIt = ordered_names.begin( );
-    for( ; fnIt != ordered_names.end( ); ++fnIt )
-    {
-      reader->AddFileName( *fnIt );
-    }
-    try
-    {
-      reader->Update( );
-      out->SetITKImage< _I >( reader->GetOutput( ) );
-    }
-    catch( itk::ExceptionObject& err )
-    {
-      r = "ImageReader: " + std::string( err.GetDescription( ) );
-      out->SetITKImage< _I >( NULL );
-
-    } // yrt
-  }
-  else
-    r = "ImageReader: No image files given";
-  return( r );
-}
-
-// eof - $RCSfile$