]> Creatis software - cpPlugins.git/commitdiff
Merge ssh://git.creatis.insa-lyon.fr/cpPlugins
authorjose guzman <jose@gmail.com>
Fri, 2 Oct 2015 08:18:48 +0000 (10:18 +0200)
committerjose guzman <jose@gmail.com>
Fri, 2 Oct 2015 08:18:48 +0000 (10:18 +0200)
48 files changed:
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
cmake/cpPluginsConfig.cmake.in
lib/cpExtensions/Algorithms/SecondRankDiffusionTensorToPolyData.cxx [deleted file]
lib/cpExtensions/Algorithms/SecondRankDiffusionTensorToPolyData.h [deleted file]
lib/cpExtensions/CMakeLists.txt
lib/cpExtensions/Visualization/ImageInteractorStyle.cxx
lib/cpExtensions/Visualization/ImageSliceActors.cxx
lib/cpExtensions/Visualization/ImageSliceActors.h
lib/cpExtensions/Visualization/MPRActors.cxx
lib/cpExtensions/Visualization/MPRActors.h
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 62% similarity]
lib/cpPlugins/Plugins/BasicFilters/BinaryThresholdImageFilter.h [moved from lib/cpPlugins/Plugins/BinaryThresholdImageFilter.h with 79% 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 78% similarity]
lib/cpPlugins/Plugins/BasicFilters/MedianImageFilter.h [moved from lib/cpPlugins/Plugins/MedianImageFilter.h with 79% 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]
lib/cpPlugins/Plugins/SecondRankDiffusionTensorToPolyData.cxx [deleted file]
lib/cpPlugins/Plugins/SecondRankDiffusionTensorToPolyData.h [deleted file]

index 7ca64d43ccc1308a2fce1060d3c872859574e387..2568ba0471039e5e1a052802f4e5ac4bd8673d57 100644 (file)
@@ -1,3 +1,7 @@
+SUBDIRS(
+  bash
+  )
+
 IF(BUILD_EXAMPLES)
   SUBDIRS(
     examples
index f9a7934562c921846f4aea4cc7ba7a3010997c9b..5951d1fd1872acffdd35b4278d5275b93f6b93c5 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(
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..116999c
--- /dev/null
@@ -0,0 +1,20 @@
+## =========================
+## = Command line programs =
+## =========================
+
+SET(
+  BASH_PROGRAMS
+  cpPlugins_createHost
+  )
+
+FOREACH(prog ${BASH_PROGRAMS}) 
+  ADD_EXECUTABLE(${prog} ${prog}.cxx)
+  INSTALL(
+    TARGETS ${prog}
+    RUNTIME DESTINATION bin
+    LIBRARY DESTINATION lib
+    ARCHIVE DESTINATION lib/static
+    )
+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..6f8214d
--- /dev/null
@@ -0,0 +1,81 @@
+#include <cstring>
+#include <fstream>
+#include <iostream>
+#include <string>
+
+// -------------------------------------------------------------------------
+std::string GetFileName( const std::string& path )
+{
+  // Extract filename
+  char* buffer = new char[ path.size( ) + 1 ];
+  std::memcpy( buffer, path.c_str( ), path.size( ) );
+  buffer[ path.size( ) ] = '\0';
+  char* tok = std::strtok( buffer, "/\\" );
+  char* ptr_fname = tok;
+  while( tok != NULL )
+  {
+    ptr_fname = tok;
+    tok = std::strtok( NULL, "/\\" );
+
+  } // elihw
+  std::string fname( ptr_fname );
+  delete [] buffer;
+
+  // Delete extension
+  std::size_t pos = fname.find_last_of( "." );
+  if( pos != std::string::npos )
+    fname = fname.substr( 0, pos );
+  
+  return( fname );
+}
+
+// -------------------------------------------------------------------------
+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 )
+    output_code
+      << "  host.add( new "
+      << GetFileName( argv[ i ] )
+      << "Provider( ) );"
+      << std::endl;
+
+  output_code
+    << "  return( true );" << std::endl
+    << "}" << std::endl;
+
+  // Finish
+  output_code.close( );
+  return( 0 );
+}
+
+// eof - $RCSfile$
index d7e157911476bfb870e4d389934bef5f85d17b66..8d8a49fa3680a2d0968dd7e0731293df9824387f 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 df933c79bec3f01c82ffe4cfc5ea3822e00985ba..6cd79041721f193332f3e8d34466fa5599329842 100644 (file)
@@ -2,7 +2,47 @@
 # -- Some configurations variables --
 # ===================================
 
-SET(cpPlugins_with_QT4 "@QT4_FOUND@")
+SET(USE_QT4 "@QT4_FOUND@")
+
+# =======================
+# -- Find dependencies --
+# =======================
+
+# Find ITK and VTK
+SET(ITK_DIR @ITK_DIR@)
+FIND_PACKAGE(ITK REQUIRED)
+INCLUDE(${ITK_USE_FILE})
+
+SET(VTK_DIR @VTK_DIR@)
+FIND_PACKAGE(VTK REQUIRED)
+INCLUDE(${VTK_USE_FILE})
+
+# Do not use itk-vtk glue --> problems ahead!!!
+IF(ITKVtkGlue_LOADED)
+  MESSAGE(FATAL_ERROR "ITKVtkGlue module is available. Please re-compile your ITK without it. It could lead to nasty compilation problems... Just waiting for Kitware to solve it.")
+ENDIF(ITKVtkGlue_LOADED)
+
+IF(USE_QT4 EQUAL "1")
+  SET(QT_QMAKE_EXECUTABLE @QT_QMAKE_EXECUTABLE@)
+  FIND_PACKAGE(Qt4 REQUIRED)
+  INCLUDE(${QT_USE_FILE})
+
+  ## Check for required vtk-qt4 modules
+  SET(
+    vtk_required_modules
+    vtkGUISupportQt
+    vtkGUISupportQtOpenGL
+    )
+  FOREACH(vtk_module ${vtk_required_modules})
+    IF(NOT ${vtk_module}_LOADED)
+      MESSAGE(
+        FATAL_ERROR
+        "${vtk_module} module is required but not available."
+        )
+    ENDIF(NOT ${vtk_module}_LOADED)
+  ENDFOREACH(vtk_module)
+ENDIF(USE_QT4 EQUAL "1")
+
 
 # =========================
 # -- Include directories --
@@ -46,4 +86,17 @@ SET(cpExtensions_LIBRARY cpExtensions)
 SET(cpPlugins_Interface_LIBRARY cpPlugins_Interface)
 SET(cpPlugins_LIBRARY cpPlugins)
 
+# ======================
+# -- Executable names --
+# ======================
+
+FIND_PROGRAM(
+  cpPlugins_createHost_APP
+  NAMES cpPlugins_createHost
+  HINTS /usr /usr/local
+  PATHS @CMAKE_INSTALL_PREFIX@/bin @PROJECT_BINARY_DIR@
+  PATH_SUFFIXES bin sbin
+  DOC "Where is cpPlugins_createHost?"
+  )
+
 ## eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/SecondRankDiffusionTensorToPolyData.cxx b/lib/cpExtensions/Algorithms/SecondRankDiffusionTensorToPolyData.cxx
deleted file mode 100644 (file)
index 0645898..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-// -------------------------------------------------------------------------
-// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
-// -------------------------------------------------------------------------
-
-#include <cpExtensions/Algorithms/SecondRankDiffusionTensorToPolyData.h>
-#include <itkImage.h>
-#include <itkSymmetricSecondRankTensor.h>
-#include <itkImageRegionConstIteratorWithIndex.h>
-#include <vtkInformation.h>
-#include <vtkInformationVector.h>
-#include <vtkPoints.h>
-#include <vtkPointData.h>
-#include <vtkSmartPointer.h>
-#include <vtkDoubleArray.h>
-
-// -------------------------------------------------------------------------
-template< class I >
-typename cpExtensions::Algorithms::SecondRankDiffusionTensorToPolyData< I >::
-Self* cpExtensions::Algorithms::SecondRankDiffusionTensorToPolyData< I >::
-New( )
-{
-  return( new Self );
-}
-
-// -------------------------------------------------------------------------
-template< class I >
-void cpExtensions::Algorithms::SecondRankDiffusionTensorToPolyData< I >::
-SetInputData( const I* image )
-{
-  this->m_ITKImage = image;
-  this->Modified( );
-}
-
-// -------------------------------------------------------------------------
-template< class I >
-cpExtensions::Algorithms::SecondRankDiffusionTensorToPolyData< I >::
-SecondRankDiffusionTensorToPolyData( )
-  : vtkPolyDataAlgorithm( )
-{
-  this->SetNumberOfInputPorts( 0 );
-}
-
-// -------------------------------------------------------------------------
-template< class I >
-cpExtensions::Algorithms::SecondRankDiffusionTensorToPolyData< I >::
-~SecondRankDiffusionTensorToPolyData( )
-{
-}
-
-// -------------------------------------------------------------------------
-template< class I >
-int cpExtensions::Algorithms::SecondRankDiffusionTensorToPolyData< I >::
-RequestData(
-  vtkInformation* request,
-  vtkInformationVector** inputVector,
-  vtkInformationVector* outputVector
-  )
-{
-  if( this->m_ITKImage.IsNull( ) )
-    return( 0 );
-  
-  // get the info objects
-  vtkInformation* outInfo = outputVector->GetInformationObject( 0 );
-  vtkPolyData* polyData = vtkPolyData::SafeDownCast(
-    outInfo->Get(vtkDataObject::DATA_OBJECT())
-    );
-
-  itk::ImageRegionConstIteratorWithIndex< I > tensorIt( this->m_ITKImage, this->m_ITKImage->GetRequestedRegion() );
-
-  vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
-  vtkSmartPointer<vtkDoubleArray> vtkTensors = vtkSmartPointer<vtkDoubleArray>::New();
-  vtkTensors->SetNumberOfComponents(9);
-  for ( tensorIt.GoToBegin(); !tensorIt.IsAtEnd(); ++tensorIt )
-  {
-    typename I::IndexType tensorIndex = tensorIt.GetIndex();
-    typename I::PixelType tensor = tensorIt.Get();
-    typename I::PointType ptensor;
-
-    // TODO: std::cout << "\n Index [" << tensorIndex[0] << ", " << tensorIndex[1] << ", " << tensorIndex[2] << "]" << std::endl;
-    this->m_ITKImage->TransformIndexToPhysicalPoint( tensorIndex, ptensor );
-    vtkIdType vtkPointID = points->InsertNextPoint(ptensor[0], ptensor[1], ptensor[2]);
-
-    /**
-     * Definition included in cdifTypes.
-     * typedef itk::SymmetricSecondRankTensor< double > Diffusion2ndRankTensor;
-     */
-    //Diffusion2ndRankTensor Diffusion2ndRankTensor;
-        
-        
-    /**
-     * SYMMETRIC SECOND RANK TENSOR
-     *
-     * The upper-right triangle of the matrix:
-     *
-     *       | 0  1  2  |
-     *       | X  3  4  |
-     *       | X  X  5  |
-     *
-     *       | xx  xy  xz  |
-     *       | X   yy  yz  |
-     *       | X   X   zz  |
-     */
-    /*
-      Diffusion2ndRankTensor = tensor[0];
-      Diffusion2ndRankTensor = tensor[1];
-      Diffusion2ndRankTensor = tensor[2];
-      Diffusion2ndRankTensor = tensor[3];
-      Diffusion2ndRankTensor = tensor[4];
-      Diffusion2ndRankTensor = tensor[5];
-    */
-    typename I::PixelType::EigenValuesArrayType    evalues;
-    typename I::PixelType::EigenVectorsMatrixType  evectors;
-        
-    /**
-     * Return an array containing EigenValues,
-     * and a matrix containing Eigenvectors.
-     */
-    tensor.ComputeEigenAnalysis(evalues, evectors);
-        
-    /*
-      std::cout << "[C-DIFFUSION - NRRD Tensors Example] Eigen values: " << evalues[0] << ", " << evalues[1] << ", " << evalues[2] << std::endl;
-      
-      std::cout << "[C-DIFFUSION - NRRD Tensors Example] Eigen vectors: "
-      
-      << "(" << evectors(0,0) << ", " << evectors(0,1) << ", " << evectors(0,2) << "), "
-      << "(" << evectors(1,0) << ", " << evectors(1,1) << ", " << evectors(1,2) << "), "
-      << "(" << evectors(2,0) << ", " << evectors(2,1) << ", " << evectors(2,2) << ")" << std::endl;
-    */
-    evectors.GetVnlMatrix().scale_row(0, evalues[0]);
-    evectors.GetVnlMatrix().scale_row(1, evalues[1]);
-    evectors.GetVnlMatrix().scale_row(2, evalues[2]);
-    
-    /*
-      std::cout << "[C-DIFFUSION - NRRD Tensors Example] Eigen values x Eigen vectors : "
-      
-      << "(" << evectors(0,0) << ", " << evectors(0,1) << ", " << evectors(0,2) << "), "
-      << "(" << evectors(1,0) << ", " << evectors(1,1) << ", " << evectors(1,2) << "), "
-      << "(" << evectors(2,0) << ", " << evectors(2,1) << ", " << evectors(2,2) << ")" << std::endl;
-    */
-    vtkTensors->InsertTuple9(
-      vtkPointID,
-      evectors(0,0), evectors(0,1), evectors(0,2),
-      evectors(1,0), evectors(1,1), evectors(1,2),
-      evectors(2,0), evectors(2,1), evectors(2,2)
-      );
-  } // rof
-    
-  polyData->SetPoints( points );
-  vtkSmartPointer<vtkPointData> pointData = polyData->GetPointData();
-  pointData->SetTensors( vtkTensors );
-  return( 1 );
-
-  /**
-   * VISUALISATION CODE BELOW
-   */
-  
-//    vtkSmartPointer<vtkCubeSource> cubeSource = vtkSmartPointer<vtkCubeSource>::New();
-//    cubeSource->Update();
-//
-//    vtkSmartPointer<vtkTensorGlyph> tensorGlyph = vtkSmartPointer<vtkTensorGlyph>::New();
-//#if VTK_MAJOR_VERSION <= 5
-//    tensorGlyph->SetInput(polyData);
-//#else
-//    tensorGlyph->SetInputData(polyData);
-//#endif
-//    tensorGlyph->SetSourceConnection(cubeSource->GetOutputPort());
-//    tensorGlyph->ColorGlyphsOff();
-//    tensorGlyph->ThreeGlyphsOff();
-//    tensorGlyph->ExtractEigenvaluesOff();
-//    tensorGlyph->Update();
-//    .
-//    .
-//    .
-
-}
-
-// -------------------------------------------------------------------------
-template class cpExtensions::Algorithms::SecondRankDiffusionTensorToPolyData< itk::Image< itk::SymmetricSecondRankTensor< float, 3 >, 3 > >;
-template class cpExtensions::Algorithms::SecondRankDiffusionTensorToPolyData< itk::Image< itk::SymmetricSecondRankTensor< double, 3 >, 3 > >;
-
-// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/SecondRankDiffusionTensorToPolyData.h b/lib/cpExtensions/Algorithms/SecondRankDiffusionTensorToPolyData.h
deleted file mode 100644 (file)
index 1861263..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-// -------------------------------------------------------------------------
-// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
-// -------------------------------------------------------------------------
-
-#ifndef __CPEXTENSIONS__ALGORITHMS__SECONDRANKDIFFUSIONTENSORTOPOLYDATA__H__
-#define __CPEXTENSIONS__ALGORITHMS__SECONDRANKDIFFUSIONTENSORTOPOLYDATA__H__
-
-#include <cpExtensions/cpExtensions_Export.h>
-
-#include <vtkPolyDataAlgorithm.h>
-
-namespace cpExtensions
-{
-  namespace Algorithms
-  {
-    /**
-     */
-    template< class I >
-    class cpExtensions_EXPORT SecondRankDiffusionTensorToPolyData
-      : public vtkPolyDataAlgorithm
-    {
-    public:
-      typedef SecondRankDiffusionTensorToPolyData Self;
-
-    public:
-      static Self* New( );
-      vtkTypeMacro( SecondRankDiffusionTensorToPolyData, vtkPolyDataAlgorithm );
-
-      void SetInputData( const I* image );
-
-    protected:
-      SecondRankDiffusionTensorToPolyData( );
-      virtual ~SecondRankDiffusionTensorToPolyData( );
-
-      virtual int RequestData(
-        vtkInformation* , vtkInformationVector**, vtkInformationVector*
-        );
-
-    private:
-      SecondRankDiffusionTensorToPolyData( const Self& other );
-      Self& operator=( const Self& other );
-
-    protected:
-      typename I::ConstPointer m_ITKImage;
-    };
-
-  } // ecapseman
-
-} // ecapseman
-
-#endif // __CPEXTENSIONS__ALGORITHMS__SECONDRANKDIFFUSIONTENSORTOPOLYDATA__H__
-
-// eof - $RCSfile$
index 8819756bfda67e484662e5532894dd6c76e36b86..07b7e420f9eb1dcb1a60121df2846a7803987af0 100644 (file)
@@ -4,40 +4,52 @@ SET(LIBRARY_NAME cpExtensions)
 ## = 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")
+SET(LIB_HEADERS_H   "")
+SET(LIB_HEADERS_HPP "")
+SET(LIB_HEADERS_HXX "")
+SET(LIB_SOURCES_C   "")
+SET(LIB_SOURCES_CPP "")
+SET(LIB_SOURCES_CXX "")
 
-FILE(GLOB LIB_DataStructures_HEADERS_H   "DataStructures/*.h")
-FILE(GLOB LIB_DataStructures_HEADERS_HPP "DataStructures/*.hpp")
-FILE(GLOB LIB_DataStructures_HEADERS_HXX "DataStructures/*.hxx")
-FILE(GLOB LIB_DataStructures_SOURCES_C   "DataStructures/*.c")
-FILE(GLOB LIB_DataStructures_SOURCES_CPP "DataStructures/*.cpp")
-FILE(GLOB LIB_DataStructures_SOURCES_CXX "DataStructures/*.cxx")
-
-FILE(GLOB LIB_Algorithms_HEADERS_H   "Algorithms/*.h")
-FILE(GLOB LIB_Algorithms_HEADERS_HPP "Algorithms/*.hpp")
-FILE(GLOB LIB_Algorithms_HEADERS_HXX "Algorithms/*.hxx")
-FILE(GLOB LIB_Algorithms_SOURCES_C   "Algorithms/*.c")
-FILE(GLOB LIB_Algorithms_SOURCES_CPP "Algorithms/*.cpp")
-FILE(GLOB LIB_Algorithms_SOURCES_CXX "Algorithms/*.cxx")
+SET(
+  lib_DIRECTORIES
+  .
+  DataStructures
+  Algorithms
+  IO
+  Visualization
+  )
+FOREACH(dir ${lib_DIRECTORIES})
+  FILE(GLOB dir_LIB_HEADERS_H   "${dir}/*.h")
+  FILE(GLOB dir_LIB_HEADERS_HPP "${dir}/*.hpp")
+  FILE(GLOB dir_LIB_HEADERS_HXX "${dir}/*.hxx")
+  FILE(GLOB dir_LIB_SOURCES_C   "${dir}/*.c")
+  FILE(GLOB dir_LIB_SOURCES_CPP "${dir}/*.cpp")
+  FILE(GLOB dir_LIB_SOURCES_CXX "${dir}/*.cxx")
 
-FILE(GLOB LIB_IO_HEADERS_H   "IO/*.h")
-FILE(GLOB LIB_IO_HEADERS_HPP "IO/*.hpp")
-FILE(GLOB LIB_IO_HEADERS_HXX "IO/*.hxx")
-FILE(GLOB LIB_IO_SOURCES_C   "IO/*.c")
-FILE(GLOB LIB_IO_SOURCES_CPP "IO/*.cpp")
-FILE(GLOB LIB_IO_SOURCES_CXX "IO/*.cxx")
+  SET(LIB_HEADERS_H   "${LIB_HEADERS_H};${dir_LIB_HEADERS_H}")
+  SET(LIB_HEADERS_HPP "${LIB_HEADERS_HPP};${dir_LIB_HEADERS_HPP}")
+  SET(LIB_HEADERS_HXX "${LIB_HEADERS_HXX};${dir_LIB_HEADERS_HXX}")
+  SET(LIB_SOURCES_C   "${LIB_SOURCES_C};${dir_LIB_SOURCES_C}")
+  SET(LIB_SOURCES_CPP "${LIB_SOURCES_CPP};${dir_LIB_SOURCES_CPP}")
+  SET(LIB_SOURCES_CXX "${LIB_SOURCES_CXX};${dir_LIB_SOURCES_CXX}")
 
-FILE(GLOB LIB_Visualization_HEADERS_H   "Visualization/*.h")
-FILE(GLOB LIB_Visualization_HEADERS_HPP "Visualization/*.hpp")
-FILE(GLOB LIB_Visualization_HEADERS_HXX "Visualization/*.hxx")
-FILE(GLOB LIB_Visualization_SOURCES_C   "Visualization/*.c")
-FILE(GLOB LIB_Visualization_SOURCES_CPP "Visualization/*.cpp")
-FILE(GLOB LIB_Visualization_SOURCES_CXX "Visualization/*.cxx")
+  INSTALL(
+    DIRECTORY ${dir}
+    DESTINATION include/cpExtensions
+    FILES_MATCHING PATTERN "*.h"
+    )
+  INSTALL(
+    DIRECTORY ${dir}
+    DESTINATION include/cpExtensions
+    FILES_MATCHING PATTERN "*.hpp"
+    )
+  INSTALL(
+    DIRECTORY ${dir}
+    DESTINATION include/cpExtensions
+    FILES_MATCHING PATTERN "*.hxx"
+    )
+ENDFOREACH(dir)
 
 ## =====================
 ## = Compilation rules =
@@ -49,18 +61,6 @@ ADD_LIBRARY(
   ${LIB_SOURCES_C}
   ${LIB_SOURCES_CPP}
   ${LIB_SOURCES_CXX}
-  ${LIB_DataStructures_SOURCES_C}
-  ${LIB_DataStructures_SOURCES_CPP}
-  ${LIB_DataStructures_SOURCES_CXX}
-  ${LIB_Algorithms_SOURCES_C}
-  ${LIB_Algorithms_SOURCES_CPP}
-  ${LIB_Algorithms_SOURCES_CXX}
-  ${LIB_IO_SOURCES_C}
-  ${LIB_IO_SOURCES_CPP}
-  ${LIB_IO_SOURCES_CXX}
-  ${LIB_Visualization_SOURCES_C}
-  ${LIB_Visualization_SOURCES_CPP}
-  ${LIB_Visualization_SOURCES_CXX}
   )
 GENERATE_EXPORT_HEADER(
   ${LIBRARY_NAME}
@@ -85,31 +85,6 @@ INSTALL(
   LIBRARY DESTINATION lib
   ARCHIVE DESTINATION lib/static
   )
-SET(
-  local_install_dirs
-  Algorithms
-  DataStructures
-  IO
-  Visualization
-  )
-FOREACH(dir ${local_install_dirs})
-  INSTALL(
-    DIRECTORY ${dir}
-    DESTINATION include/cpExtensions
-    FILES_MATCHING PATTERN "*.h"
-    )
-  INSTALL(
-    DIRECTORY ${dir}
-    DESTINATION include/cpExtensions
-    FILES_MATCHING PATTERN "*.hxx"
-    )
-  INSTALL(
-    DIRECTORY ${dir}
-    DESTINATION include/cpExtensions
-    FILES_MATCHING PATTERN "*.hpp"
-    )
-ENDFOREACH(dir)
-
 INSTALL(
   FILES
   ${PROJECT_BINARY_DIR}/lib/cpExtensions/${LIBRARY_NAME}_Export.h
index ab3fee37ca5406985b43cb651b2b7c521002d90c..b784808ede8fbff1b1a0ff37e3402a7018724748 100644 (file)
@@ -402,8 +402,8 @@ WindowLevel( )
       this->WindowLevelCurrentPosition[ 1 ]
       ) / double( size[ 1 ] );
 
-    double w = this->WindowLevelInitial[ 0 ] * ( double( 1 ) + sw );
-    double l = this->WindowLevelInitial[ 1 ] * ( double( 1 ) + sl );
+    double w = this->WindowLevelInitial[ 0 ] + ( sw * 1000.0 );
+    double l = this->WindowLevelInitial[ 1 ] + ( sl * 1000.0 );
     double minw = this->m_MPRActors->GetMinWindow( 0 );
     double maxw = this->m_MPRActors->GetMaxWindow( 0 );
     double minl = this->m_MPRActors->GetMinLevel( 0 );
@@ -414,8 +414,7 @@ WindowLevel( )
     if( l < minl ) l = minl;
     if( maxl < l ) l = maxl;
 
-    this->m_MPRActors->SetWindow( 0, w );
-    this->m_MPRActors->SetLevel( 0, l );
+    this->m_MPRActors->SetWindowLevel( 0, w, l );
     this->Interactor->Render( );
     this->_RenderAssociateInteractors( );
   }
index 52be1f1ddeb099e82990b032f4e002038356c40b..ef55f5463bacf96bb4475edb98d6b1679178ade3 100644 (file)
@@ -22,62 +22,22 @@ New( )
 void cpExtensions::Visualization::ImageSliceActors::
 AddInputConnection( vtkAlgorithmOutput* aout, int axis )
 {
-  unsigned int nImages = this->SliceMappers.size( );
-
   vtkSmartPointer< vtkImageSliceMapper > mapper =
     vtkSmartPointer< vtkImageSliceMapper >::New( );
   this->SliceMappers.push_back( mapper );
   mapper->SetInputConnection( aout );
-  mapper->SetOrientation(
-    ( nImages == 0 )? axis: this->SliceMappers[ 0 ]->GetOrientation( )
-    );
-  mapper->Update( );
-  
-  vtkSmartPointer< vtkImageActor > actor =
-    vtkSmartPointer< vtkImageActor >::New( );
-  this->ImageActors.push_back( actor );
-  actor->SetMapper( mapper );
-  actor->Modified( );
-
-  if( nImages == 0 )
-  {
-    this->AddItem( this->TextActor );
-    this->AddItem( this->PlaneActor );
-
-  } // fi
-  this->AddItem( actor );
-  this->Modified( );
+  this->_ConfigureNewInput( axis );
 }
 
 // -------------------------------------------------------------------------
 void cpExtensions::Visualization::ImageSliceActors::
 AddInputData( vtkImageData* data, int axis )
 {
-  unsigned int nImages = this->SliceMappers.size( );
-
   vtkSmartPointer< vtkImageSliceMapper > mapper =
     vtkSmartPointer< vtkImageSliceMapper >::New( );
   this->SliceMappers.push_back( mapper );
   mapper->SetInputData( data );
-  mapper->SetOrientation(
-    ( nImages == 0 )? axis: this->SliceMappers[ 0 ]->GetOrientation( )
-    );
-  mapper->Update( );
-
-  vtkSmartPointer< vtkImageActor > actor =
-    vtkSmartPointer< vtkImageActor >::New( );
-  this->ImageActors.push_back( actor );
-  actor->SetMapper( mapper );
-  actor->Modified( );
-
-  if( nImages == 0 )
-  {
-    this->AddItem( this->TextActor );
-    this->AddItem( this->PlaneActor );
-
-  } // fi
-  this->AddItem( actor );
-  this->Modified( );
+  this->_ConfigureNewInput( axis );
 }
 
 // -------------------------------------------------------------------------
@@ -190,6 +150,34 @@ GetPlaneActor( ) const
   return( this->PlaneActor );
 }
 
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+SetInterpolate( bool v )
+{
+  if( this->Interpolate != v )
+  {
+    for( unsigned int i = 0; i < this->ImageActors.size( ); ++i )
+      this->ImageActors[ i ]->SetInterpolate( v );
+    this->Interpolate = v;
+    this->Modified( );
+
+  } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+InterpolateOn( )
+{
+  this->SetInterpolate( true );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+InterpolateOff( )
+{
+  this->SetInterpolate( false );
+}
+
 // -------------------------------------------------------------------------
 double* cpExtensions::Visualization::ImageSliceActors::
 GetDisplayBounds( ) const
@@ -204,7 +192,12 @@ GetDisplayBounds( ) const
 void cpExtensions::Visualization::ImageSliceActors::
 GetDisplayBounds( double bounds[ 6 ] ) const
 {
-  if( this->ImageActors.size( ) > 0 )
+  if( this->ImageActors.size( ) == 0 )
+  {
+    bounds[ 0 ] = bounds[ 2 ] = bounds[ 4 ] = double( -1 );
+    bounds[ 1 ] = bounds[ 3 ] = bounds[ 5 ] = double( -1 );
+  }
+  else
     this->ImageActors[ 0 ]->GetDisplayBounds( bounds );
 }
 
@@ -347,7 +340,7 @@ SetSliceNumber( const int& slice )
   this->PlaneSource->Modified( );
   this->PlaneMapper->Modified( );
   this->PlaneActor->Modified( );
-  this->Modified( );
+  this->UpdateText( );
 }
 
 // -------------------------------------------------------------------------
@@ -374,10 +367,35 @@ UpdateText( )
   this->Modified( );
 }
 
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+UpdateText( const double& w, const double& l )
+{
+  if( this->SliceMappers.size( ) > 0 )
+  {
+    char axis;
+    int axId = this->SliceMappers[ 0 ]->GetOrientation( );
+    if     ( axId == 0 ) axis = 'X';
+    else if( axId == 1 ) axis = 'Y';
+    else if( axId == 2 ) axis = 'Z';
+
+    std::sprintf(
+      this->TextBuffer, "Axis: %c (%d) | W/L (%.2f/%.2f)",
+      axis, this->SliceMappers[ 0 ]->GetSliceNumber( ), w, l
+      );
+  }
+  else
+    this->TextBuffer[ 0 ] = '\0';
+  this->TextActor->SetInput( this->TextBuffer );
+  this->TextActor->Modified( );
+  this->Modified( );
+}
+
 // -------------------------------------------------------------------------
 cpExtensions::Visualization::ImageSliceActors::
 ImageSliceActors( )
-  : Superclass( )
+  : Superclass( ),
+    Interpolate( false )
 {
   this->Clear( );
 }
@@ -388,4 +406,39 @@ cpExtensions::Visualization::ImageSliceActors::
 {
 }
 
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+_ConfigureNewInput( int axis )
+{
+  unsigned int nImages = this->ImageActors.size( );
+
+  // Configure mapper
+  vtkImageSliceMapper* mapper = this->SliceMappers[ nImages ];
+  if( nImages == 0 )
+    mapper->SetOrientation( axis );
+  else
+    mapper->SetOrientation( this->SliceMappers[ 0 ]->GetOrientation( ) );
+  mapper->Update( );
+
+  // Create actor
+  vtkSmartPointer< vtkImageActor > actor =
+    vtkSmartPointer< vtkImageActor >::New( );
+  this->ImageActors.push_back( actor );
+  actor->SetMapper( mapper );
+  actor->SetInterpolate( this->Interpolate );
+  actor->Modified( );
+
+  if( nImages == 0 )
+  {
+    this->AddItem( this->TextActor );
+    this->AddItem( this->PlaneActor );
+
+  } // fi
+  this->AddItem( actor );
+
+  if( nImages > 1 )
+    this->SetSliceNumber( this->GetSliceNumber( ) );
+  this->Modified( );
+}
+
 // eof - $RCSfile$
index 0e1fdae463622b857a0c655b4da8ca9ee0919df8..90b9ff018f4ed2d75a0ced687465dd42ad20a9a8 100644 (file)
@@ -50,6 +50,10 @@ namespace cpExtensions
       vtkActor* GetPlaneActor( );
       const vtkActor* GetPlaneActor( ) const;
 
+      void SetInterpolate( bool v );
+      void InterpolateOn( );
+      void InterpolateOff( );
+
       double* GetDisplayBounds( ) const;
       void GetDisplayBounds( double bounds[ 6 ] ) const;
 
@@ -59,11 +63,14 @@ namespace cpExtensions
       int GetSliceNumberMaxValue( ) const;
       void SetSliceNumber( const int& slice );
       void UpdateText( );
+      void UpdateText( const double& w, const double& l );
 
     protected:
       ImageSliceActors( );
       virtual ~ImageSliceActors( );
 
+      void _ConfigureNewInput( int axis );
+
     private:
       // Purposely not implemented
       ImageSliceActors( const Self& );
@@ -73,6 +80,7 @@ namespace cpExtensions
       // Multiple actors
       std::vector< vtkSmartPointer< vtkImageSliceMapper > > SliceMappers;
       std::vector< vtkSmartPointer< vtkImageActor > >       ImageActors;
+      bool Interpolate;
 
       // Unique objects
       vtkSmartPointer< vtkPolyData >       PlaneSource;
index 90fdb7d83c7f68842d4d356191b61bdeedbe03c0..54e689afab091f6f9317c2f3e708c223ce8f3687 100644 (file)
@@ -1,8 +1,11 @@
 #include <cpExtensions/Visualization/MPRActors.h>
 
+#include <cmath>
+
 #include <vtkAlgorithmOutput.h>
 #include <vtkImageData.h>
 #include <vtkInformation.h>
+#include <vtkLookupTable.h>
 #include <vtkOutlineSource.h>
 #include <vtkProperty.h>
 #include <vtkRenderer.h>
@@ -40,6 +43,7 @@ AddInputConnection( vtkAlgorithmOutput* aout )
     this->ImageMaps[ 0 ]->SetInputConnection( aout );
     this->SetLookupTableToWindowLevel( 0 );
     this->_Update( 0 );
+    this->ResetWindowLevel( 0 );
     return( 0 );
   }
   else
@@ -64,7 +68,9 @@ AddInputConnection( vtkAlgorithmOutput* aout )
         vtkSmartPointer< vtkImageMapToColors >::New( )
         );
       this->ImageMaps[ N ]->SetInputConnection( aout );
-      this->SetLookupTableToWindowLevel( N );
+      this->SetLookupTableToColor(
+        N, double( 1 ), double( 0 ), double( 0 )
+        );
       this->_Update( N );
       return( N );
     }
@@ -87,6 +93,7 @@ AddInputData( vtkImageData* image )
     this->ImageMaps[ 0 ]->SetInputData( image );
     this->SetLookupTableToWindowLevel( 0 );
     this->_Update( 0 );
+    this->ResetWindowLevel( 0 );
     return( 0 );
   }
   else
@@ -107,7 +114,9 @@ AddInputData( vtkImageData* image )
         vtkSmartPointer< vtkImageMapToColors >::New( )
         );
       this->ImageMaps[ N ]->SetInputData( image );
-      this->SetLookupTableToWindowLevel( N );
+      this->SetLookupTableToColor(
+        N, double( 1 ), double( 0 ), double( 0 )
+        );
       this->_Update( N );
       return( N );
     }
@@ -196,6 +205,15 @@ PopDataFrom(
     w->RemoveActor( this->ImageOutlineActor );
 }
 
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+LinkInteractors( )
+{
+  this->_Update( 0 );
+  this->_Update( 1 );
+  this->_Update( 2 );
+}
+
 // -------------------------------------------------------------------------
 void cpExtensions::Visualization::MPRActors::
 SetLookupTable( unsigned int i, vtkScalarsToColors* lut )
@@ -345,6 +363,27 @@ SetLevel( unsigned int i, const double& l )
   } // fi
 }
 
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+SetWindowLevel( unsigned int i, const double& w, const double& l )
+{
+  vtkWindowLevelLookupTable* lut =
+    dynamic_cast< vtkWindowLevelLookupTable* >( this->GetLookupTable( i ) );
+  if( lut != NULL )
+  {
+    lut->SetWindow( w );
+    lut->SetLevel( l );
+    lut->Build( );
+    this->ImageMaps[ i ]->Modified( );
+
+    for( unsigned int j = 0; j < 3; ++j )
+      this->Slices[ 0 ][ j ]->UpdateText( w, l );
+
+    this->Modified( );
+
+  } // fi
+}
+
 // -------------------------------------------------------------------------
 void cpExtensions::Visualization::MPRActors::
 ResetWindowLevel( unsigned int i )
@@ -357,6 +396,8 @@ ResetWindowLevel( unsigned int i )
     double r[ 2 ];
     image->GetScalarRange( r );
     lut->SetTableRange( r );
+    lut->SetWindow( r[ 1 ] - r[ 0 ] );
+    lut->SetLevel( ( r[ 1 ] + r[ 0 ] ) / double( 2 ) );
     lut->Build( );
     this->ImageMaps[ i ]->Modified( );
     this->Modified( );
@@ -364,6 +405,64 @@ ResetWindowLevel( unsigned int i )
   } // fi
 }
 
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRActors::
+SetLookupTableToColor(
+  unsigned int i, const double& r, const double& g, const double& b
+  )
+{
+  static const double _0 = double( 0 );
+  static const double _1 = double( 1 );
+  static const double _2 = double( 2 );
+  static const double _4 = double( 4 );
+  static const double _6 = double( 6 );
+  static const double _OPACITY = double( 0.6 );
+
+  // Check if the input has been configured
+  vtkImageData* image = this->_Image( i );
+  if( image == NULL )
+    return;
+
+  double range[ 2 ];
+  image->GetScalarRange( range );
+
+  // Get HSV from display color
+  double cmax = ( r > g )? r: g; cmax = ( b > cmax )? b: cmax;
+  double cmin = ( r < g )? r: g; cmin = ( b < cmin )? b: cmin;
+  double d = cmax - cmin;
+
+  double saturation = ( std::fabs( cmax ) > _0 )? d / cmax: _0;
+  double value = cmax;
+  double hue = _0;
+  if( d > _0 )
+  {
+    if( r == cmax )
+      hue = std::fmod( ( g - b ) / d, _6 );
+    else if( g == cmax )
+      hue = ( ( b - r ) / d ) + _2;
+    else if( b == cmax )
+      hue = ( ( r - g ) / d ) + _4;
+    hue *= _1 / _6;
+    
+  } // fi
+
+  // Define new lookup table
+  vtkSmartPointer< vtkLookupTable > lut =
+    vtkSmartPointer< vtkLookupTable >::New( );
+  lut->SetScaleToLinear( );
+  lut->SetAboveRangeColor( _0, _0, _0, _0 );
+  lut->SetBelowRangeColor( _0, _0, _0, _0 );
+  lut->SetNanColor( _0, _0, _0, _0 );
+  lut->SetTableRange( range[ 0 ], range[ 1 ] );
+  lut->SetAlphaRange( _0, _OPACITY );
+  lut->SetHueRange( _0, hue );
+  lut->SetSaturationRange( _0, saturation );
+  lut->SetValueRange( _0, value );
+  lut->Build( );
+
+  this->SetLookupTable( i, lut );
+}
+
 // -------------------------------------------------------------------------
 int cpExtensions::Visualization::MPRActors::
 GetSliceNumberMinValue( const int& axis ) const
@@ -464,7 +563,9 @@ _Image( unsigned int i ) const
     vtkAlgorithm* algo = this->ImageMaps[ i ]->GetInputAlgorithm( );
     vtkInformation* info = algo->GetOutputInformation( 0 );
     return(
-      vtkImageData::SafeDownCast( info->Get( vtkDataObject::DATA_OBJECT( ) ) )
+      vtkImageData::SafeDownCast(
+        info->Get( vtkDataObject::DATA_OBJECT( ) )
+        )
       );
   }
   else
@@ -490,6 +591,16 @@ _Update( unsigned int i )
         );
       this->Slices[ j ][ k ]->UpdateText( );
 
+      // Add all of slice's props
+      this->Slices[ j ][ k ]->InitTraversal( );
+      vtkProp* prop = this->Slices[ j ][ k ]->GetNextProp( );
+      while( prop != NULL )
+      {
+        this->AddItem( prop );
+        prop = this->Slices[ j ][ k ]->GetNextProp( );
+
+      } // elihw
+
     } // rof
 
   } // rof
index 0aafebef6f5ab227410ac9b594e32dfdda72edde..d0de6e01df60b5559ec60a77c7cfc21807ee30a2 100644 (file)
@@ -41,11 +41,6 @@ namespace cpExtensions
       int AddInputConnection( vtkAlgorithmOutput* aout );
       int AddInputData( vtkImageData* image );
 
-      /*
-        void SetInputConnection( vtkAlgorithmOutput* aout );
-        void SetInputData( vtkImageData* image );
-      */
-
       void PushDataInto(
         vtkRenderer* x,
         vtkRenderer* y,
@@ -58,12 +53,7 @@ namespace cpExtensions
         vtkRenderer* z,
         vtkRenderer* w
         );
-      void LinkInteractors( )
-        {
-          this->_Update( 0 );
-          this->_Update( 1 );
-          this->_Update( 2 );
-        }
+      void LinkInteractors( );
 
       // Lookup table methods
       void SetLookupTable( unsigned int i, vtkScalarsToColors* lut );
@@ -79,8 +69,17 @@ namespace cpExtensions
       double GetLevel( unsigned int i ) const;
       void SetWindow( unsigned int i, const double& w );
       void SetLevel( unsigned int i, const double& l );
+      void SetWindowLevel( unsigned int i, const double& w, const double& l );
       void ResetWindowLevel( unsigned int i );
 
+      // Color lookup table
+      void SetLookupTableToColor(
+        unsigned int i,
+        const double& r = double( 1 ),
+        const double& g = double( 0 ),
+        const double& b = double( 0 )
+        );
+
       // Slice access
       int GetSliceNumberMinValue( const int& axis ) const;
       int GetSliceNumberMaxValue( const int& axis ) const;
index aaadf31b1b61ede9daff48099bb27613b232f87f..914c46de29d47490ec867cd2a4e527f65c4ef483 100644 (file)
@@ -1,5 +1,9 @@
 #include <cpExtensions/Visualization/MPRObjects.h>
 
+#include <cmath>
+#include <vtkImageData.h>
+#include <vtkLookupTable.h>
+
 // -------------------------------------------------------------------------
 cpExtensions::Visualization::MPRObjects*
 cpExtensions::Visualization::MPRObjects::
@@ -54,20 +58,33 @@ SetImage( vtkImageData* image )
     this->m_Renderers[ 3 ]
     );
 
-  // Correct cameras positions
-  /* TODO
-     vtkCamera* zCam = this->m_Renderers[ 2 ]->GetActiveCamera( );
-     zCam->SetViewUp( 0, -1, 0 );
-     zCam->SetPosition( 0, 0, -1 );
-     zCam->SetFocalPoint( 0, 0, 0 );
-  */
-
   // First rendering
   this->m_MPRActors->ResetSlices( );
   this->ResetCameras( );
   this->RenderAll( );
 }
 
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::MPRObjects::
+AddAuxiliaryImage( vtkImageData* image )
+{
+  // Try to add new image
+  int id = this->m_MPRActors->AddInputData( image );
+  if( id < 0 )
+    return;
+
+  // Push everything on renderers
+  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 62%
rename from lib/cpPlugins/Plugins/BinaryThresholdImageFilter.cxx
rename to lib/cpPlugins/Plugins/BasicFilters/BinaryThresholdImageFilter.cxx
index 65195e200d0372c84fcee34c3e3b807dbcefe71d..ea7c965184579ad6a01033ce59d1f29d36c2dbac 100644 (file)
@@ -1,50 +1,41 @@
-#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 );
   this->_MakeOutput< cpPlugins::Interface::Image >( 0 );
 
   using namespace cpPlugins::Interface;
-  this->m_DefaultParameters.Configure(Parameters::Real, "LowerThresholdValue");
-  this->m_DefaultParameters.Configure(Parameters::Real, "UpperThresholdValue");
-  this->m_DefaultParameters.Configure(Parameters::Real, "InsideValue");
-  this->m_DefaultParameters.Configure(Parameters::Real, "OutsideValue");
+  this->m_DefaultParameters.Configure( Parameters::Real, "LowerThresholdValue" );
+  this->m_DefaultParameters.Configure( Parameters::Real, "UpperThresholdValue" );
+  this->m_DefaultParameters.Configure( Parameters::Real, "InsideValue" );
+  this->m_DefaultParameters.Configure( Parameters::Real, "OutsideValue" );
 
-  this->m_DefaultParameters.SetValueAsReal("LowerThresholdValue", 100);
-  this->m_DefaultParameters.SetValueAsReal("UpperThresholdValue",500);
-  this->m_DefaultParameters.SetValueAsReal("InsideValue", 255);
-  this->m_DefaultParameters.SetValueAsReal("OutsideValue", 0);
+  this->m_DefaultParameters.SetValueAsReal( "LowerThresholdValue", 100 );
+  this->m_DefaultParameters.SetValueAsReal( "UpperThresholdValue", 500 );
+  this->m_DefaultParameters.SetValueAsReal( "InsideValue", 255 );
+  this->m_DefaultParameters.SetValueAsReal( "OutsideValue", 0 );
 
-  //this->m_DefaultParameters.Configure(
-
-  //  Parameters::Uint, "NumberOfHistogramBins"
-  //  );
-  //this->m_DefaultParameters.Configure( Parameters::Real, "InsideValue" );
-  //this->m_DefaultParameters.Configure( Parameters::Real, "OutsideValue" );
-  //this->m_DefaultParameters.SetValueAsUint( "NumberOfHistogramBins", 100 );
-  //this->m_DefaultParameters.SetValueAsReal( "InsideValue", 255 );
-  //this->m_DefaultParameters.SetValueAsReal( "OutsideValue", 0 );
   this->m_Parameters = this->m_DefaultParameters;
 }
 
 // -------------------------------------------------------------------------
-cpPlugins::Plugins::BinaryThresholdImageFilter::
+cpPlugins::BasicFilters::BinaryThresholdImageFilter::
 ~BinaryThresholdImageFilter( )
 {
 }
 
 // -------------------------------------------------------------------------
-std::string cpPlugins::Plugins::BinaryThresholdImageFilter::
+std::string cpPlugins::BasicFilters::BinaryThresholdImageFilter::
 _GenerateData( )
 {
   cpPlugins::Interface::Image* image =
@@ -69,7 +60,7 @@ _GenerateData( )
 
 // -------------------------------------------------------------------------
 template< class I >
-std::string cpPlugins::Plugins::BinaryThresholdImageFilter::
+std::string cpPlugins::BasicFilters::BinaryThresholdImageFilter::
 _DemangleOutput( itk::DataObject* image )
 {
   return(
@@ -81,17 +72,18 @@ _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;
+  typedef typename I::PixelType _IP;
   typedef typename O::PixelType _OP;
 
   // Get parameters
   //unsigned int bins =
   //  this->m_Parameters.GetValueAsUint( "NumberOfHistogramBins" );
-  _OP lower_val = _OP(this->m_Parameters.GetValueAsReal("LowerValue"));
-  _OP upper_val = _OP(this->m_Parameters.GetValueAsReal("UpperValue"));
+  _IP lower_val = _IP( this->m_Parameters.GetValueAsReal( "LowerValue" ) );
+  _IP upper_val = _IP( this->m_Parameters.GetValueAsReal( "UpperValue" ) );
   _OP in_val = _OP( this->m_Parameters.GetValueAsReal( "InsideValue" ) );
   _OP out_val = _OP( this->m_Parameters.GetValueAsReal( "OutsideValue" ) );
 
@@ -104,9 +96,8 @@ _RealGD( itk::DataObject* image )
 
   } // fi
   filter->SetInput( dynamic_cast< I* >( image ) );
-  //filter->SetNumberOfHistogramBins( bins );
-  filter->SetLowerThreshold(lower_val);
-  filter->SetUpperThreshold(upper_val);
+  filter->SetLowerThreshold( lower_val );
+  filter->SetUpperThreshold( upper_val );
   filter->SetInsideValue( in_val );
   filter->SetOutsideValue( out_val );
   filter->Update( );
similarity index 79%
rename from lib/cpPlugins/Plugins/BinaryThresholdImageFilter.h
rename to lib/cpPlugins/Plugins/BasicFilters/BinaryThresholdImageFilter.h
index d108fb233b2756a7feb3f478bcd3cc56b7182779..74a970f49d56100a4101c14d7dae37f0773329cf 100644 (file)
@@ -1,27 +1,30 @@
 #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:
-      typedef BinaryThresholdImageFilter                 Self;
+      typedef BinaryThresholdImageFilter               Self;
       typedef cpPlugins::Interface::ImageToImageFilter Superclass;
       typedef itk::SmartPointer< Self >                Pointer;
       typedef itk::SmartPointer< const Self >          ConstPointer;
 
     public:
       itkNewMacro( Self );
-      itkTypeMacro( BinaryThresholdImageFilter, cpPluginsInterfaceImageToImageFilter );
+      itkTypeMacro(
+        BinaryThresholdImageFilter,
+        cpPluginsInterfaceImageToImageFilter
+        );
 
     protected:
       BinaryThresholdImageFilter( );
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 78%
rename from lib/cpPlugins/Plugins/MedianImageFilter.cxx
rename to lib/cpPlugins/Plugins/BasicFilters/MedianImageFilter.cxx
index e2079677270de494a6f38a9a230f44f43dd681ba..d806506352ac0a058055739e00b5ac84cc2d9ca4 100644 (file)
@@ -1,35 +1,35 @@
-#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 );
   this->_MakeOutput< cpPlugins::Interface::Image >( 0 );
 
   using namespace cpPlugins::Interface;
-  this->m_DefaultParameters.Configure(Parameters::Real, "Radius");
-  this->m_DefaultParameters.SetValueAsReal("Radius", 3);
+  this->m_DefaultParameters.Configure( Parameters::Uint, "Radius" );
+
+  this->m_DefaultParameters.SetValueAsUint( "Radius", 3 );
+
   this->m_Parameters = this->m_DefaultParameters;
 }
 
 // -------------------------------------------------------------------------
-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,16 +66,15 @@ _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;
-  typedef typename O::PixelType _OP;
+  typedef typename _F::RadiusType _RT;
 
   // Get parameters
-
-  _OP rad_val = _OP(this->m_Parameters.GetValueAsReal("Radius"));
-  
+  _RT rad_val;
+  rad_val.Fill( this->m_Parameters.GetValueAsUint( "Radius" ) );
 
   // Configure filter
   _F* filter = dynamic_cast< _F* >( this->m_RealProcessObject.GetPointer( ) );
@@ -86,9 +85,8 @@ _RealGD( itk::DataObject* image )
 
   } // fi
   filter->SetInput( dynamic_cast< I* >( image ) );
-  
-  filter->SetRadius(rad_val);
+  filter->SetRadius( rad_val );
+
   filter->Update( );
 
   // Connect output
similarity index 79%
rename from lib/cpPlugins/Plugins/MedianImageFilter.h
rename to lib/cpPlugins/Plugins/BasicFilters/MedianImageFilter.h
index 3ee8db491db356c0ccfc54201a546acc88ae0385..8b3cbf7538ccf872b1af90233d1de71924581d06 100644 (file)
@@ -1,27 +1,30 @@
 #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:
-      typedef MedianImageFilter                 Self;
+      typedef MedianImageFilter                        Self;
       typedef cpPlugins::Interface::ImageToImageFilter Superclass;
       typedef itk::SmartPointer< Self >                Pointer;
       typedef itk::SmartPointer< const Self >          ConstPointer;
 
     public:
       itkNewMacro( Self );
-      itkTypeMacro( MedianImageFilter, cpPluginsInterfaceImageToImageFilter );
+      itkTypeMacro(
+        MedianImageFilter,
+        cpPluginsInterfaceImageToImageFilter
+        );
 
     protected:
       MedianImageFilter( );
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..6fe1263cf23ade46b94ff02cf84ef6e6e7d02d09 100644 (file)
@@ -1,49 +1,6 @@
-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
-  )
-
-## ========================
-## -- Installation rules --
-## ========================
-
-INSTALL(
-  TARGETS ${LIBRARY_NAME}
-  RUNTIME DESTINATION bin
-  LIBRARY DESTINATION lib
-  ARCHIVE DESTINATION lib/static
+SUBDIRS(
+  IO
+  BasicFilters
   )
 
 ## 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$
diff --git a/lib/cpPlugins/Plugins/SecondRankDiffusionTensorToPolyData.cxx b/lib/cpPlugins/Plugins/SecondRankDiffusionTensorToPolyData.cxx
deleted file mode 100644 (file)
index 62a5907..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#include <cpPlugins/Plugins/SecondRankDiffusionTensorToPolyData.h>
-#include <cpPlugins/Interface/Image.h>
-#include <cpPlugins/Interface/Mesh.h>
-
-#include <cpExtensions/Algorithms/SecondRankDiffusionTensorToPolyData.h>
-#include <itkSymmetricSecondRankTensor.h>
-
-// -------------------------------------------------------------------------
-cpPlugins::Plugins::SecondRankDiffusionTensorToPolyData::
-SecondRankDiffusionTensorToPolyData( )
-  : Superclass( ),
-    m_Algorithm( NULL )
-{
-  this->m_ClassName = "cpPlugins::SecondRankDiffusionTensorToPolyData";
-  this->m_ClassCategory = "ImageToMeshFilter";
-
-  this->SetNumberOfInputs( 1 );
-  this->SetNumberOfOutputs( 1 );
-  this->_MakeOutput< cpPlugins::Interface::Mesh >( 0 );
-
-  using namespace cpPlugins::Interface;
-  this->m_Parameters = this->m_DefaultParameters;
-}
-
-// -------------------------------------------------------------------------
-cpPlugins::Plugins::SecondRankDiffusionTensorToPolyData::
-~SecondRankDiffusionTensorToPolyData( )
-{
-  if( this->m_Algorithm != NULL )
-    this->m_Algorithm->Delete( );
-}
-
-// -------------------------------------------------------------------------
-std::string cpPlugins::Plugins::SecondRankDiffusionTensorToPolyData::
-_GenerateData( )
-{
-  // Get input
-  cpPlugins::Interface::Image* image =
-    this->GetInput< cpPlugins::Interface::Image >( 0 );
-  if( image == NULL )
-    return( "SecondRankDiffusionTensorToPolyData: Input data is not a valid image." );
-
-  itk::DataObject* itk_image = NULL;
-  std::string r = "";
-  cpPlugins_ImageArray_Input_Demangle( itk::SymmetricSecondRankTensor, float, 3, 3, image, itk_image, r, _RealGD );
-  else cpPlugins_ImageArray_Input_Demangle( itk::SymmetricSecondRankTensor, double, 3, 3, image, itk_image, r, _RealGD );
-  else
-    r = "SecondRankDiffusionTensorToPolyData: Input does not have a DiffusionTensor3D.";
-  return( r );
-}
-
-// -------------------------------------------------------------------------
-template< class I >
-std::string cpPlugins::Plugins::SecondRankDiffusionTensorToPolyData::
-_RealGD( itk::DataObject* image )
-{
-  typedef cpExtensions::Algorithms::SecondRankDiffusionTensorToPolyData< I > _F;
-
-  // Configure filter
-  _F* f = NULL;
-  if( this->m_Algorithm == NULL )
-  {
-    f = _F::New( );
-    this->m_Algorithm = f;
-
-  } // fi
-  f->SetInputData( dynamic_cast< I* >( image ) );
-  this->m_Algorithm->Update( );
-
-  // Connect output
-  cpPlugins::Interface::Mesh* out =
-    this->GetOutput< cpPlugins::Interface::Mesh >( 0 );
-  if( out != NULL )
-  {
-    out->SetVTKMesh( this->m_Algorithm->GetOutput( ) );
-    return( "" );
-  }
-  else
-    return( "OtsuThresholdImageFilter: output not correctly created." );
-}
-
-// eof - $RCSfile$
diff --git a/lib/cpPlugins/Plugins/SecondRankDiffusionTensorToPolyData.h b/lib/cpPlugins/Plugins/SecondRankDiffusionTensorToPolyData.h
deleted file mode 100644 (file)
index ff03716..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#ifndef __CPPLUGINS__PLUGINS__SECONDRANKDIFFUSIONTENSORTOPOLYDATA__H__
-#define __CPPLUGINS__PLUGINS__SECONDRANKDIFFUSIONTENSORTOPOLYDATA__H__
-
-#include <cpPlugins/Plugins/cpPlugins_Export.h>
-#include <cpPlugins/Interface/BaseProcessObjects.h>
-
-class vtkPolyDataAlgorithm;
-
-namespace cpPlugins
-{
-  namespace Plugins
-  {
-    /**
-     */
-    class cpPlugins_EXPORT SecondRankDiffusionTensorToPolyData
-      : public cpPlugins::Interface::ImageToMeshFilter
-    {
-    public:
-      typedef SecondRankDiffusionTensorToPolyData     Self;
-      typedef cpPlugins::Interface::ImageToMeshFilter Superclass;
-      typedef itk::SmartPointer< Self >               Pointer;
-      typedef itk::SmartPointer< const Self >         ConstPointer;
-
-    public:
-      itkNewMacro( Self );
-      itkTypeMacro( SecondRankDiffusionTensorToPolyData, cpPluginsInterfaceImageToMeshFilter );
-
-    protected:
-      SecondRankDiffusionTensorToPolyData( );
-      virtual ~SecondRankDiffusionTensorToPolyData( );
-
-      virtual std::string _GenerateData( );
-
-      template< class I >
-        inline std::string _RealGD( itk::DataObject* image );
-
-    private:
-      // Purposely not implemented
-      SecondRankDiffusionTensorToPolyData( const Self& );
-      Self& operator=( const Self& );
-
-    protected:
-      vtkPolyDataAlgorithm* m_Algorithm;
-    };
-
-    // ---------------------------------------------------------------------
-    CPPLUGINS_INHERIT_PROVIDER( SecondRankDiffusionTensorToPolyData );
-
-  } // ecapseman
-
-} // ecapseman
-
-#endif // __CPPLUGINS__PLUGINS__SECONDRANKDIFFUSIONTENSORTOPOLYDATA__H__
-
-// eof - $RCSfile$