]> Creatis software - cpPlugins.git/commitdiff
...
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Fri, 28 Oct 2016 02:27:54 +0000 (21:27 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Fri, 28 Oct 2016 02:27:54 +0000 (21:27 -0500)
49 files changed:
CMakeLists.txt
appli/CMakeLists.txt
appli/PipelineEditor/CMakeLists.txt
appli/bash/Config.h.in
cmake/Functions.cmake
cmake/Options.cmake
lib/Instances/BaseObjects.i
lib/Instances/ImageFiltersBases.i
lib/Instances/ImageIterators.i
lib/Instances/Meshes.i
lib/Instances/SimpleImages.i
lib/cpBaseQtApplication/Block.cxx
lib/cpBaseQtApplication/Block.h
lib/cpBaseQtApplication/Canvas.cxx
lib/cpBaseQtApplication/Connection.cxx
lib/cpBaseQtApplication/Editor.cxx
lib/cpBaseQtApplication/Port.cxx
lib/cpBaseQtApplication/Port.h
lib/cpPlugins/BaseObjects/Port.cxx
lib/cpPlugins/BaseObjects/ProcessObject.cxx
lib/cpPlugins/BaseObjects/ProcessObject.h
lib/cpPlugins/DataObjects/BoundingBox.cxx
lib/cpPlugins/DataObjects/Image.d
lib/cpPlugins/DataObjects/Mesh.cxx
lib/cpPlugins/DataObjects/Mesh.d
lib/cpPlugins/DataObjects/Mesh.h
lib/cpPlugins/DataObjects/Mesh.hxx [deleted file]
lib/cpPlugins/Interface/Workspace.cxx
lib/cpPlugins/Interface/WorkspaceIO.cxx
plugins/CMakeLists.txt
plugins/GenericFilters/JoinBoundingBoxes.cxx
plugins/GenericFilters/JoinBoundingBoxes.h
plugins/IO/IO.i
plugins/IO/ImageReader.cxx
plugins/IO/ImageReader.h
plugins/IO/ImageReaderQDialog.h
plugins/IO/ImageWriter.cxx
plugins/IO/ImageWriter.h
plugins/IO/ImageWriterQDialog.h
plugins/IO/MeshWriter.cxx
plugins/IO/MeshWriter.h
plugins/ImageDistanceMaps/ImageDistanceMaps.i [new file with mode: 0644]
plugins/ImageDistanceMaps/SignedMaurerDistanceMapImageFilter.cxx
plugins/ImageDistanceMaps/SignedMaurerDistanceMapImageFilter.h
plugins/ImageMeshFilters/MarchingCubes.cxx
plugins/ImageMeshFilters/MarchingCubes.h
plugins/ImageMeshFilters/RasterMeshFilter.h
plugins/ImageSources/RandomImageSource.cxx
plugins/MeshFilters/AppendMeshesFilter.cxx

index 2e757da4499db438229994f77157fcf4a5704c10..d1dc9edefcf3cd2508043fa157506d017e699e24 100644 (file)
@@ -70,7 +70,6 @@ INCLUDE(cmake/Functions.cmake)
 ## == Build different parts ==
 ## ===========================
 
-SUBDIRS(appli lib plugins)
-#SUBDIRS(appli cmake lib plugins)
+SUBDIRS(appli cmake lib plugins)
 
 ## eof - $RCSfile$
index 46ade1ef8f6fa055295283b6101bb8aea5a7c060..cc05c08e9968b6a8639a5ad5d8739cd89b781df5 100644 (file)
@@ -1,7 +1,7 @@
 SUBDIRS(
   bash
   examples
-  PipelineEditor
+  PipelineEditor
   )
 
 ## eof - $RCSfile$
index 29debcf1b00c187f4e9de239674b4d9988eb1e8f..0febd9740f474aa3db602c743b2274bac3aa4ae9 100644 (file)
@@ -1,8 +1,15 @@
 IF(Qt4_FOUND)
-  AppFromDir(_app_name ${CMAKE_CURRENT_SOURCE_DIR})
-  IF(_app_name)
-    TARGET_LINK_LIBRARIES(${_app_name} ${cpBaseQtApplication_LIB} ${cpPlugins_Paths_LIB})
-  ENDIF(_app_name)
+  INCLUDE_DIRECTORIES(
+    ${PROJECT_SOURCE_DIR}
+    ${PROJECT_BINARY_DIR}
+    ${PROJECT_SOURCE_DIR}/lib
+    ${PROJECT_BINARY_DIR}/lib
+    )
+  CompileAppFromDir(PipelineEditor ${CMAKE_CURRENT_SOURCE_DIR})
+  TARGET_LINK_LIBRARIES(
+    PipelineEditor
+    cpBaseQtApplication
+    )
 ENDIF(Qt4_FOUND)
 
 ## eof - $RCSfile$
index f8917947a2e10a41bffd85d9614eeb6274c97edd..953661b2238f24507c35357cc07204bc6f2161f4 100644 (file)
@@ -13,6 +13,7 @@
 #include <string>
 
 // -------------------------------------------------------------------------
+#define cpPlugins_CONFIG_BOOLEAN_TYPES      "@cpPlugins_CONFIG_BOOLEAN_TYPES@"
 #define cpPlugins_CONFIG_INTEGER_TYPES      "@cpPlugins_CONFIG_INTEGER_TYPES@"
 #define cpPlugins_CONFIG_REAL_TYPES         "@cpPlugins_CONFIG_REAL_TYPES@"
 #define cpPlugins_CONFIG_PROCESS_DIMENSIONS "@cpPlugins_CONFIG_PROCESS_DIMENSIONS@"
@@ -131,6 +132,10 @@ namespace cpPlugins_bash
   // -----------------------------------------------------------------------
   inline void LoadDefinitions( TCommands& commands )
   {
+    commands[ "define" ].push_back(
+      std::string( "bool_types=" ) +
+      std::string( cpPlugins_CONFIG_BOOLEAN_TYPES )
+      );
     commands[ "define" ].push_back(
       std::string( "int_types=" ) +
       std::string( cpPlugins_CONFIG_INTEGER_TYPES )
@@ -163,11 +168,14 @@ namespace cpPlugins_bash
       std::string( "matrices=" ) +
       std::string( cpPlugins_CONFIG_MATRICES )
       );
+    if( std::string( cpPlugins_CONFIG_INTEGER_TYPES ) != "" )
+      commands[ "define" ].push_back(
+        std::string( "uint_types=unsigned #int_types#" )
+        );
     commands[ "define" ].push_back(
-      std::string( "uint_types=unsigned #int_types#" )
-      );
-    commands[ "define" ].push_back(
-      std::string( "scalar_pixels=#int_types#;#uint_types#;#real_types#" )
+      std::string(
+        "scalar_pixels=#bool_types#;#int_types#;#uint_types#;#real_types#"
+        )
       );
   }
 
index 4da395c6ad91dfb57a8adb4df2d52c2910076fca..01bd59873e40b33e8315640e78d3862f5398e03d 100644 (file)
@@ -59,13 +59,18 @@ ENDFUNCTION()
 
 ## -------------------------------------------------------------------------
 FUNCTION(
-  CreateLib
-  lib_name
-  lib_type
+  PrepareSourceFiles
+  out_sources_list
+  out_headers_list
+  out_headers_paths
   )
+SET(_config_extensions .c.in .cpp.in .cxx.in .h.in .hpp.in .hxx.in .ui.in)
+SET(_sources_extensions .c .cpp .cxx)
+SET(_headers_extensions .h .hpp .hxx)
+SET(_qt_ui_extensions .ui)
+SET(_demangler_extensions .d)
 
 ## -- Configure inputs
-SET(_config_extensions .c.in .cpp.in .cxx.in .h.in .hpp.in .hxx.in .ui.in)
 SET(_all_files)
 FOREACH(_file ${ARGN})
   GET_FILENAME_COMPONENT(_ext ${_file} EXT)
@@ -89,10 +94,6 @@ FOREACH(_file ${ARGN})
 ENDFOREACH(_file)
 
 ## -- Separate files
-SET(_sources_extensions .c .cpp .cxx)
-SET(_headers_extensions .h .hpp .hxx)
-SET(_qt_ui_extensions .ui)
-SET(_demangler_extensions .d)
 SET(_srcs)
 SET(_hdrs)
 SET(_qts)
@@ -164,8 +165,22 @@ FOREACH(_hdr ${_hdrs})
     LIST(APPEND _hdrs_paths ${_path})
   ENDIF(${_path_idx} EQUAL -1)
 ENDFOREACH(_hdr)
+
+SET(${out_sources_list} ${_srcs} PARENT_SCOPE)
+SET(${out_headers_list} ${_hdrs} PARENT_SCOPE)
+SET(${out_headers_paths} ${_hdrs_paths} PARENT_SCOPE)
+
+ENDFUNCTION()
+
+## -------------------------------------------------------------------------
+FUNCTION(
+  CreateLib
+  lib_name
+  lib_type
+  )
+PrepareSourceFiles(_srcs _hdrs _paths ${ARGN})
 INCLUDE_DIRECTORIES(
-  ${_hdrs_paths}
+  ${_paths}
   ${CMAKE_CURRENT_SOURCE_DIR}
   ${CMAKE_CURRENT_BINARY_DIR}
   )
@@ -179,7 +194,6 @@ IF(_srcs)
     STATIC_DEFINE ${lib_name}_BUILT_AS_STATIC
     )
 ENDIF(_srcs)
-
 ENDFUNCTION()
 
 ## -------------------------------------------------------------------------
@@ -296,4 +310,28 @@ CreateLib(${lib_name} SHARED ${_files})
 
 ENDFUNCTION()
 
+## -------------------------------------------------------------------------
+FUNCTION(
+  CompileAppFromDir
+  app_name
+  app_dir
+  )
+FILE(GLOB_RECURSE _files "${app_dir}/*")
+PrepareSourceFiles(_srcs _hdrs _paths ${_files} ${ARGN})
+INCLUDE_DIRECTORIES(
+  ${_paths}
+  ${CMAKE_CURRENT_SOURCE_DIR}
+  ${CMAKE_CURRENT_BINARY_DIR}
+  )
+IF(_srcs)
+  SET(_app_os_target)
+  IF(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+    SET(_app_os_target WIN32)
+  ELSEIF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
+    SET(_app_os_target MACOSX_BUNDLE)
+  ENDIF(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+  ADD_EXECUTABLE(${app_name} ${_app_os_target} ${_srcs} ${_hdrs})
+ENDIF(_srcs)
+ENDFUNCTION()
+
 ## eof - $RCSfile$
index edd812663cbc30231a902277c3d2a46a5c879088..c745a7be9b85576aad21a62d7d5eb9e1f539a90e 100644 (file)
@@ -3,6 +3,7 @@
 ## ===============================
 
 SET(cpPlugins_CONFIG_NUMBER_OF_FILES "10" CACHE STRING "Number of compiled files.")
+SET(cpPlugins_CONFIG_BOOLEAN_TYPES "bool" CACHE STRING "Accepted boolean types.")
 SET(cpPlugins_CONFIG_INTEGER_TYPES "char;short;int;long" CACHE STRING "Accepted integer types.")
 SET(cpPlugins_CONFIG_REAL_TYPES "float;double" CACHE STRING "Accepted real types.")
 SET(cpPlugins_CONFIG_PROCESS_DIMENSIONS "1;2;3;4" CACHE STRING "Accepted processing dimensions.")
@@ -14,6 +15,7 @@ SET(cpPlugins_CONFIG_MATRICES "Matrix" CACHE STRING "Accepted matrices.")
 
 SET(
   _all_configs
+  cpPlugins_CONFIG_BOOLEAN_TYPES
   cpPlugins_CONFIG_INTEGER_TYPES
   cpPlugins_CONFIG_REAL_TYPES
   cpPlugins_CONFIG_PROCESS_DIMENSIONS
index 2923be11261d00a512a2a2457c2f88d09ae9e0a5..699df69acef0af07fd629736abac0d3e6855e67a 100644 (file)
@@ -7,7 +7,11 @@ tinclude itk#vectors#:h|hxx
 tinclude itk#matrices#:h|hxx
 tinclude itk#diff_tensors#:h|hxx
 tinclude itkSymmetricEigenAnalysis:h|hxx
+tinclude vnl/vnl_vector:h|hxx
 
+cinclude vnl/vnl_c_vector.hxx
+
+instances vnl_vector< bool >
 instances itk::Array< #scalar_pixels# >
 instances itk::FixedArray< #scalar_pixels#, #process_dims# >
 instances itk::FixedArray< #scalar_pixels#, 8 >
index 4d2044a4877042968f7d1694a8fec14d82705e92..f7364f3cda56a7078064f8ae1414dd030ac7c826 100644 (file)
@@ -2,12 +2,14 @@ header #define ITK_MANUAL_INSTANTIATION
 
 tinclude itkImageSource:h|hxx
 
+cinclude complex
 cinclude itk#color_pixels#.h
 cinclude itk#vectors#.h
 cinclude itk#diff_tensors#.h
 cinclude itk#matrices#.h
 
 instances itk::ImageSource< itk::Image< #scalar_pixels#, #process_dims# > >
+instances itk::ImageSource< itk::Image< std::complex< #real_types# >, #process_dims# > >
 instances itk::ImageSource< itk::Image< itk::#color_pixels#< #scalar_pixels# >, #process_dims# > >
 instances itk::ImageSource< itk::Image< itk::#vectors#< #real_types#, #process_dims# >, #process_dims# > >
 instances itk::ImageSource< itk::Image< itk::#diff_tensors#< #real_types# >, 3 > >
index f35474c72b97555db0cd2ea9f8ab7d67d7fe4763..c77e0ca9b598f50064cb1779cb20aaf7a70d0df2 100644 (file)
@@ -4,12 +4,14 @@ define iter=ImageRegionConstIterator;ImageRegionIterator;ImageScanlineConstItera
 
 tinclude itk#iter#:h|hxx
 
+cinclude complex
 cinclude itk#color_pixels#.h
 cinclude itk#vectors#.h
 cinclude itk#diff_tensors#.h
 cinclude itk#matrices#.h
 
 instances itk::#iter#< itk::Image< #scalar_pixels#, #process_dims# > >
+instances itk::#iter#< itk::Image< std::complex< #real_types# >, #process_dims# > >
 instances itk::#iter#< itk::Image< itk::#color_pixels#< #scalar_pixels# >, #process_dims# > >
 instances itk::#iter#< itk::Image< itk::#vectors#< #real_types#, #process_dims# >, #process_dims# > >
 instances itk::#iter#< itk::Image< itk::#diff_tensors#< #real_types# >, 3 > >
index 6e37a2f1fb2a5169758e28fbcb4ade69fb7ba836..fd098bd9e0710ccccef686497f07610afd70330b 100644 (file)
@@ -1,11 +1,19 @@
 header #define ITK_MANUAL_INSTANTIATION
 
+define cells=Vertex;Line;Triangle;Polygon
+
 tinclude itkMesh:h|hxx
 tinclude itkPointSet:h|hxx
+tinclude itk#cells#Cell:h|hxx
+tinclude itkCellInterface:h|hxx
 
 cinclude itkMapContainer.hxx
 cinclude itkVectorContainer.hxx
 
+itk::CellInterface< #real_types#, itk::CellTraitsInfo< #visual_dims#, float, float, unsigned long, unsigned long, unsigned long, itk::Point< float, #visual_dims# >, itk::VectorContainer< unsigned long, itk::Point< float, #visual_dims# > >, std::set< unsigned long, std::less< unsigned long >, std::allocator< unsigned long > > > >
+
+instances itk::#cells#Cell< itk::CellInterface< #real_types#, itk::CellTraitsInfo< #visual_dims#, float, float, unsigned long, unsigned long, unsigned long, itk::Point< float, #visual_dims# >, itk::VectorContainer< unsigned long, itk::Point< float, #visual_dims# > >, std::set< unsigned long, std::less< unsigned long >, std::allocator< unsigned long > > > > >
+
 instances itk::PointSet< #real_types#, #visual_dims# >
 instances itk::Mesh< #real_types#, #visual_dims# >
 
index ab100bbcd461be3fe621f4315d2c535299fecdbf..6d20764a0206391e84ae78b67db292609b3b0281 100644 (file)
@@ -5,12 +5,14 @@ tinclude itkImageBase:h|hxx
 tinclude itkImage:h|hxx
 tinclude itkImportImageContainer:h|hxx
 
+cinclude complex
 cinclude itk#color_pixels#.h
 cinclude itk#vectors#.h
 cinclude itk#diff_tensors#.h
 cinclude itk#matrices#.h
 
 instances itk::ImportImageContainer< unsigned long, #scalar_pixels# >
+instances itk::ImportImageContainer< unsigned long, std::complex< #real_types# > >
 instances itk::ImportImageContainer< unsigned long, itk::#color_pixels#< #scalar_pixels# > >
 instances itk::ImportImageContainer< unsigned long, itk::#vectors#< #real_types#, #process_dims# > >
 instances itk::ImportImageContainer< unsigned long, itk::#diff_tensors#< #real_types# > >
@@ -20,6 +22,7 @@ instances itk::ImageRegion< #process_dims# >
 instances itk::ImageBase< #process_dims# >
 
 instances itk::Image< #scalar_pixels#, #process_dims# >
+instances itk::Image< std::complex< #real_types# >, #process_dims# >
 instances itk::Image< itk::#color_pixels#< #scalar_pixels# >, #process_dims# >
 instances itk::Image< itk::#vectors#< #real_types#, #process_dims# >, #process_dims# >
 instances itk::Image< itk::#diff_tensors#< #real_types# >, 3 >
index 5ee8f08776a639c1c3b8ea217207a9926a8b0465..352c566b149e3857642c4d75befe15686b4a9b33 100644 (file)
@@ -53,7 +53,13 @@ Block(
   // Add input ports\r
   auto inputs = this->m_Filter->GetInputsNames( );\r
   for( auto iIt = inputs.begin( ); iIt != inputs.end( ); ++iIt )\r
-    this->addInputPort( iIt->c_str( ) );\r
+  {\r
+    this->addInputPort(\r
+      iIt->c_str( ),\r
+      this->m_Filter->IsInputMultiple( iIt->c_str( ) )\r
+      );\r
+\r
+  } // rof\r
 \r
   // Add output ports\r
   auto outputs = this->m_Filter->GetOutputsNames( );\r
@@ -116,9 +122,9 @@ setNamePort( const QString& txt )
 \r
 // -------------------------------------------------------------------------\r
 cpBaseQtApplication::InputPort* cpBaseQtApplication::Block::\r
-addInputPort( const QString& txt )\r
+addInputPort( const QString& txt, bool multiple )\r
 {\r
-  InputPort* ip = new InputPort( this );\r
+  InputPort* ip = new InputPort( this, multiple );\r
   ip->setExtendedName( "" );\r
   ip->setName( txt );\r
   this->m_InputPorts[ txt.toStdString( ) ] = ip;\r
index 738339d17b58ebdd594724f3dcec68c020e63000..76a114a03cb3059f5514d09b7596f1c05d3b983c 100644 (file)
@@ -40,7 +40,7 @@ namespace cpBaseQtApplication
     void setEditor( Editor* editor );\r
 \r
     void setNamePort( const QString& txt );\r
-    InputPort* addInputPort( const QString& txt );\r
+    InputPort* addInputPort( const QString& txt, bool multiple );\r
     OutputPort* addOutputPort( const QString& txt );\r
 \r
     InputPort* inputPort( const QString& txt );\r
index c55141f17b1b35c40a545553c73e6b109096b371..85e7bfb1a9bf7bc592bdb0dd947b9a494836fc3e 100644 (file)
@@ -91,44 +91,6 @@ keyPressEvent( QKeyEvent* event )
   default:
     break;
   } // hctiws
-  /* TODO
-     if( event->key( ) == del_key )
-     {
-     auto _items = this->items( );
-     auto i = _items.begin( );
-     while( i != _items.end( ) )
-     {
-     if( ( *i )->isSelected( ) )
-     {
-     Block* b = dynamic_cast< Block* >( *i );
-     Connection* c = dynamic_cast< Connection* >( *i );
-     if( b != NULL )
-     {
-     if( this->m_Editor->deleteFilter( b->namePort( ).toStdString( ) ) )
-     delete b;
-     }
-     else if( c != NULL )
-     {
-     if(
-     this->m_Editor->deleteConnection(
-     c->port1( )->block( )->namePort( ).toStdString( ),
-     c->port2( )->block( )->namePort( ).toStdString( ),
-     c->port1( )->name( ).toStdString( ),
-     c->port2( )->name( ).toStdString( )
-     )
-     )
-     delete c;
-
-     } // fi
-     i = _items.end( );
-     }
-     else
-     i++;
-
-     } // elihw
-
-     } // fi
-  */
 }
 
 // -------------------------------------------------------------------------
index 81ac61d58de55d405e60a88bbf362564ac6dca6a..4f48b3b4651877af2e06174ef1dcccedd0ae384d 100644 (file)
@@ -63,12 +63,8 @@ setPort2( InputPort* p )
 {\r
   if( p != NULL )\r
   {\r
-    if( p->connection( ) == NULL )\r
-    {\r
-      p->setConnection( this );\r
-      this->m_Port2 = p;\r
-\r
-    } // fi\r
+    p->setConnection( this );\r
+    this->m_Port2 = p;\r
 \r
   } // fi\r
 }\r
index 0772ab9e3f65c3225dce214df97a2c8bf76eeeaf..b039f3f16b33f7483483ab0dbe6663366f91ce07 100644 (file)
@@ -302,36 +302,6 @@ dataProperties( const std::string& name, const std::string& port )
     this->m_MainWindow->dataProperties( name, port );\r
 }\r
 \r
-/* TODO\r
-\r
-// -------------------------------------------------------------------------\r
-void cpBaseQtApplication::Editor::\r
-showOutputData(\r
-  const std::string& filter_name, const std::string& output_name\r
-  )\r
-{\r
-  emit showFilterOutput( filter_name, output_name );\r
-}\r
-\r
-// -------------------------------------------------------------------------\r
-void cpBaseQtApplication::Editor::\r
-hideOutputData(\r
-  const std::string& filter_name, const std::string& output_name\r
-  )\r
-{\r
-  emit hideFilterOutput( filter_name, output_name );\r
-}\r
-\r
-// -------------------------------------------------------------------------\r
-void cpBaseQtApplication::Editor::\r
-visualPropertiesOutputData(\r
-  const std::string& filter_name, const std::string& output_name\r
-  )\r
-{\r
-  emit visualPropertiesFilterOutput( filter_name, output_name );\r
-}\r
-*/\r
-\r
 // -------------------------------------------------------------------------\r
 cpBaseQtApplication_Editor_Callback_CODE( ContextMenu )\r
 {\r
@@ -574,7 +544,7 @@ cpBaseQtApplication_Editor_Callback_CODE( MouseRelease )
     {\r
       if(\r
         in->block( ) != out->block( ) &&\r
-        !in->hasConnection( ) &&\r
+        ( !in->hasConnection( ) || in->isMultiple( ) ) &&\r
         !in->isConnected( out ) &&\r
         !out->isExtended( )\r
         )\r
index bdd9aea75819aad334ad54894dda32e894a2add4..e61bd284ef999d1857b50e7e798929cc056a834c 100644 (file)
@@ -126,9 +126,9 @@ isConnected( Port* other )
 \r
 // -------------------------------------------------------------------------\r
 cpBaseQtApplication::InputPort::\r
-InputPort( QGraphicsItem* parent, QGraphicsScene* scene )\r
+InputPort( QGraphicsItem* parent, bool multiple, QGraphicsScene* scene )\r
   : Superclass( parent, scene ),\r
-    m_Connection( NULL )\r
+    m_IsMultiple( multiple )\r
 {\r
 }\r
 \r
@@ -136,8 +136,7 @@ InputPort( QGraphicsItem* parent, QGraphicsScene* scene )
 cpBaseQtApplication::InputPort::\r
 ~InputPort( )\r
 {\r
-  if( this->m_Connection != NULL )\r
-    delete this->m_Connection;\r
+   this->m_Connection.clear( );\r
 }\r
 \r
 // -------------------------------------------------------------------------\r
@@ -156,7 +155,7 @@ _updateLabels( )
 void cpBaseQtApplication::InputPort::\r
 setExtend( bool extend )\r
 {\r
-  if( this->m_Connection == NULL )\r
+  if( this->m_Connection.size( ) == 0 )\r
   {\r
     this->m_IsExtended = extend;\r
     this->m_ExtendedLabel->setVisible( extend );\r
@@ -169,20 +168,19 @@ setExtend( bool extend )
 bool cpBaseQtApplication::InputPort::\r
 isConnected( Port* other )\r
 {\r
-  if( this->m_Connection != NULL )\r
-    return(\r
-      this->m_Connection->port1( ) == other &&\r
-      this->m_Connection->port2( ) == this\r
-      );\r
-  else\r
-    return( false );\r
+  bool conn = false;\r
+  auto i = this->m_Connection.begin( );\r
+  for( ; i != this->m_Connection.end( ); ++i )\r
+    conn |= ( ( *i )->port1( ) == other && ( *i )->port2( ) == this );\r
+  return( conn );\r
 }\r
 \r
 // -------------------------------------------------------------------------\r
 void cpBaseQtApplication::InputPort::\r
 setConnection( Connection* c )\r
 {\r
-  this->m_Connection = c;\r
+  if( this->m_IsMultiple || this->m_Connection.size( ) == 0 )\r
+    this->m_Connection.push_back( c );\r
 }\r
 \r
 // -------------------------------------------------------------------------\r
@@ -191,10 +189,14 @@ itemChange( GraphicsItemChange change, const QVariant& value )
 {\r
   if( change == ItemScenePositionHasChanged )\r
   {\r
-    if( this->m_Connection != NULL )\r
+    for(\r
+      auto i = this->m_Connection.begin( );\r
+      i != this->m_Connection.end( );\r
+      ++i\r
+      )\r
     {\r
-      this->m_Connection->updatePosFromPorts( );\r
-      this->m_Connection->updatePath( );\r
+      ( *i )->updatePosFromPorts( );\r
+      ( *i )->updatePath( );\r
 \r
     } // fi\r
 \r
index 1f6bda1289c84a196801648df445a238e7637451..45d1fe95ef67dd744c08043636f84c930f0a0c57 100644 (file)
@@ -101,7 +101,11 @@ namespace cpBaseQtApplication
     enum { Type = Superclass::Type + 3 };\r
 \r
   public:\r
-    InputPort( QGraphicsItem* parent = NULL, QGraphicsScene* scene = NULL );\r
+    InputPort(\r
+      QGraphicsItem* parent,\r
+      bool multiple,\r
+      QGraphicsScene* scene = NULL\r
+      );\r
     virtual ~InputPort( );\r
 \r
     virtual void setExtend( bool extend );\r
@@ -111,19 +115,22 @@ namespace cpBaseQtApplication
       { return( this->Type ); }\r
 \r
     void setConnection( Connection* c );\r
-    inline Connection* connection( )\r
-      { return( this->m_Connection ); }\r
-    inline const Connection* connection( ) const\r
-      { return( this->m_Connection ); }\r
+    inline Connection* connection( unsigned int i )\r
+      { return( this->m_Connection[ i ] ); }\r
+    inline const Connection* connection( unsigned int i ) const\r
+      { return( this->m_Connection[ i ] ); }\r
     inline bool hasConnection( ) const\r
-      { return( this->m_Connection != NULL ); }\r
+      { return( this->m_Connection.size( ) > 0 ); }\r
+    inline bool isMultiple( ) const\r
+      { return( this->m_IsMultiple ); }\r
 \r
   protected:\r
     QVariant itemChange( GraphicsItemChange change, const QVariant& value );\r
     virtual void _updateLabels( );\r
 \r
   protected:\r
-    Connection* m_Connection;\r
+    std::vector< Connection* > m_Connection;\r
+    bool m_IsMultiple;\r
   };\r
 \r
   /**\r
index 06b10ee097a2d6100eecabec1d79bf80539e2dea..6236ae1fcd447c702b455df51371e333e3452be0 100644 (file)
@@ -149,19 +149,25 @@ cpPlugins::BaseObjects::MultipleInputsPort::
 void cpPlugins::BaseObjects::MultipleInputsPort::
 Add( cpPlugins::BaseObjects::DataObject* o )
 {
-  /* TODO
-     if( o == NULL )
-     return;
-     auto otype = std::type_index( typeid( *o ) );
-     if( this->m_Type == otype )
-     this->m_Data.push_back( o );
-     else
-     throw std::logic_error(
-     "cpPlugins::MultipleInputsPort: incompatible types \"" +
-     std::string( otype.name( ) ) + std::string( "\" and \"" ) +
-     std::string( this->m_Type.name( ) ) + std::string( "\"" )
-     );
-  */
+  if( this->m_Sample.IsNull( ) )
+    throw std::logic_error(
+      "cpPlugins::SingleDataPort: Port not yet configured"
+      );
+  if( o != NULL )
+  {
+    if( this->m_Sample->IsCompatible( o ) )
+    {
+      this->m_Data.push_back( o );
+    }
+    else
+      throw std::logic_error(
+        "cpPlugins::SingleDataPort: incompatible types \"" +
+        std::string( typeid( *o ).name( ) ) + std::string( "\" and \"" ) +
+        std::string( typeid( *( this->m_Sample.GetPointer( ) ) ).name( ) ) +
+        std::string( "\"" )
+        );
+
+  } // fi
 }
 
 // -------------------------------------------------------------------------
index ab1be4d9cb9fc341ae919a809604f7a50ecf9e29..7f8533ae25cf7bfaaf9d4d8a7162e0b5472cc007 100644 (file)
@@ -79,6 +79,17 @@ GetInputSize( const std::string& n ) const
     return( 0 );
 }
 
+// -------------------------------------------------------------------------
+bool cpPlugins::BaseObjects::ProcessObject::
+IsInputMultiple( const std::string& n ) const
+{
+  auto i = this->m_Inputs.find( n );
+  if( i != this->m_Inputs.end( ) )
+    return( dynamic_cast< MultipleInputsPort* >( i->second ) != NULL );
+  else
+    return( false );
+}
+
 // -------------------------------------------------------------------------
 void cpPlugins::BaseObjects::ProcessObject::
 AddInput( const std::string& n, cpPlugins::BaseObjects::DataObject* o )
index 8d7536c4b75ea3145904ea61a6c7450d60b5190c..18c9b2d0b9f9c7b92c8dfb12dc073dd621bc771c 100644 (file)
@@ -59,6 +59,7 @@ namespace cpPlugins
       unsigned int GetNumberOfInputs( ) const;
       unsigned int GetNumberOfOutputs( ) const;
       unsigned int GetInputSize( const std::string& n ) const;
+      bool IsInputMultiple( const std::string& n ) const;
 
       template< class _TType = DataObject >
         _TType* GetInput( const std::string& n, unsigned int i = 0 );
index c10b8a2453aebcca88bb52a7f48c553e49c62496..6ecf3f224d83c9ad9b2f41a6676875a2e6f5874e 100644 (file)
@@ -82,6 +82,7 @@ Blend( Self* other )
     if( other->m_Points[ 1 ][ d ] > this->m_Points[ 1 ][ d ] )
       this->m_Points[ 1 ][ d ] = other->m_Points[ 1 ][ d ];
   this->Modified( );
+  this->_UpdateVTK( );
 }
 
 // -------------------------------------------------------------------------
index 2682d2a81c5fbc19456c5ff7c7c9d255df0b985c..40ba788c978df83360919ba020b9876a54ad173c 100644 (file)
@@ -6,6 +6,7 @@ VisualDims itk::ImageBase< #visual_dims# >
 IntPixels|d itk::Image< #all_ints#, d >
 RealPixels|d itk::Image< #real_types#, d >
 ScalarPixels|d itk::Image< #scalar_pixels#, d >
+ComplexPixels|d itk::Image< std::complex< #real_types# >, d >
 ColorPixels|d itk::Image< itk::#color_pixels#< #scalar_pixels# >, d >
 VectorPixels|d itk::Image< itk::#vectors#< #real_types#, d >, d >
 DiffTensors3D itk::Image< itk::#diff_tensors#< #real_types# >, 3 >
index c40bb021baa4c3a592424a9a8b0bda63b215379e..4a955520adc2dcb50772f990302335c231973489 100644 (file)
 #include <cpPlugins/DataObjects/Mesh.h>
+#include <cpPlugins/DataObjects/Mesh_Demanglers.h>
+
+#include <itkMesh.h>
+#include <itkLineCell.h>
+#include <itkTriangleCell.h>
+#include <itkPolygonCell.h>
 #include <vtkPolyData.h>
 
 // -------------------------------------------------------------------------
 void cpPlugins::DataObjects::Mesh::
 SetITK( itk::LightObject* o )
 {
-  /* TODO
-     this->Superclass::SetITK( o );
-     bool s = false;
-     cpPlugins_Demangle_Meshes_Dims( o, _ITK_2_VTK );
-  */
+  this->Superclass::SetITK( o );
+  cpPlugins_Demangle_Mesh_Meshes( o, _ITK_2_VTK, 2, );
+  cpPlugins_Demangle_Mesh_Meshes( o, _ITK_2_VTK, 3, );
+  {
+    this->m_VTK = NULL;
+
+  } // fi
+  this->Modified( );
 }
 
 // -------------------------------------------------------------------------
 void cpPlugins::DataObjects::Mesh::
 SetVTK( vtkObjectBase* o )
 {
-  /* TODO
-     typedef itk::Mesh< double, 3 >      _TMesh;
-     typedef _TMesh::CellType            _TCell;
-     typedef _TCell::CellAutoPointer     _TCellAutoPointer;
-     typedef itk::LineCell< _TCell >     _TLine;
-     typedef itk::TriangleCell< _TCell > _TTriangle;
-     typedef itk::PolygonCell< _TCell >  _TPolygon;
-
-     vtkPolyData* mesh = dynamic_cast< vtkPolyData* >( o );
-     if( mesh == NULL )
-     {
-     this->m_ITK = NULL;
-     this->Modified( );
-     return;
-
-     } // fi
-
-     if( this->m_VTK.GetPointer( ) != mesh )
-     {
-     this->m_VTK = mesh;
-
-     // Copy points
-     _TMesh::Pointer imesh = _TMesh::New( );
-     double point[ 3 ];
-     for( long i = 0; i < mesh->GetNumberOfPoints( ); ++i )
-     {
-     mesh->GetPoint( i, point );
-     _TMesh::PointType ipoint;
-     ipoint[ 0 ] = point[ 0 ];
-     ipoint[ 1 ] = point[ 1 ];
-     ipoint[ 2 ] = point[ 2 ];
-     imesh->SetPoint( i, ipoint );
-
-     } // rof
-
-     // Copy cells
-     vtkCellArray* arrays[ 4 ];
-     arrays[ 0 ] = mesh->GetLines( );
-     arrays[ 1 ] = mesh->GetPolys( );
-     arrays[ 2 ] = NULL; // TODO: mesh->GetStrips( );
-     arrays[ 3 ] = mesh->GetVerts( );
-
-     for( unsigned int c = 0; c < 4; c++ )
-     {
-     if( arrays[ c ] != NULL )
-     {
-     vtkSmartPointer< vtkIdList > ids =
-     vtkSmartPointer< vtkIdList >::New( );
-     arrays[ c ]->InitTraversal( );
-     while( arrays[ c ]->GetNextCell( ids ) == 1 )
-     {
-     long nPoints = ids->GetNumberOfIds( );
-     _TCellAutoPointer icell;
-     if( nPoints == 2 )
-     {
-     icell.TakeOwnership( new _TLine );
-     icell->SetPointId( 0, ids->GetId( 0 ) );
-     icell->SetPointId( 1, ids->GetId( 1 ) );
-     }
-     else if( nPoints == 3 )
-     {
-     icell.TakeOwnership( new _TTriangle );
-     icell->SetPointId( 0, ids->GetId( 0 ) );
-     icell->SetPointId( 1, ids->GetId( 1 ) );
-     icell->SetPointId( 2, ids->GetId( 2 ) );
-     }
-     else if( nPoints > 3 )
-     {
-     _TPolygon* polygon = new _TPolygon( );
-     for( long j = 0; j < nPoints; ++j )
-     polygon->AddPointId( ids->GetId( j ) );
-     icell.TakeOwnership( polygon );
-
-     } // fi
-     imesh->SetCell( imesh->GetNumberOfCells( ), icell );
-
-     } // elihw
-
-     } // fi
-
-     } // rof
-     this->m_ITK = imesh;
-     this->Modified( );
-
-     } // fi
-  */
+  typedef itk::Mesh< double, 3 >      _TMesh;
+  typedef _TMesh::CellType            _TCell;
+  typedef _TCell::CellAutoPointer     _TCellAutoPointer;
+  typedef itk::LineCell< _TCell >     _TLine;
+  typedef itk::TriangleCell< _TCell > _TTriangle;
+  typedef itk::PolygonCell< _TCell >  _TPolygon;
+
+  vtkPolyData* mesh = dynamic_cast< vtkPolyData* >( o );
+  if( mesh == NULL )
+  {
+    this->m_ITK = NULL;
+    this->Modified( );
+    return;
+
+  } // fi
+
+  if( this->m_VTK.GetPointer( ) != mesh )
+  {
+    this->m_VTK = mesh;
+
+    // Copy points
+    _TMesh::Pointer imesh = _TMesh::New( );
+    double point[ 3 ];
+    for( long i = 0; i < mesh->GetNumberOfPoints( ); ++i )
+    {
+      mesh->GetPoint( i, point );
+      _TMesh::PointType ipoint;
+      ipoint[ 0 ] = point[ 0 ];
+      ipoint[ 1 ] = point[ 1 ];
+      ipoint[ 2 ] = point[ 2 ];
+      imesh->SetPoint( i, ipoint );
+
+    } // rof
+
+    // Copy cells
+    vtkCellArray* arrays[ 4 ];
+    arrays[ 0 ] = mesh->GetLines( );
+    arrays[ 1 ] = mesh->GetPolys( );
+    arrays[ 2 ] = NULL; // TODO: mesh->GetStrips( );
+    arrays[ 3 ] = mesh->GetVerts( );
+
+    for( unsigned int c = 0; c < 4; c++ )
+    {
+      if( arrays[ c ] != NULL )
+      {
+        vtkSmartPointer< vtkIdList > ids =
+          vtkSmartPointer< vtkIdList >::New( );
+        arrays[ c ]->InitTraversal( );
+        while( arrays[ c ]->GetNextCell( ids ) == 1 )
+        {
+          long nPoints = ids->GetNumberOfIds( );
+          _TCellAutoPointer icell;
+          if( nPoints == 2 )
+          {
+            icell.TakeOwnership( new _TLine );
+            icell->SetPointId( 0, ids->GetId( 0 ) );
+            icell->SetPointId( 1, ids->GetId( 1 ) );
+          }
+          else if( nPoints == 3 )
+          {
+            icell.TakeOwnership( new _TTriangle );
+            icell->SetPointId( 0, ids->GetId( 0 ) );
+            icell->SetPointId( 1, ids->GetId( 1 ) );
+            icell->SetPointId( 2, ids->GetId( 2 ) );
+          }
+          else if( nPoints > 3 )
+          {
+            _TPolygon* polygon = new _TPolygon( );
+            for( long j = 0; j < nPoints; ++j )
+              polygon->AddPointId( ids->GetId( j ) );
+            icell.TakeOwnership( polygon );
+
+          } // fi
+          imesh->SetCell( imesh->GetNumberOfCells( ), icell );
+
+        } // elihw
+
+      } // fi
+
+    } // rof
+    this->m_ITK = imesh;
+    this->Modified( );
+
+  } // fi
 }
 
 // -------------------------------------------------------------------------
@@ -117,4 +124,59 @@ cpPlugins::DataObjects::Mesh::
 {
 }
 
+// -------------------------------------------------------------------------
+template< class _TMesh >
+void cpPlugins::DataObjects::Mesh::
+_ITK_2_VTK( _TMesh* mesh )
+{
+  long numPoints = mesh->GetNumberOfPoints( );
+  if( numPoints == 0 )
+    return;
+
+  vtkSmartPointer< vtkPoints > vpoints =
+    vtkSmartPointer< vtkPoints >::New( );
+  vpoints->SetNumberOfPoints( numPoints );
+  auto points = mesh->GetPoints( );
+
+  // Copy points
+  vtkIdType VTKId = 0;
+  std::map< vtkIdType, long > IndexMap;
+  for( auto i = points->Begin( ); i != points->End( ); ++i, VTKId++ )
+  {
+    IndexMap[ VTKId ] = i->Index( );
+    if( _TMesh::PointDimension == 2 )
+      vpoints->SetPoint(
+        VTKId,
+        i->Value( )[ 0 ], i->Value( )[ 1 ], 0
+        );
+    else if( _TMesh::PointDimension == 3 )
+      vpoints->SetPoint(
+        VTKId,
+        i->Value( )[ 0 ], i->Value( )[ 1 ], i->Value( )[ 2 ]
+        );
+
+  } // rof
+
+  // Copy cells
+  vtkSmartPointer< vtkCellArray > vcells =
+    vtkSmartPointer< vtkCellArray >::New( );
+  auto cells = mesh->GetCells( );
+  for( auto j = cells->Begin( ); j != cells->End( ); ++j )
+  {
+    auto cell = j->Value( );
+    vcells->InsertNextCell( cell->GetNumberOfPoints( ) );
+    for( auto k = cell->PointIdsBegin( ); k != cell->PointIdsEnd( ); ++k )
+      vcells->InsertCellPoint( IndexMap[ *k ] );
+    
+  } // rof
+
+  // Final assignations
+  vtkSmartPointer< vtkPolyData > vmesh =
+    vtkSmartPointer< vtkPolyData >::New( );
+  vmesh->SetPoints( vpoints );
+  vmesh->SetPolys( vcells );
+  this->m_VTK = vmesh;
+  this->Modified( );
+}
+
 // eof - $RCSfile$
index 4713177bfc5c4197b1b8a3ec2ae85e9bc5423af5..becc6b9b1e99afcf831cf213fea4649e610cc9c6 100644 (file)
@@ -1,3 +1,3 @@
-Meshes itk::Mesh< #real_types#, #process_dims# >
+Meshes|d itk::Mesh< #real_types#, d >
 
 ** eof - $RCSfile$
index b932bdf8a121769d2f47f3d32bd565d19efa3de3..ce3f331caa4b2e8351e14cde118cb721a50001c0 100644 (file)
@@ -33,7 +33,7 @@ namespace cpPlugins
       virtual ~Mesh( );
 
       template< class _TMesh >
-        inline void _ITK_2_VTK( _TMesh* mesh );
+      inline void _ITK_2_VTK( _TMesh* mesh );
 
     private:
       // Purposely not implemented
@@ -45,8 +45,6 @@ namespace cpPlugins
 
 } // ecapseman
 
-#include <cpPlugins/DataObjects/Mesh.hxx>
-
 #endif // __cpPlugins__DataObjects__Mesh__h__
 
 // eof - $RCSfile$
diff --git a/lib/cpPlugins/DataObjects/Mesh.hxx b/lib/cpPlugins/DataObjects/Mesh.hxx
deleted file mode 100644 (file)
index f9cc1bc..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef __cpPlugins__DataObjects__Mesh__hxx__
-#define __cpPlugins__DataObjects__Mesh__hxx__
-
-// TODO: #include <cpPlugins_Meshes.h>
-#include <vtkCellArray.h>
-#include <vtkPoints.h>
-#include <vtkPolyData.h>
-#include <vtkSmartPointer.h>
-
-// -------------------------------------------------------------------------
-template< class _TMesh >
-void cpPlugins::DataObjects::Mesh::
-_ITK_2_VTK( _TMesh* mesh )
-{
-  long numPoints = mesh->GetNumberOfPoints( );
-  if( numPoints == 0 )
-    return;
-
-  vtkSmartPointer< vtkPoints > vpoints =
-    vtkSmartPointer< vtkPoints >::New( );
-  vpoints->SetNumberOfPoints( numPoints );
-  auto points = mesh->GetPoints( );
-
-  // Copy points
-  vtkIdType VTKId = 0;
-  std::map< vtkIdType, long > IndexMap;
-  for( auto i = points->Begin( ); i != points->End( ); ++i, VTKId++ )
-  {
-    IndexMap[ VTKId ] = i->Index( );
-    if( _TMesh::PointDimension == 2 )
-      vpoints->SetPoint(
-        VTKId,
-        i->Value( )[ 0 ], i->Value( )[ 1 ], 0
-        );
-    else if( _TMesh::PointDimension == 3 )
-      vpoints->SetPoint(
-        VTKId,
-        i->Value( )[ 0 ], i->Value( )[ 1 ], i->Value( )[ 2 ]
-        );
-
-  } // rof
-
-  // Copy cells
-  vtkSmartPointer< vtkCellArray > vcells =
-    vtkSmartPointer< vtkCellArray >::New( );
-  auto cells = mesh->GetCells( );
-  for( auto j = cells->Begin( ); j != cells->End( ); ++j )
-  {
-    auto cell = j->Value( );
-    vcells->InsertNextCell( cell->GetNumberOfPoints( ) );
-    for( auto k = cell->PointIdsBegin( ); k != cell->PointIdsEnd( ); ++k )
-      vcells->InsertCellPoint( IndexMap[ *k ] );
-    
-  } // rof
-
-  // Final assignations
-  vtkSmartPointer< vtkPolyData > vmesh =
-    vtkSmartPointer< vtkPolyData >::New( );
-  vmesh->SetPoints( vpoints );
-  vmesh->SetPolys( vcells );
-  this->m_VTK = vmesh;
-  this->Modified( );
-}
-
-#endif // __cpPlugins__DataObjects__Mesh__hxx__
-
-// eof - $RCSfile$
index 90c26d5415ca430af81d910a7187f0274eb08cb2..faef957a1aa042ff1285d46b2b099c14e57617de 100644 (file)
@@ -350,12 +350,17 @@ GetConnections(
     {
       for( auto i = ins.begin( ); i != ins.end( ); ++i )
       {
-        auto od = orig->GetOutput( *o );
-        auto id = dest->GetInput( *i );
-        if( od != NULL && od == id )
-          conns.push_back(
-            std::pair< std::string, std::string >( *o, *i )
-            );
+        unsigned int nInputs = dest->GetInputSize( *i );
+        for( unsigned j = 0; j < nInputs; ++j )
+        {
+          auto od = orig->GetOutput( *o );
+          auto id = dest->GetInput( *i, j );
+          if( od != NULL && od == id )
+            conns.push_back(
+              std::pair< std::string, std::string >( *o, *i )
+              );
+
+        } // rof
 
       } // rof
 
index 029ade420b79aa60ce57a8ca49fc491d16a5783e..9a019ebafe4643b68295cd0cea2c92a0ee8bb88a 100644 (file)
@@ -235,21 +235,26 @@ Save( const std::string& fname ) const
         auto od = orig->GetOutput( *oIt );
         for( auto iIt = inputs.begin( ); iIt != inputs.end( ); ++iIt )
         {
-          auto id = dest->GetInput( *iIt );
-          if( od != NULL && od == id )
+          unsigned int nInputs = dest->GetInputSize( *iIt );
+          for( unsigned int k = 0; k < nInputs; ++k )
           {
-            tinyxml2::XMLElement* e_conn = doc->NewElement( "Connection" );
-            tinyxml2::XMLElement* e_orig = doc->NewElement( "Origin" );
-            tinyxml2::XMLElement* e_dest = doc->NewElement( "Destination" );
-            e_orig->SetAttribute( "Filter", orig->GetName( ) );
-            e_orig->SetAttribute( "Name", oIt->c_str( ) );
-            e_dest->SetAttribute( "Filter", dest->GetName( ) );
-            e_dest->SetAttribute( "Name", iIt->c_str( ) );
-            e_conn->LinkEndChild( e_orig );
-            e_conn->LinkEndChild( e_dest );
-            root->LinkEndChild( e_conn );
-
-          } // fi
+            auto id = dest->GetInput( *iIt, k );
+            if( od != NULL && od == id )
+            {
+              tinyxml2::XMLElement* e_conn = doc->NewElement( "Connection" );
+              tinyxml2::XMLElement* e_orig = doc->NewElement( "Origin" );
+              tinyxml2::XMLElement* e_dest = doc->NewElement( "Destination" );
+              e_orig->SetAttribute( "Filter", orig->GetName( ) );
+              e_orig->SetAttribute( "Name", oIt->c_str( ) );
+              e_dest->SetAttribute( "Filter", dest->GetName( ) );
+              e_dest->SetAttribute( "Name", iIt->c_str( ) );
+              e_conn->LinkEndChild( e_orig );
+              e_conn->LinkEndChild( e_dest );
+              root->LinkEndChild( e_conn );
+
+            } // fi
+
+          } // rof
 
         } // rof
 
index b29bf7ddf0bf5b918f54ac77b365366d54166c52..ac367ba8cd0a5c088ae0b70a848ca1d51925946e 100644 (file)
@@ -8,8 +8,8 @@ SET(
   GenericFilters
   #ImageArithmeticFilters
   #ImageBooleanFilters
-  #ImageDistanceMaps
-  ImageGenericFilters
+  ImageDistanceMaps
+  #ImageGenericFilters
   #ImageGradientFilters
   ImageMeshFilters
   ImageSources
@@ -17,7 +17,7 @@ SET(
   IO
   MeshFilters
   MeshSources
-  Widgets
+  #Widgets
   )
 
 #IF(ParabolicMorphology_LOADED)
index 43850723b721acd05f583c3ada61a742d6c5750d..32b0a64ab254704842806a9bb57d0328c963669c 100644 (file)
@@ -7,12 +7,7 @@ cpPluginsGenericFilters::JoinBoundingBoxes::
 JoinBoundingBoxes( )
   : Superclass( )
 {
-  this->_ConfigureInput( "Input0", true, false );
-  this->_ConfigureInput( "Input1", false, false );
-  this->_ConfigureInput( "Input2", false, false );
-  this->_ConfigureInput( "Input3", false, false );
-  this->_ConfigureInput( "Input4", false, false );
-  this->_ConfigureInput( "Input5", false, false );
+  this->_ConfigureInput( "Inputs", true, true );
   this->_ConfigureOutput< cpPlugins::DataObjects::BoundingBox >( "Output" );
 }
 
@@ -28,26 +23,20 @@ _GenerateData( )
 {
   typedef cpPlugins::BaseObjects::DataObject _TDO;
   typedef cpPlugins::DataObjects::BoundingBox _TBB;
-  _TDO* dobjs[ 5 ];
-  
-  auto do0   = dynamic_cast< _TDO* >( this->GetInput( "Input0" ) );
-  dobjs[ 0 ] = dynamic_cast< _TDO* >( this->GetInput( "Input1" ) );
-  dobjs[ 1 ] = dynamic_cast< _TDO* >( this->GetInput( "Input2" ) );
-  dobjs[ 2 ] = dynamic_cast< _TDO* >( this->GetInput( "Input3" ) );
-  dobjs[ 3 ] = dynamic_cast< _TDO* >( this->GetInput( "Input4" ) );
-  dobjs[ 4 ] = dynamic_cast< _TDO* >( this->GetInput( "Input5" ) );
-  auto out = dynamic_cast< _TBB* >( this->GetOutput( "Output" ) );
 
-  out->SetDataObject( do0 );
-  for( unsigned int d = 0; d < 5; ++d )
+  auto out = dynamic_cast< _TBB* >( this->GetOutput( "Output" ) );
+  unsigned int nInputs = this->GetInputSize( "Inputs" );
+  for( unsigned int i = 0; i < nInputs; ++i )
   {
-    if( dobjs[ d ] != NULL )
+    auto in = dynamic_cast< _TDO* >( this->GetInput( "Inputs", i ) );
+    if( i > 0 )
     {
       _TBB::Pointer bb = _TBB::New( );
-      bb->SetDataObject( dobjs[ d ] );
+      bb->SetDataObject( in );
       out->Blend( bb );
-
-    } // fi
+    }
+    else
+      out->SetDataObject( in );
 
   } // rof
 }
index 6b29a6769c07e7f0293afa945efb3dfa50729540..24183f6f23576bcfd9a25ad7cbddfd27ed9f6923 100644 (file)
@@ -11,7 +11,7 @@ namespace cpPluginsGenericFilters
   class cpPluginsGenericFilters_EXPORT JoinBoundingBoxes
     : public cpPlugins::BaseObjects::ProcessObject
   {
-    cpPluginsObject( 
+    cpPluginsObject(
       JoinBoundingBoxes,
       cpPlugins::BaseObjects::ProcessObject,
       GenericFilters
index 5470572af30178665f4e3686758455c1d7120b05..10c6afd1042855c123b72eb6a37ffa42a553f3ef 100644 (file)
@@ -4,6 +4,7 @@ define io=ImageFileReader;ImageSeriesReader;ImageFileWriter
 
 tinclude itk#io#:h|hxx
 
+cinclude complex
 cinclude itk#color_pixels#.h
 cinclude itk#vectors#.h
 cinclude itk#diff_tensors#.h
@@ -13,6 +14,7 @@ cinclude itkImageAlgorithm.hxx
 cinclude itkSimpleDataObjectDecorator.hxx
 
 instances itk::#io#< itk::Image< #scalar_pixels#, #process_dims# > >
+instances itk::#io#< itk::Image< std::complex< #real_types# >, #process_dims# > >
 instances itk::#io#< itk::Image< itk::#color_pixels#< #scalar_pixels# >, #process_dims# > >
 instances itk::#io#< itk::Image< itk::#vectors#< #real_types#, #process_dims# >, #process_dims# > >
 instances itk::#io#< itk::Image< itk::#diff_tensors#< #real_types# >, 3 > >
index f4639a15678c0466e0b564fa19c8a894b77ed9fa..a54a5409601fae920ee66e4b419aed07f8e8efc1 100644 (file)
@@ -255,29 +255,71 @@ _GD0( itk::ImageIOBase* io )
   }
   else if( pt == itk::ImageIOBase::COMPLEX )
   {
+#ifdef cpPlugins_CONFIG_INTEGER_TYPES_float
+    if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< std::complex< float >, _Dim >( io );
+#endif // cpPlugins_CONFIG_INTEGER_TYPES_float
+#ifdef cpPlugins_CONFIG_INTEGER_TYPES_double
+    if( ct == itk::ImageIOBase::DOUBLE ) success = this->_GD1< std::complex< double >, _Dim >( io );
+#endif // cpPlugins_CONFIG_INTEGER_TYPES_double
   }
   else if( pt == itk::ImageIOBase::COVARIANTVECTOR )
   {
+#ifdef cpPlugins_CONFIG_INTEGER_TYPES_float
+    if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::CovariantVector< float, _Dim >, _Dim >( io );
+#endif // cpPlugins_CONFIG_INTEGER_TYPES_float
+#ifdef cpPlugins_CONFIG_INTEGER_TYPES_double
+    if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::CovariantVector< double, _Dim >, _Dim >( io );
+#endif // cpPlugins_CONFIG_INTEGER_TYPES_double
   }
   else if( pt == itk::ImageIOBase::POINT )
   {
+#ifdef cpPlugins_CONFIG_INTEGER_TYPES_float
+    if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::Point< float, _Dim >, _Dim >( io );
+#endif // cpPlugins_CONFIG_INTEGER_TYPES_float
+#ifdef cpPlugins_CONFIG_INTEGER_TYPES_double
+    if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::Point< double, _Dim >, _Dim >( io );
+#endif // cpPlugins_CONFIG_INTEGER_TYPES_double
   }
   else if( pt == itk::ImageIOBase::VECTOR )
   {
+#ifdef cpPlugins_CONFIG_INTEGER_TYPES_float
+    if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::Vector< float, _Dim >, _Dim >( io );
+#endif // cpPlugins_CONFIG_INTEGER_TYPES_float
+#ifdef cpPlugins_CONFIG_INTEGER_TYPES_double
+    if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::Vector< double, _Dim >, _Dim >( io );
+#endif // cpPlugins_CONFIG_INTEGER_TYPES_double
   }
   else if( pt == itk::ImageIOBase::SYMMETRICSECONDRANKTENSOR )
   {
+#ifdef cpPlugins_CONFIG_INTEGER_TYPES_float
+    if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::SymmetricSecondRankTensor< float, _Dim >, _Dim >( io );
+#endif // cpPlugins_CONFIG_INTEGER_TYPES_float
+#ifdef cpPlugins_CONFIG_INTEGER_TYPES_double
+    if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::SymmetricSecondRankTensor< double, _Dim >, _Dim >( io );
+#endif // cpPlugins_CONFIG_INTEGER_TYPES_double
   }
   else if( pt == itk::ImageIOBase::DIFFUSIONTENSOR3D )
   {
     if( _Dim == 3 )
     {
+#ifdef cpPlugins_CONFIG_INTEGER_TYPES_float
+      if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::DiffusionTensor3D< float >, _Dim >( io );
+#endif // cpPlugins_CONFIG_INTEGER_TYPES_float
+#ifdef cpPlugins_CONFIG_INTEGER_TYPES_double
+      if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::DiffusionTensor3D< double >, _Dim >( io );
+#endif // cpPlugins_CONFIG_INTEGER_TYPES_double
     }
     else
       this->_Error( "DiffusionTensor3D dimension not supported." );
   }
   else if( pt == itk::ImageIOBase::MATRIX )
   {
+#ifdef cpPlugins_CONFIG_INTEGER_TYPES_float
+    if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::Matrix< float, _Dim, _Dim >, _Dim >( io );
+#endif // cpPlugins_CONFIG_INTEGER_TYPES_float
+#ifdef cpPlugins_CONFIG_INTEGER_TYPES_double
+    if( ct == itk::ImageIOBase::FLOAT ) success = this->_GD1< itk::Matrix< double, _Dim, _Dim >, _Dim >( io );
+#endif // cpPlugins_CONFIG_INTEGER_TYPES_double
   }
   else if( pt == itk::ImageIOBase::OFFSET )
   {
@@ -285,7 +327,7 @@ _GD0( itk::ImageIOBase* io )
   }
   else if( pt == itk::ImageIOBase::FIXEDARRAY )
   {
-  }
+  } // fi
   return( success );
 }
 
index 25d59d4dcc240ff948706233c3952e0e9b74584e..2f43f66cffa2aee067bf1c8f197c68d7912a6c67 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __CPPLUGINSIO__IMAGEREADER__H__
-#define __CPPLUGINSIO__IMAGEREADER__H__
+#ifndef __cpPluginsIO__ImageReader__h__
+#define __cpPluginsIO__ImageReader__h__
 
 #include <cpPluginsIO_Export.h>
 #include <cpPlugins/BaseObjects/ProcessObject.h>
@@ -28,6 +28,6 @@ namespace cpPluginsIO
 
 } // ecapseman
 
-#endif // __CPPLUGINS__IO__IMAGEREADER__H__
+#endif // __cpPluginsIO__ImageReader__h__
 
 // eof - $RCSfile$
index 08a45d7f922e1216727aa35116d08f7f76dfe445..80f57e11cb5aa4671756b5d62c57a465d2df634a 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __CPPLUGINSIO__IMAGEREADERQDIALOG__H__
-#define __CPPLUGINSIO__IMAGEREADERQDIALOG__H__
+#ifndef __cpPluginsIO__ImageReaderQDialog__h__
+#define __cpPluginsIO__ImageReaderQDialog__h__
 
 #include <cpPlugins/Config.h>
 
@@ -33,6 +33,6 @@ namespace cpPluginsIO
 
 #endif // cpPlugins_QT4
 
-#endif // __CPPLUGINS__IO__IMAGEREADERQDIALOG__H__
+#endif // __cpPluginsIO__ImageReaderQDialog__h__
 
 // eof - $RCSfile$
index d6d8f87c62cb8f34e58a73327d1bf99e9d347dce..94a822bd2ab1d8f781f85779759558225215658f 100644 (file)
@@ -118,9 +118,9 @@ void cpPluginsIO::ImageWriter::
 _GenerateData( )
 {
   auto o = this->GetInputData( "Input" );
-  cpPlugins_Demangle_Image_ProcessDims( o, _GD0, );
-  cpPlugins_Demangle_Image_DiffTensors3D( o, _GD1, );
-  this->_Error( "Invalid input image dimension." );
+  cpPlugins_Demangle_Image_ProcessDims( o, _GD0, )
+    cpPlugins_Demangle_Image_DiffTensors3D( o, _GD1, )
+    this->_Error( "Invalid input image dimension." );
 }
 
 // -------------------------------------------------------------------------
@@ -128,12 +128,11 @@ template< class _TImage >
 void cpPluginsIO::ImageWriter::
 _GD0( _TImage* image )
 {
-  cpPlugins_Demangle_Image_IntPixels( image, _GD1, _TImage::ImageDimension, );
-  cpPlugins_Demangle_Image_RealPixels( image, _GD1, _TImage::ImageDimension, );
-  cpPlugins_Demangle_Image_ScalarPixels( image, _GD1, _TImage::ImageDimension, );
-  cpPlugins_Demangle_Image_ColorPixels( image, _GD1, _TImage::ImageDimension, );
-  cpPlugins_Demangle_Image_VectorPixels( image, _GD1, _TImage::ImageDimension, );
-  this->_Error( "Invalid input image pixel type." );
+  cpPlugins_Demangle_Image_ScalarPixels( image, _GD1, _TImage::ImageDimension, )
+    cpPlugins_Demangle_Image_ComplexPixels( image, _GD1, _TImage::ImageDimension, )
+    cpPlugins_Demangle_Image_ColorPixels( image, _GD1, _TImage::ImageDimension, )
+    cpPlugins_Demangle_Image_VectorPixels( image, _GD1, _TImage::ImageDimension, )
+    this->_Error( "Invalid input image pixel type." );
 }
 
 // -------------------------------------------------------------------------
index 364e3999ead42eab0d74baba0fa3253393946c2c..f3a32a328995986676c0bde90bc3362b4319fb8a 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __CPPLUGINSIO__IMAGEWRITER__H__
-#define __CPPLUGINSIO__IMAGEWRITER__H__
+#ifndef __cpPluginsIO__ImageWriter__h__
+#define __cpPluginsIO__ImageWriter__h__
 
 #include <cpPluginsIO_Export.h>
 #include <cpPlugins/BaseObjects/ProcessObject.h>
@@ -27,6 +27,6 @@ namespace cpPluginsIO
 
 } // ecapseman
 
-#endif // __CPPLUGINS__IO__IMAGEWRITER__H__
+#endif // __cpPluginsIO__ImageWriter__h__
 
 // eof - $RCSfile$
index 54e39de3a0b3dfcf36ae717deb6f48e07623feb1..c1f14008ec8591e99cbfda56f668901f604ed414 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __CPPLUGINSIO__IMAGEWRITERQDIALOG__H__
-#define __CPPLUGINSIO__IMAGEWRITERQDIALOG__H__
+#ifndef __cpPluginsIO__ImageWriterQDialog__h__
+#define __cpPluginsIO__ImageWriterQDialog__h__
 
 #include <cpPlugins/Config.h>
 
@@ -33,6 +33,6 @@ namespace cpPluginsIO
 
 #endif // cpPlugins_QT4
 
-#endif // __CPPLUGINS__IO__IMAGEWRITERQDIALOG__H__
+#endif // __cpPluginsIO__ImageWriterQDialog__h__
 
 // eof - $RCSfile$
index fac2dc9915bf372711575e601841cb0b0bae7230..986eebbfbc0c2c0a3335052682810b2fbe830755 100644 (file)
@@ -1,5 +1,7 @@
 #include <IO/MeshWriter.h>
 #include <cpPlugins/DataObjects/Mesh.h>
+
+#include <vtkPolyData.h>
 #include <vtkPolyDataWriter.h>
 
 // -------------------------------------------------------------------------
@@ -7,7 +9,9 @@ cpPluginsIO::MeshWriter::
 MeshWriter( )
   : Superclass( )
 {
-  this->_ConfigureInput< cpPlugins::DataObjects::Mesh >( "Input", true, false );
+  typedef cpPlugins::DataObjects::Mesh _TMesh;
+
+  this->_ConfigureInput< _TMesh >( "Input", true, false );
   this->m_Parameters.Clear( );
   this->m_Parameters.ConfigureAsSaveFileName( "FileName" );
   this->m_Parameters.SetAcceptedFileExtensions(
@@ -33,6 +37,7 @@ _GenerateData( )
   auto f = this->_CreateVTK< vtkPolyDataWriter >( );
   f->SetFileName( this->m_Parameters.GetSaveFileName( "FileName" ).c_str( ) );
   f->SetInputData( mesh );
+  f->SetFileTypeToBinary( );
   f->Update( );
 }
 
index ed8f46163916464966b6921a5e24265f8166da44..8b8b59f2c43fa55bf6d977c02b3232d989da3795 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __CPPLUGINSIO__MESHWRITER__H__
-#define __CPPLUGINSIO__MESHWRITER__H__
+#ifndef __cpPluginsIO__MeshWriter__h__
+#define __cpPluginsIO__MeshWriter__h__
 
 #include <cpPluginsIO_Export.h>
 #include <cpPlugins/BaseObjects/ProcessObject.h>
@@ -16,6 +16,6 @@ namespace cpPluginsIO
 
 } // ecapseman
 
-#endif // __CPPLUGINS__IO__MESHWRITER__H__
+#endif // __cpPluginsIO__MeshWriter__h__
 
 // eof - $RCSfile$
diff --git a/plugins/ImageDistanceMaps/ImageDistanceMaps.i b/plugins/ImageDistanceMaps/ImageDistanceMaps.i
new file mode 100644 (file)
index 0000000..a29aaaa
--- /dev/null
@@ -0,0 +1,11 @@
+header #define ITK_MANUAL_INSTANTIATION
+
+define filters=SignedMaurerDistanceMapImageFilter
+define iter=ImageRegionConstIterator;ImageRegionIterator
+
+tinclude itk#filters#:h|hxx
+tinclude itk#iter#:h|h
+
+instances itk::#filters#< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #real_types#, #process_dims# > >
+
+** eof - $RCSfile$
index 41001947368179dc1a9d1027488c5cd4a068f2ce..ad2b183eba272b891532fff850df4ccf94eeda30 100644 (file)
@@ -1,20 +1,18 @@
-#include <plugins/ImageDistanceMaps/SignedMaurerDistanceMapImageFilter.h>
+#include <ImageDistanceMaps/SignedMaurerDistanceMapImageFilter.h>
 #include <cpPlugins/DataObjects/Image.h>
+#include <cpPlugins/DataObjects/Image_Demanglers.h>
 
-#include <cpPlugins_ImageIterators.h>
 #include <itkSignedMaurerDistanceMapImageFilter.h>
-#include <itkSignedMaurerDistanceMapImageFilter.hxx>
-#include <itkBinaryContourImageFilter.hxx>
-#include <itkBinaryThresholdImageFilter.hxx>
-#include <itkUnaryFunctorImageFilter.hxx>
 
 // -------------------------------------------------------------------------
 cpPluginsImageDistanceMaps::SignedMaurerDistanceMapImageFilter::
 SignedMaurerDistanceMapImageFilter( )
   : Superclass( )
 {
-  this->_ConfigureInput< cpPlugins::DataObjects::Image >( "Input", true, false );
-  this->_ConfigureOutput< cpPlugins::DataObjects::Image >( "Output" );
+  typedef cpPlugins::DataObjects::Image _TImage;
+
+  this->_ConfigureInput< _TImage >( "Input", true, false );
+  this->_ConfigureOutput< _TImage >( "Output" );
 
   this->m_Parameters.ConfigureAsReal( "BackgroundValue" );
   this->m_Parameters.ConfigureAsBool( "InsideIsPositive" );
@@ -22,15 +20,18 @@ SignedMaurerDistanceMapImageFilter( )
   this->m_Parameters.ConfigureAsBool( "UseImageSpacing" );
 
   std::vector< std::string > choices;
+#ifdef cpPlugins_CONFIG_REAL_TYPES_float
   choices.push_back( "float" );
+#endif // cpPlugins_CONFIG_REAL_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_double
   choices.push_back( "double" );
+#endif // cpPlugins_CONFIG_REAL_TYPES_double
   this->m_Parameters.ConfigureAsChoices( "OutputResolution", choices );
 
   this->m_Parameters.SetReal( "BackgroundValue", 0 );
   this->m_Parameters.SetBool( "InsideIsPositive", true );
   this->m_Parameters.SetBool( "SquaredDistance", false );
   this->m_Parameters.SetBool( "UseImageSpacing", true );
-  this->m_Parameters.SetSelectedChoice( "OutputResolution", "float" );
 }
 
 // -------------------------------------------------------------------------
@@ -44,9 +45,8 @@ void cpPluginsImageDistanceMaps::SignedMaurerDistanceMapImageFilter::
 _GenerateData( )
 {
   auto o = this->GetInputData( "Input" );
-  cpPlugins_Demangle_ImageScalars( o, _GD0, 2 );
-  else cpPlugins_Demangle_ImageScalars( o, _GD0, 3 );
-  else this->_Error( "Invalid input image." );
+  cpPlugins_Demangle_Image_ProcessDims( o, _GD0, )
+    this->_Error( "Invalid input image dimension." );
 }
 
 // -------------------------------------------------------------------------
@@ -54,21 +54,31 @@ template< class _TImage >
 void cpPluginsImageDistanceMaps::SignedMaurerDistanceMapImageFilter::
 _GD0( _TImage* image )
 {
-  typedef itk::Image< float, _TImage::ImageDimension >  _TFDmap;
-  typedef itk::Image< double, _TImage::ImageDimension > _TDDmap;
+  cpPlugins_Demangle_Image_ScalarPixels( image, _GD1, _TImage::ImageDimension, )
+    this->_Error( "Invalid input image pixel type." );
+}
 
+// -------------------------------------------------------------------------
+template< class _TImage >
+void cpPluginsImageDistanceMaps::SignedMaurerDistanceMapImageFilter::
+_GD1( _TImage* image )
+{
   std::string out_res =
     this->m_Parameters.GetSelectedChoice( "OutputResolution" );
-  if( out_res == "float" )       this->_GD1< _TImage, _TFDmap >( image );
-  else if( out_res == "double" ) this->_GD1< _TImage, _TDDmap >( image );
-  else this->_Error( "Output resolution not supported." );
+#ifdef cpPlugins_CONFIG_REAL_TYPES_float
+  if( out_res == "float" ) this->_GD2< _TImage, float >( image );
+#endif // cpPlugins_CONFIG_REAL_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_double
+  if( out_res == "double" ) this->_GD2< _TImage, double >( image );
+#endif // cpPlugins_CONFIG_REAL_TYPES_double
 }
 
 // -------------------------------------------------------------------------
-template< class _TImage, class _TDMap >
+template< class _TImage, class _TScalar >
 void cpPluginsImageDistanceMaps::SignedMaurerDistanceMapImageFilter::
-_GD1( _TImage* image )
+_GD2( _TImage* image )
 {
+  typedef itk::Image< _TScalar, _TImage::ImageDimension >  _TDMap;
   typedef
     itk::SignedMaurerDistanceMapImageFilter< _TImage, _TDMap >
     _TFilter;
index 1a89167f0c3c7d5c8c3df8a9434aef16a13a0319..dabbaccf7552f4ec766c82fa013e40a07fa4fb40 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __cpPluginsImageDistanceMaps__SignedMaurerDistanceMapImageFilter__h__
 #define __cpPluginsImageDistanceMaps__SignedMaurerDistanceMapImageFilter__h__
 
-#include <plugins/cpPluginsImageDistanceMaps_Export.h>
+#include <cpPluginsImageDistanceMaps_Export.h>
 #include <cpPlugins/BaseObjects/ProcessObject.h>
 
 namespace cpPluginsImageDistanceMaps
@@ -19,10 +19,13 @@ namespace cpPluginsImageDistanceMaps
 
   protected:
     template< class _TImage >
-      inline void _GD0( _TImage* image );
+    inline void _GD0( _TImage* image );
 
-    template< class _TImage, class _TDMap >
-      inline void _GD1( _TImage* image );
+    template< class _TImage >
+    inline void _GD1( _TImage* image );
+
+    template< class _TImage, class _TScalar >
+    inline void _GD2( _TImage* image );
   };
 
 } // ecapseman
index 8273be77cd7dad5568d6f696210dda8f8d3e2fd4..e1166f9bd8fe1acfe01721e98e9988cbd62f1eee 100644 (file)
@@ -11,8 +11,11 @@ cpPluginsImageMeshFilters::MarchingCubes::
 MarchingCubes( )
   : Superclass( )
 {
-  this->_ConfigureInput< cpPlugins::DataObjects::Image >( "Input", true, false );
-  this->_ConfigureOutput< cpPlugins::DataObjects::Mesh >( "Output" );
+  typedef cpPlugins::DataObjects::Image _TImage;
+  typedef cpPlugins::DataObjects::Mesh  _TMesh;
+
+  this->_ConfigureInput< _TImage >( "Input", true, false );
+  this->_ConfigureOutput< _TMesh >( "Output" );
   this->m_Parameters.ConfigureAsRealList( "Thresholds" );
 }
 
index 267c3936786e73bc43ebabd73f5ba911dbd6d9ba..c742ca36cbb954df03f2f07c5b52afeb89f8241d 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __CPPLUGINSIMAGEMESH__MARCHINGCUBES__H__
-#define __CPPLUGINSIMAGEMESH__MARCHINGCUBES__H__
+#ifndef __cpPluginsImageMeshFilters__MarchingCubes__h__
+#define __cpPluginsImageMeshFilters__MarchingCubes__h__
 
 #include <cpPluginsImageMeshFilters_Export.h>
 #include <cpPlugins/BaseObjects/ProcessObject.h>
@@ -20,6 +20,6 @@ namespace cpPluginsImageMeshFilters
 
 } // ecapseman
 
-#endif // __CPPLUGINSIMAGEMESH__MARCHINGCUBES__H__
+#endif // __cpPluginsImageMeshFilters__MarchingCubes__h__
 
 // eof - $RCSfile$
index b233c1bba854f8e0b08938a6e00501556d286ce6..1cb276c15d153dba748b2b83203c268685acf33d 100644 (file)
@@ -24,10 +24,10 @@ namespace cpPluginsImageMeshFilters
 
   protected:
     template< class _TMesh >
-      inline void _GD0_2D( _TMesh* mesh );
+    inline void _GD0_2D( _TMesh* mesh );
 
     template< class _TMesh >
-      inline void _GD0_3D( _TMesh* mesh );
+    inline void _GD0_3D( _TMesh* mesh );
   };
 
 } // ecapseman
index d726feda2f81dcec37ed80065dc011b7b12ddc0f..0246a19363d11dace969286d48a81c9cce4783d7 100644 (file)
@@ -30,12 +30,12 @@ RandomImageSource( )
   pixels.push_back( "long" );
   pixels.push_back( "ulong" );
 #endif // cpPlugins_CONFIG_INTEGER_TYPES_long
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_float
   pixels.push_back( "float" );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_float
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_double
+#endif // cpPlugins_CONFIG_REAL_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_double
   pixels.push_back( "double" );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_double
+#endif // cpPlugins_CONFIG_REAL_TYPES_double
   this->m_Parameters.ConfigureAsChoices( "PixelType", pixels );
 
   std::vector< std::string > dims;
@@ -67,27 +67,27 @@ _GenerateData( )
   bool success = false;
   auto pixel = this->m_Parameters.GetSelectedChoice( "PixelType" );
 #ifdef cpPlugins_CONFIG_INTEGER_TYPES_char
-  if( pixel == "char"   ) success = this->_GD0< char >( );
-  if( pixel == "uchar"  ) success = this->_GD0< unsigned char >( );
+  if( pixel == "char" ) success = this->_GD0< char >( );
+  if( pixel == "uchar" ) success = this->_GD0< unsigned char >( );
 #endif // cpPlugins_CONFIG_INTEGER_TYPES_char
 #ifdef cpPlugins_CONFIG_INTEGER_TYPES_short
-  if( pixel == "short"  ) success = this->_GD0< short >( );
+  if( pixel == "short" ) success = this->_GD0< short >( );
   if( pixel == "ushort" ) success = this->_GD0< unsigned short >( );
 #endif // cpPlugins_CONFIG_INTEGER_TYPES_short
 #ifdef cpPlugins_CONFIG_INTEGER_TYPES_int
-  if( pixel == "int"    ) success = this->_GD0< int >( );
-  if( pixel == "uint"   ) success = this->_GD0< unsigned int >( );
+  if( pixel == "int" ) success = this->_GD0< int >( );
+  if( pixel == "uint" ) success = this->_GD0< unsigned int >( );
 #endif // cpPlugins_CONFIG_INTEGER_TYPES_int
 #ifdef cpPlugins_CONFIG_INTEGER_TYPES_long
-  if( pixel == "long"   ) success = this->_GD0< long >( );
-  if( pixel == "ulong"  ) success = this->_GD0< unsigned long >( );
+  if( pixel == "long" ) success = this->_GD0< long >( );
+  if( pixel == "ulong" ) success = this->_GD0< unsigned long >( );
 #endif // cpPlugins_CONFIG_INTEGER_TYPES_long
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_float
-  if( pixel == "float"  ) success = this->_GD0< float >( );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_float
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_double
+#ifdef cpPlugins_CONFIG_REAL_TYPES_float
+  if( pixel == "float" ) success = this->_GD0< float >( );
+#endif // cpPlugins_CONFIG_REAL_TYPES_float
+#ifdef cpPlugins_CONFIG_REAL_TYPES_double
   if( pixel == "double" ) success = this->_GD0< double >( );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_double
+#endif // cpPlugins_CONFIG_REAL_TYPES_double
   if( !success )
     this->_Error( "Invalid pixel type." );
 }
index 0d640e84cbb93fdeb01247d4c3c6859e65f5e742..16f1f8032b7ce8830deff0354c87b3f278bdbec4 100644 (file)
@@ -10,12 +10,7 @@ AppendMeshesFilter( )
 {
   typedef cpPlugins::DataObjects::Mesh _TMesh;
 
-  this->_ConfigureInput< _TMesh >( "Input0", true, false );
-  this->_ConfigureInput< _TMesh >( "Input1", true, false );
-  this->_ConfigureInput< _TMesh >( "Input2", false, false );
-  this->_ConfigureInput< _TMesh >( "Input3", false, false );
-  this->_ConfigureInput< _TMesh >( "Input4", false, false );
-  this->_ConfigureInput< _TMesh >( "Input5", false, false );
+  this->_ConfigureInput< _TMesh >( "Inputs", true, true );
   this->_ConfigureOutput< _TMesh >( "Output" );
 }
 
@@ -29,25 +24,11 @@ cpPluginsMeshFilters::AppendMeshesFilter::
 void cpPluginsMeshFilters::AppendMeshesFilter::
 _GenerateData( )
 {
-  auto m0 = this->GetInputData< vtkPolyData >( "Input0" );
-  auto m1 = this->GetInputData< vtkPolyData >( "Input1" );
-  auto m2 = this->GetInput( "Input2" );
-  auto m3 = this->GetInput( "Input3" );
-  auto m4 = this->GetInput( "Input4" );
-  auto m5 = this->GetInput( "Input5" );
-
-  if( m0 == NULL || m1 == NULL )
-    this->_Error( "Invalid inputs." );
-
   auto filter = this->_CreateVTK< vtkAppendPolyData >( );
-  filter->AddInputData( m0 );
-  filter->AddInputData( m1 );
-  if( m2 != NULL ) filter->AddInputData( m2->GetVTK< vtkPolyData >( ) );
-  if( m3 != NULL ) filter->AddInputData( m3->GetVTK< vtkPolyData >( ) );
-  if( m4 != NULL ) filter->AddInputData( m4->GetVTK< vtkPolyData >( ) );
-  if( m5 != NULL ) filter->AddInputData( m5->GetVTK< vtkPolyData >( ) );
+  unsigned int nInputs = this->GetInputSize( "Inputs" );
+  for( unsigned int i = 0; i < nInputs; ++i )
+    filter->AddInputData( this->GetInputData< vtkPolyData >( "Inputs", i ) );
   filter->Update( );
-
   this->GetOutput( "Output" )->SetVTK( filter->GetOutput( ) );
 }