]> Creatis software - FrontAlgorithms.git/commitdiff
...
authorLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Tue, 29 Nov 2016 16:05:34 +0000 (11:05 -0500)
committerLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Tue, 29 Nov 2016 16:05:34 +0000 (11:05 -0500)
41 files changed:
CMakeLists.txt
cmake/FrontAlgorithmsConfig.cmake.in [deleted file]
cmake/Options.cmake [deleted file]
lib/CMakeLists.txt
lib/fpa/Config.cxx [deleted file]
lib/fpa/Config.h [moved from lib/fpa/Config.h.in with 59% similarity]
lib/fpaInstances/CMakeLists.txt
lib/fpaInstances/DataObjects.i
lib/fpaInstances/Filters.i
plugins/CMakeLists.txt
plugins/DijkstraFunctors/DijkstraFunctors.i [new file with mode: 0644]
plugins/DijkstraFunctors/ExtractPathFromMinimumSpanningTree.cxx [moved from plugins/Plugins/ExtractPathFromMinimumSpanningTree.cxx with 87% similarity]
plugins/DijkstraFunctors/ExtractPathFromMinimumSpanningTree.h [new file with mode: 0644]
plugins/DijkstraFunctors/GaussianModelCost.cxx [moved from plugins/Plugins/GaussianModelCost.cxx with 84% similarity]
plugins/DijkstraFunctors/GaussianModelCost.h [moved from plugins/Plugins/GaussianModelCost.h with 73% similarity]
plugins/DijkstraFunctors/InvertCost.cxx [moved from plugins/Plugins/InvertCost.cxx with 87% similarity]
plugins/DijkstraFunctors/InvertCost.h [moved from plugins/Plugins/InvertCost.h with 73% similarity]
plugins/DijkstraFunctors/SimpleImageDijkstraCost.cxx [moved from plugins/Plugins/SimpleImageDijkstraCost.cxx with 85% similarity]
plugins/DijkstraFunctors/SimpleImageDijkstraCost.h [moved from plugins/Plugins/SimpleImageDijkstraCost.h with 77% similarity]
plugins/ImageAlgorithms/BaseFilter.cxx [moved from plugins/Plugins/BaseImageFilter.cxx with 76% similarity]
plugins/ImageAlgorithms/BaseFilter.h [new file with mode: 0644]
plugins/ImageAlgorithms/Dijkstra.cxx [moved from plugins/Plugins/ImageDijkstra.cxx with 62% similarity]
plugins/ImageAlgorithms/Dijkstra.h [new file with mode: 0644]
plugins/ImageAlgorithms/ImageAlgorithms.i [new file with mode: 0644]
plugins/ImageAlgorithms/RegionGrow.cxx [moved from plugins/Plugins/ImageRegionGrow.cxx with 53% similarity]
plugins/ImageAlgorithms/RegionGrow.h [new file with mode: 0644]
plugins/ImageAlgorithms/SkeletonFilter.cxx [moved from plugins/Plugins/SkeletonFilter.cxx with 89% similarity]
plugins/ImageAlgorithms/SkeletonFilter.h [moved from plugins/Plugins/SkeletonFilter.h with 50% similarity]
plugins/Plugins/BaseImageFilter.h [deleted file]
plugins/Plugins/ExtractPathFromMinimumSpanningTree.h [deleted file]
plugins/Plugins/ImageDijkstra.h [deleted file]
plugins/Plugins/ImageRegionGrow.h [deleted file]
plugins/Plugins/RegionGrowBinaryThreshold.cxx [deleted file]
plugins/Plugins/RegionGrowBinaryThreshold.h [deleted file]
plugins/Plugins/RegionGrowBinaryThresholdWithSeeds.h [deleted file]
plugins/Plugins/SimpleImageNeighborhood.cxx [deleted file]
plugins/Plugins/SimpleImageNeighborhood.h [deleted file]
plugins/Plugins/fpaPlugins.i [deleted file]
plugins/RegionGrowFunctors/BinaryThreshold.cxx [moved from plugins/Plugins/RegionGrowBinaryThresholdWithSeeds.cxx with 55% similarity]
plugins/RegionGrowFunctors/BinaryThreshold.h [new file with mode: 0644]
plugins/RegionGrowFunctors/RegionGrowFunctors.i [new file with mode: 0644]

index 3cdfd45fd6997d9b69a12c5d0053cad493da1b48..a5fba660ca6975b8c30b4b5d1c5aeeafae1b7f14 100644 (file)
@@ -35,9 +35,16 @@ SET(prj_SHORT_VERSION "${prj_MAJOR_VERSION}")
 ## == Functions, packages and options ==
 ## =====================================
 
-OPTION(USE_cpPlugins "Build cpPlugins-based code" OFF)
+FIND_PACKAGE(cpPlugins QUIET)
+IF(cpPlugins_DIR)
+  OPTION(USE_cpPlugins "Build cpPlugins-based code" ON)
+ELSE(cpPlugins_DIR)
+  OPTION(USE_cpPlugins "Build cpPlugins-based code" OFF)
+  MARK_AS_ADVANCED(FORCE cpPlugins_DIR)
+ENDIF(cpPlugins_DIR)
 IF(USE_cpPlugins)
-  FIND_PACKAGE(cpPlugins REQUIRED)
+  FIND_PACKAGE(cpPlugins)
+  MARK_AS_ADVANCED(CLEAR cpPlugins_DIR)
 ENDIF(USE_cpPlugins)
 INCLUDE(cmake/Restrictions.cmake)
 INCLUDE(cmake/KitwareTools.cmake)
@@ -48,7 +55,6 @@ INCLUDE(cmake/Functions.cmake)
 ## == Build different parts ==
 ## ===========================
 
-## SUBDIRS(appli cmake lib plugins)
 SUBDIRS(lib plugins)
 
 ## eof - $RCSfile$
diff --git a/cmake/FrontAlgorithmsConfig.cmake.in b/cmake/FrontAlgorithmsConfig.cmake.in
deleted file mode 100644 (file)
index 097bce7..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-## ================================
-## == Find cpPlugins-cmake tools ==
-## ================================
-
-## ====================
-## == Find libraries ==
-## ====================
-
-SET(
-  _all_libs
-  "@fpa_LIB@"
-  "@fpa_Instances@"
-  )
-SET(fpa_Instances "@fpa_Instances@")
-
-SET(_l_locations)
-FOREACH(_l ${_all_libs})
-  IF(MSVC)
-    FIND_LIBRARY(
-      ${_l}_LIB NAMES ${_l}
-      HINTS
-      @PROJECT_BINARY_DIR@/$(ConfigurationName)
-      @CMAKE_INSTALL_PREFIX@/bin
-      @CMAKE_INSTALL_PREFIX@/lib
-      )
-  ELSE(MSVC)
-    FIND_LIBRARY(
-      ${_l}_LIB NAMES ${_l}
-      HINTS
-      @PROJECT_BINARY_DIR@
-      @CMAKE_INSTALL_PREFIX@/bin
-      @CMAKE_INSTALL_PREFIX@/lib
-      )
-  ENDIF(MSVC)
-  IF(${_l}_LIB)
-    MARK_AS_ADVANCED(FORCE ${_l}_LIB)
-    GET_FILENAME_COMPONENT(_dir ${${_l}_LIB} DIRECTORY)
-    LIST(APPEND _l_locations ${_dir})
-  ENDIF(${_l}_LIB)
-ENDFOREACH(_l)
-IF(_l_locations)
-  LIST(REMOVE_DUPLICATES _l_locations)
-  LINK_DIRECTORIES(${_l_locations})
-ENDIF(_l_locations)
-
-## =========================
-## == Include directories ==
-## =========================
-
-## TODO: this is not completely correct!!!
-INCLUDE_DIRECTORIES(
-  @CMAKE_INSTALL_PREFIX@/include
-  @CMAKE_INSTALL_PREFIX@/include/fpa/Instances
-  @PROJECT_SOURCE_DIR@/lib
-  @PROJECT_BINARY_DIR@/lib
-  @PROJECT_SOURCE_DIR@/lib/Instances
-  @PROJECT_BINARY_DIR@/lib/Instances
-  )
-
-## eof - $RCSfile$
diff --git a/cmake/Options.cmake b/cmake/Options.cmake
deleted file mode 100644 (file)
index 0d477c0..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-## ===============================
-## == Some configurable options ==
-## ===============================
-
-
-## eof - $RCSfile$
index 20f87edc2c1de25f4aa9d5eb9313254767cc05a4..8f3b1ffc4b47609521d800558f2358cf592ccc0f 100644 (file)
@@ -1,8 +1,3 @@
-## ======================================
-## == Build a library from a directory ==
-## ======================================
-
-CompileLibFromDir(fpa SHARED fpa)
 
 ## ===================================
 ## == Build instances for cpPlugins ==
diff --git a/lib/fpa/Config.cxx b/lib/fpa/Config.cxx
deleted file mode 100644 (file)
index d881ac9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-// eof - $RCSfile$
similarity index 59%
rename from lib/fpa/Config.h.in
rename to lib/fpa/Config.h
index 1050a244fec50816e064be850f54b9cbb08b398e..c59b1beb4d82b890c452b5cc880b1cd1448746fc 100644 (file)
@@ -1,19 +1,6 @@
 #ifndef __fpa__Config__h__
 #define __fpa__Config__h__
 
-#include <fpa_Export.h>
-
-/*
- * =========================================================================
- * Version numbers and strings
- * =========================================================================
- */
-#define fpa_MAJOR_VERSION   @prj_MAJ_VER@
-#define fpa_MINOR_VERSION   @prj_MIN_VER@
-#define fpa_RELEASE_VERSION @prj_REL_VER@
-#define fpa_VERSION         "@prj_VERSION@"
-#define fpa_SHORT_VERSION   "@prj_SHORT_VERSION@"
-
 /*
  * =========================================================================
  * Language related macros
index 106b22ecee3049f5b01c324d8a2d1efe8854bc4f..e20f9198da46f6de273d5fe7e3eab57eb339aa7f 100644 (file)
@@ -2,31 +2,22 @@
 ## == Compile each instance ==
 ## ===========================
 
-SET(
-  _definitions
-  DataObjects
-  Filters
+INCLUDE_DIRECTORIES(
+  ${PROJECT_SOURCE_DIR}/lib
+  ${PROJECT_BINARY_DIR}/lib
   )
+SET(_pfx fpaInstaces)
 
-SET(_all_libs)
-FOREACH(_d ${_definitions})
-  FILE(GLOB _files ${CMAKE_CURRENT_SOURCE_DIR}/${_d}.*)
-  CreateLib(fpaInstances${_d} SHARED ${_files})
-  TARGET_LINK_LIBRARIES(
-    fpaInstances${_d}
-    ${ITK_LIBRARIES} ${VTK_LIBRARIES}
-    ${cpPlugins_AllInstances}
-    )
-  LIST(APPEND _all_libs fpaInstances${_d})
-ENDFOREACH(_d)
+CreateLib(${_pfx}DataObjects SHARED ${CMAKE_CURRENT_SOURCE_DIR}/DataObjects.i)
+CreateLib(${_pfx}Filters SHARED ${CMAKE_CURRENT_SOURCE_DIR}/Filters.i)
 
-TARGET_LINK_LIBRARIES(
-  fpaInstancesFilters
-  fpaInstancesDataObjects
-  )
+TARGET_LINK_LIBRARIES(${_pfx}DataObjects ${cpPlugins_AllInstances})
+TARGET_LINK_LIBRARIES(${_pfx}Filters ${_pfx}DataObjects)
 
 SET(
-  fpa_AllInstances ${_all_libs}
+  fpa_AllInstances
+  ${_pfx}DataObjects
+  ${_pfx}Filters
   CACHE INTERNAL "All valid instances." FORCE
   )
 
index 79f449db28c36b93512da87f9893ca2f8dba26f9..cf7f883cacb69a3609b466081e3953c91056f358 100644 (file)
@@ -5,9 +5,13 @@ tinclude fpa/Image/Functors/SimpleDijkstraCost:h|hxx
 tinclude fpa/Image/MinimumSpanningTree:h|hxx
 tinclude fpa/Base/MinimumSpanningTree:h|hxx
 
-instances fpa::Image::Functors::SimpleNeighborhood< itk::ImageBase< #process_dims# > >
-instances fpa::Image::Functors::SimpleDijkstraCost< itk::Image< #scalar_pixels#, #process_dims# >, #reals# >
-instances fpa::Base::MinimumSpanningTree< itk::Index< #process_dims# >, cpExtensions::DataStructures::PolyLineParametricPath< #process_dims# >, itk::Image< itk::Offset< #process_dims# >, #process_dims# > >
-instances fpa::Image::MinimumSpanningTree< #process_dims# >
+cinclude set
+tinclude itkSimpleDataObjectDecorator:h|hxx
+instances itk::SimpleDataObjectDecorator< std::set< itk::Index< #pdims# >, itk::Functor::IndexLexicographicCompare< #pdims# > > >
+
+instances fpa::Image::Functors::SimpleNeighborhood< itk::ImageBase< #pdims# > >
+instances fpa::Image::Functors::SimpleDijkstraCost< itk::Image< #scalar_types#, #pdims# >, #real_types# >
+instances fpa::Base::MinimumSpanningTree< itk::Index< #pdims# >, cpExtensions::DataStructures::PolyLineParametricPath< #pdims# >, itk::Image< itk::Offset< #pdims# >, #pdims# > >
+instances fpa::Image::MinimumSpanningTree< #pdims# >
 
 ** eof - $RCSfile$
index e019334c9998429617f2b4de3c0bf5aea66234ef..60502a2283a5eff1943d255e46535e61eb889d59 100644 (file)
@@ -1,12 +1,12 @@
 header #define ITK_MANUAL_INSTANTIATION
 
-define i_pixels=#scalar_pixels#
-define o_pixels=#scalar_pixels#
+define i_scalars=#scalar_types#
+define o_scalars=#scalar_types#
 
 tinclude fpa/Base/Algorithm:h|hxx
 tinclude fpa/Image/Algorithm:h|hxx
 
-instances fpa::Base::Algorithm< itk::ImageToImageFilter< itk::Image< #i_pixels#, #process_dims# >, itk::Image< #o_pixels#, #process_dims# > >, itk::Index< #process_dims# >, #o_pixels# >
-instances fpa::Image::Algorithm< itk::Image< #i_pixels#, #process_dims# >, itk::Image< #o_pixels#, #process_dims# > >
+instances fpa::Base::Algorithm< itk::ImageToImageFilter< itk::Image< #i_scalars#, #pdims# >, itk::Image< #o_scalars#, #pdims# > >, itk::Index< #pdims# >, #o_scalars# >
+instances fpa::Image::Algorithm< itk::Image< #i_scalars#, #pdims# >, itk::Image< #o_scalars#, #pdims# > >
 
 ** eof - $RCSfile$
index 7fcc8fcf130b4be386feea7484514214b65fb9be..8a672172ddb183a9f7a27eef39986a9e451a6512 100644 (file)
@@ -6,14 +6,28 @@ IF(USE_cpPlugins)
   INCLUDE_DIRECTORIES(
     ${PROJECT_SOURCE_DIR}/lib
     ${PROJECT_BINARY_DIR}/lib
+    ${PROJECT_SOURCE_DIR}/plugins
+    ${PROJECT_BINARY_DIR}/plugins
     )
-  CreatePlugin(fpaPlugins Plugins)
-  TARGET_LINK_LIBRARIES(
-    fpaPlugins
-    cpPlugins
-    ${cpPlugins_AllInstances}
-    ${fpa_AllInstances}
+
+  SET(
+    _dirs
+    ImageAlgorithms
+    RegionGrowFunctors
+    DijkstraFunctors
     )
+  FOREACH(_d ${_dirs})
+    CreatePlugin(
+      fpaPlugins${_d} ${CMAKE_CURRENT_SOURCE_DIR}/${_d}
+      )
+    TARGET_LINK_LIBRARIES(
+      fpaPlugins${_d}
+      cpPlugins cpPluginsDataObjects
+      ${fpa_AllInstances}
+      )
+  ENDFOREACH(_d)
+  TARGET_LINK_LIBRARIES(fpaPluginsImageAlgorithms fpaPluginsDijkstraFunctors)
+
 ENDIF(USE_cpPlugins)
 
 ## eof - $RCSfile$
\ No newline at end of file
diff --git a/plugins/DijkstraFunctors/DijkstraFunctors.i b/plugins/DijkstraFunctors/DijkstraFunctors.i
new file mode 100644 (file)
index 0000000..b251418
--- /dev/null
@@ -0,0 +1,12 @@
+header #define ITK_MANUAL_INSTANTIATION
+
+define i_reals=#real_types#
+define o_reals=#real_types#
+tinclude fpa/Base/Functors/Inverse:h|hxx
+tinclude fpa/Base/Functors/GaussianModel:h|hxx
+
+instances fpa::Base::Functors::Inverse< #i_reals#, #o_reals# >
+instances fpa::Base::Functors::GaussianModel< #i_reals#, #o_reals# >
+
+
+** eof - $RCSfile$
similarity index 87%
rename from plugins/Plugins/ExtractPathFromMinimumSpanningTree.cxx
rename to plugins/DijkstraFunctors/ExtractPathFromMinimumSpanningTree.cxx
index 80d41115d40f0574244f16ecb58da51b154713b2..e41c26409ecc54f13f90a383573db0cf17d2085d 100644 (file)
@@ -1,11 +1,11 @@
-#include <Plugins/ExtractPathFromMinimumSpanningTree.h>
+#include <DijkstraFunctors/ExtractPathFromMinimumSpanningTree.h>
 #include <cpInstances/Image.h>
 #include <cpInstances/PolyLineParametricPath.h>
 #include <vtkPolyData.h>
 #include <fpa/Image/MinimumSpanningTree.h>
 
 // -------------------------------------------------------------------------
-fpaPlugins::ExtractPathFromMinimumSpanningTree::
+fpaPluginsDijkstraFunctors::ExtractPathFromMinimumSpanningTree::
 ExtractPathFromMinimumSpanningTree( )
   : Superclass( )
 {
@@ -19,13 +19,13 @@ ExtractPathFromMinimumSpanningTree( )
 }
 
 // -------------------------------------------------------------------------
-fpaPlugins::ExtractPathFromMinimumSpanningTree::
+fpaPluginsDijkstraFunctors::ExtractPathFromMinimumSpanningTree::
 ~ExtractPathFromMinimumSpanningTree( )
 {
 }
 
 // -------------------------------------------------------------------------
-void fpaPlugins::ExtractPathFromMinimumSpanningTree::
+void fpaPluginsDijkstraFunctors::ExtractPathFromMinimumSpanningTree::
 _GenerateData( )
 {
   typedef fpa::Image::MinimumSpanningTree< 2 > _TMST2;
@@ -40,7 +40,7 @@ _GenerateData( )
 
 // -------------------------------------------------------------------------
 template< class _TMST >
-void fpaPlugins::ExtractPathFromMinimumSpanningTree::
+void fpaPluginsDijkstraFunctors::ExtractPathFromMinimumSpanningTree::
 _GD0( _TMST* mst )
 {
   typedef typename _TMST::IndexType _TIndex;
diff --git a/plugins/DijkstraFunctors/ExtractPathFromMinimumSpanningTree.h b/plugins/DijkstraFunctors/ExtractPathFromMinimumSpanningTree.h
new file mode 100644 (file)
index 0000000..4e4b386
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef __fpaPluginsDijkstraFunctors__ExtractPathFromMinimumSpanningTree__h__
+#define __fpaPluginsDijkstraFunctors__ExtractPathFromMinimumSpanningTree__h__
+
+#include <fpaPluginsDijkstraFunctors_Export.h>
+#include <cpPlugins/BaseObjects/ProcessObject.h>
+
+namespace fpaPluginsDijkstraFunctors
+{
+  /**
+   */
+  class fpaPluginsDijkstraFunctors_EXPORT ExtractPathFromMinimumSpanningTree
+    : public cpPlugins::BaseObjects::ProcessObject
+  {
+    cpPluginsObject(
+      ExtractPathFromMinimumSpanningTree,
+      cpPlugins::BaseObjects::ProcessObject,
+      fpaDijkstraFunctors
+      );
+
+  protected:
+    template< class _TMST >
+    inline void _GD0( _TMST* mst );
+  };
+
+} // ecapseman
+
+#endif // __fpaPluginsDijkstraFunctors__ExtractPathFromMinimumSpanningTree__h__
+
+// eof - $RCSfile$
similarity index 84%
rename from plugins/Plugins/GaussianModelCost.cxx
rename to plugins/DijkstraFunctors/GaussianModelCost.cxx
index c84f5e70f46d131d8233eedaac3c6e60144e68af..8d796ee5ee4fe26884e564741f86c0b53fc8c029 100644 (file)
@@ -1,10 +1,10 @@
-#include <Plugins/GaussianModelCost.h>
+#include <DijkstraFunctors/GaussianModelCost.h>
 #include <cpInstances/Image.h>
 
 #include <fpa/Base/Functors/GaussianModel.h>
 
 // -------------------------------------------------------------------------
-fpaPlugins::GaussianModelCost::
+fpaPluginsDijkstraFunctors::GaussianModelCost::
 GaussianModelCost( )
   : Superclass( )
 {
@@ -19,13 +19,13 @@ GaussianModelCost( )
 }
 
 // -------------------------------------------------------------------------
-fpaPlugins::GaussianModelCost::
+fpaPluginsDijkstraFunctors::GaussianModelCost::
 ~GaussianModelCost( )
 {
 }
 
 // -------------------------------------------------------------------------
-void fpaPlugins::GaussianModelCost::
+void fpaPluginsDijkstraFunctors::GaussianModelCost::
 _GenerateData( )
 {
   auto rtype = this->m_Parameters.GetSelectedChoice( "ResultType" );
@@ -35,7 +35,7 @@ _GenerateData( )
 
 // -------------------------------------------------------------------------
 template< class _TOutput >
-void fpaPlugins::GaussianModelCost::
+void fpaPluginsDijkstraFunctors::GaussianModelCost::
 _GD0( )
 {
   typedef fpa::Base::Functors::GaussianModel< _TOutput, _TOutput > _TFunctor;
similarity index 73%
rename from plugins/Plugins/GaussianModelCost.h
rename to plugins/DijkstraFunctors/GaussianModelCost.h
index b4d276394e10a1a788e0a7c1819b40d02366c09c..cab177d98fc95cdb972ad7bedf1d7c24e3634b58 100644 (file)
@@ -1,20 +1,20 @@
 #ifndef __fpa__Plugins__GaussianModelCost__h__
 #define __fpa__Plugins__GaussianModelCost__h__
 
-#include <fpaPlugins_Export.h>
+#include <fpaPluginsDijkstraFunctors_Export.h>
 #include <cpPlugins/BaseObjects/ProcessObject.h>
 
-namespace fpaPlugins
+namespace fpaPluginsDijkstraFunctors
 {
   /**
    */
-  class fpaPlugins_EXPORT GaussianModelCost
+  class fpaPluginsDijkstraFunctors_EXPORT GaussianModelCost
     : public cpPlugins::BaseObjects::ProcessObject
   {
     cpPluginsObject(
       GaussianModelCost,
       cpPlugins::BaseObjects::ProcessObject,
-      fpaFunctors
+      fpaDijkstraFunctors
       );
 
   protected:
similarity index 87%
rename from plugins/Plugins/InvertCost.cxx
rename to plugins/DijkstraFunctors/InvertCost.cxx
index 4abfe339c4b80a04c13ae0c39c5baedcc7c51d5c..be8e8f9a4d0a45f72a7b00fc4482716a029b84d1 100644 (file)
@@ -1,10 +1,10 @@
-#include <Plugins/InvertCost.h>
+#include <DijkstraFunctors/InvertCost.h>
 #include <cpInstances/Image.h>
 
 #include <fpa/Base/Functors/Inverse.h>
 
 // -------------------------------------------------------------------------
-fpaPlugins::InvertCost::
+fpaPluginsDijkstraFunctors::InvertCost::
 InvertCost( )
   : Superclass( )
 {
@@ -20,13 +20,13 @@ InvertCost( )
 }
 
 // -------------------------------------------------------------------------
-fpaPlugins::InvertCost::
+fpaPluginsDijkstraFunctors::InvertCost::
 ~InvertCost( )
 {
 }
 
 // -------------------------------------------------------------------------
-void fpaPlugins::InvertCost::
+void fpaPluginsDijkstraFunctors::InvertCost::
 _GenerateData( )
 {
   auto rtype = this->m_Parameters.GetSelectedChoice( "ResultType" );
@@ -36,7 +36,7 @@ _GenerateData( )
 
 // -------------------------------------------------------------------------
 template< class _TOutput >
-void fpaPlugins::InvertCost::
+void fpaPluginsDijkstraFunctors::InvertCost::
 _GD0( )
 {
   typedef fpa::Base::Functors::Inverse< _TOutput, _TOutput > _TFunctor;
similarity index 73%
rename from plugins/Plugins/InvertCost.h
rename to plugins/DijkstraFunctors/InvertCost.h
index 2a3a738b445118582299bdac8aa3c37b31b01bfd..7788d78e0e40af4146db0b41279b1fa364725143 100644 (file)
@@ -1,20 +1,20 @@
 #ifndef __fpa__Plugins__InvertCost__h__
 #define __fpa__Plugins__InvertCost__h__
 
-#include <fpaPlugins_Export.h>
+#include <fpaPluginsDijkstraFunctors_Export.h>
 #include <cpPlugins/BaseObjects/ProcessObject.h>
 
-namespace fpaPlugins
+namespace fpaPluginsDijkstraFunctors
 {
   /**
    */
-  class fpaPlugins_EXPORT InvertCost
+  class fpaPluginsDijkstraFunctors_EXPORT InvertCost
     : public cpPlugins::BaseObjects::ProcessObject
   {
     cpPluginsObject(
       InvertCost,
       cpPlugins::BaseObjects::ProcessObject,
-      fpaFunctors
+      fpaDijkstraFunctors
       );
 
   protected:
similarity index 85%
rename from plugins/Plugins/SimpleImageDijkstraCost.cxx
rename to plugins/DijkstraFunctors/SimpleImageDijkstraCost.cxx
index dbd3f7e1e3aa8d9c6c7023e89c318f6d5587999e..e825a162f3a376db37cdd170f98a89b5ea1f0a89 100644 (file)
@@ -1,12 +1,11 @@
-#include <Plugins/SimpleImageDijkstraCost.h>
+#include <DijkstraFunctors/SimpleImageDijkstraCost.h>
 #include <cpInstances/Image.h>
-#include <cpInstances/Image_Demanglers.h>
 
 #include <itkImage.h>
 #include <fpa/Image/Functors/SimpleDijkstraCost.h>
 
 // -------------------------------------------------------------------------
-fpaPlugins::SimpleImageDijkstraCost::
+fpaPluginsDijkstraFunctors::SimpleImageDijkstraCost::
 SimpleImageDijkstraCost( )
   : Superclass( )
 {
@@ -25,13 +24,13 @@ SimpleImageDijkstraCost( )
 }
 
 // -------------------------------------------------------------------------
-fpaPlugins::SimpleImageDijkstraCost::
+fpaPluginsDijkstraFunctors::SimpleImageDijkstraCost::
 ~SimpleImageDijkstraCost( )
 {
 }
 
 // -------------------------------------------------------------------------
-void fpaPlugins::SimpleImageDijkstraCost::
+void fpaPluginsDijkstraFunctors::SimpleImageDijkstraCost::
 _GenerateData( )
 {
   auto o = this->GetInputData( "Input" );
@@ -41,7 +40,7 @@ _GenerateData( )
 
 // -------------------------------------------------------------------------
 template< class _TImage >
-void fpaPlugins::SimpleImageDijkstraCost::
+void fpaPluginsDijkstraFunctors::SimpleImageDijkstraCost::
 _GD0( _TImage* image )
 {
   auto rtype = this->m_Parameters.GetSelectedChoice( "ResultType" );
@@ -51,7 +50,7 @@ _GD0( _TImage* image )
 
 // -------------------------------------------------------------------------
 template< class _TImage, class _TOutput >
-void fpaPlugins::SimpleImageDijkstraCost::
+void fpaPluginsDijkstraFunctors::SimpleImageDijkstraCost::
 _GD1( _TImage* image )
 {
   typedef
similarity index 77%
rename from plugins/Plugins/SimpleImageDijkstraCost.h
rename to plugins/DijkstraFunctors/SimpleImageDijkstraCost.h
index f5d5968cec0627df32216ac4318f0fc3850f646b..64fa18c6255a38ce7886d31e794d074fb63ec383 100644 (file)
@@ -1,20 +1,20 @@
 #ifndef __fpa__Plugins__SimpleImageDijkstraCost__h__
 #define __fpa__Plugins__SimpleImageDijkstraCost__h__
 
-#include <fpaPlugins_Export.h>
+#include <fpaPluginsDijkstraFunctors_Export.h>
 #include <cpPlugins/BaseObjects/ProcessObject.h>
 
-namespace fpaPlugins
+namespace fpaPluginsDijkstraFunctors
 {
   /**
    */
-  class fpaPlugins_EXPORT SimpleImageDijkstraCost
+  class fpaPluginsDijkstraFunctors_EXPORT SimpleImageDijkstraCost
     : public cpPlugins::BaseObjects::ProcessObject
   {
     cpPluginsObject(
       SimpleImageDijkstraCost,
       cpPlugins::BaseObjects::ProcessObject,
-      fpaFunctors
+      fpaDijkstraFunctors
       );
 
   protected:
similarity index 76%
rename from plugins/Plugins/BaseImageFilter.cxx
rename to plugins/ImageAlgorithms/BaseFilter.cxx
index 005924606939403d75d69a57c025c598a55a6ae3..da278a7167d28c9739b3b18a767ebb19ea42c53b 100644 (file)
@@ -1,9 +1,9 @@
-#include <Plugins/BaseImageFilter.h>
+#include <ImageAlgorithms/BaseFilter.h>
 #include <cpInstances/Image.h>
 
 // -------------------------------------------------------------------------
-fpaPlugins::BaseImageFilter::
-BaseImageFilter( )
+fpaPluginsImageAlgorithms::BaseFilter::
+BaseFilter( )
   : Superclass( )
 {
   typedef cpPlugins::BaseObjects::DataObject _TData;
@@ -14,13 +14,14 @@ BaseImageFilter( )
   this->_ConfigureInput< _TData >( "Neighborhood", false, false );
   this->_ConfigureOutput< _TImage >( "Output" );
 
+  this->m_Parameters.ConfigureAsUint( "NeighborhoodOrder", 1 );
   this->m_Parameters.ConfigureAsBool( "VisualDebug", false );
   this->m_Parameters.ConfigureAsBool( "StopAtOneFront", false );
 }
 
 // -------------------------------------------------------------------------
-fpaPlugins::BaseImageFilter::
-~BaseImageFilter( )
+fpaPluginsImageAlgorithms::BaseFilter::
+~BaseFilter( )
 {
 }
 
diff --git a/plugins/ImageAlgorithms/BaseFilter.h b/plugins/ImageAlgorithms/BaseFilter.h
new file mode 100644 (file)
index 0000000..11c97ca
--- /dev/null
@@ -0,0 +1,103 @@
+#ifndef __fpaPluginsImageAlgorithms__BaseFilter__h__
+#define __fpaPluginsImageAlgorithms__BaseFilter__h__
+
+#include <fpaPluginsImageAlgorithms_Export.h>
+#include <cpPlugins/BaseObjects/ProcessObject.h>
+#include <vtkPolyData.h>
+#include <fpa/Image/Functors/SimpleNeighborhood.h>
+
+namespace fpaPluginsImageAlgorithms
+{
+  /**
+   */
+  class fpaPluginsImageAlgorithms_EXPORT BaseFilter
+    : public cpPlugins::BaseObjects::ProcessObject
+  {
+  public:
+    typedef BaseFilter                            Self;
+    typedef cpPlugins::BaseObjects::ProcessObject Superclass;
+    typedef itk::SmartPointer< Self >             Pointer;
+    typedef itk::SmartPointer< const Self >       ConstPointer;
+
+  public:
+    itkTypeMacro( BaseFilter, cpPlugins::BaseObjects::ProcessObject );
+    cpPlugins_Id_Macro( BaseFilter, fpaImageAlgorithm );
+
+  protected:
+    BaseFilter( );
+    virtual ~BaseFilter( );
+
+    template< class _TFilter, class _TImage >
+    inline void _ConfigureFilter( _TFilter* filter, _TImage* image );
+
+    /* TODO
+
+       template< class _TFilter >
+       inline void _ExecuteFilter( _TFilter* filter );
+
+       template< class _TFilter >
+       inline void _ConfigureDebugger( _TFilter* filter );
+
+       template< class _TFilter >
+       inline void _DeconfigureDebugger( _TFilter* filter );
+    */
+
+  private:
+    // Purposely not implemented.
+    BaseFilter( const Self& other );
+    Self& operator=( const Self& other );
+  };
+
+} // ecapseman
+
+// -------------------------------------------------------------------------
+    template< class _TFilter, class _TImage >
+void fpaPluginsImageAlgorithms::BaseFilter::
+_ConfigureFilter( _TFilter* filter, _TImage* image )
+{
+  typedef typename _TFilter::TNeighborhoodFunction _TNeighborhood;
+  typedef fpa::Image::Functors::SimpleNeighborhood< _TImage > _TSimpleNeigh;
+
+  // Simple configuration
+  filter->SetInput( image );
+  filter->SetStopAtOneFront( this->m_Parameters.GetBool( "StopAtOneFront" ) );
+
+  // Neighborhood function
+  auto neig = this->GetInputData< _TNeighborhood >( "Neighborhood" );
+  if( neig == NULL )
+  {
+    typename _TSimpleNeigh::Pointer sfunc = _TSimpleNeigh::New( );
+    sfunc->SetOrder( this->m_Parameters.GetUint( "NeighborhoodOrder" ) );
+    filter->SetNeighborhoodFunction( sfunc );
+  }
+  else
+    filter->SetNeighborhoodFunction( neig );
+
+  // Assign seeds
+  auto seeds = this->GetInputData< vtkPolyData >( "Seeds" );
+  if( seeds != NULL )
+  {
+    typename _TImage::PointType pnt;
+    typename _TImage::IndexType idx;
+    unsigned int dim =
+      ( _TImage::ImageDimension < 3 )? _TImage::ImageDimension: 3;
+
+    for( int i = 0; i < seeds->GetNumberOfPoints( ); ++i )
+    {
+      double buf[ 3 ];
+      seeds->GetPoint( i, buf );
+      pnt.Fill( 0 );
+      for( unsigned int d = 0; d < dim; ++d )
+        pnt[ d ] = buf[ d ];
+
+      if( image->TransformPhysicalPointToIndex( pnt, idx ) )
+        filter->AddSeed( idx, 0 );
+
+    } // rof
+
+  } // fi
+}
+
+#endif // __fpaPluginsImageAlgorithms__BaseFilter__h__
+
+// eof - $RCSfile$
similarity index 62%
rename from plugins/Plugins/ImageDijkstra.cxx
rename to plugins/ImageAlgorithms/Dijkstra.cxx
index 7c8212ef9f6e80d66ea56afc5a53c72c3602d57d..56be8f1a6590cbd27266a8abcdd1f64934300db8 100644 (file)
@@ -1,17 +1,15 @@
-#include <Plugins/ImageDijkstra.h>
+#include <ImageAlgorithms/Dijkstra.h>
 #include <cpInstances/Image.h>
-#include <cpInstances/Image_Demanglers.h>
 
 #include <fpa/Image/Dijkstra.h>
-#include <vtkPolyData.h>
 
 // -------------------------------------------------------------------------
-fpaPlugins::ImageDijkstra::
-ImageDijkstra( )
+fpaPluginsImageAlgorithms::Dijkstra::
+Dijkstra( )
   : Superclass( )
 {
   typedef cpPlugins::BaseObjects::DataObject _TData;
-  typedef cpInstances::Image      _TMST;
+  typedef cpInstances::Image _TMST;
 
   this->_ConfigureInput< _TData >( "Cost", false, false );
   this->_ConfigureInput< _TData >( "CostConversion", false, false );
@@ -25,13 +23,13 @@ ImageDijkstra( )
 }
 
 // -------------------------------------------------------------------------
-fpaPlugins::ImageDijkstra::
-~ImageDijkstra( )
+fpaPluginsImageAlgorithms::Dijkstra::
+~Dijkstra( )
 {
 }
 
 // -------------------------------------------------------------------------
-void fpaPlugins::ImageDijkstra::
+void fpaPluginsImageAlgorithms::Dijkstra::
 _GenerateData( )
 {
   auto o = this->GetInputData( "Input" );
@@ -41,7 +39,7 @@ _GenerateData( )
 
 // -------------------------------------------------------------------------
 template< class _TImage >
-void fpaPlugins::ImageDijkstra::
+void fpaPluginsImageAlgorithms::Dijkstra::
 _GD0( _TImage* image )
 {
   typedef itk::Image< float, _TImage::ImageDimension >  _TFloat;
@@ -54,55 +52,21 @@ _GD0( _TImage* image )
 
 // -------------------------------------------------------------------------
 template< class _TInputImage, class _TOutputImage >
-void fpaPlugins::ImageDijkstra::
+void fpaPluginsImageAlgorithms::Dijkstra::
 _GD1( _TInputImage* image )
 {
   typedef fpa::Image::Dijkstra< _TInputImage, _TOutputImage > _TFilter;
   typedef typename _TFilter::TCostConversionFunction _TCostConversion;
   typedef typename _TFilter::TCostFunction           _TCost;
-  typedef typename _TFilter::TNeighborhoodFunction   _TNeighborhood;
 
-  // Get functors
-  auto neig = this->GetInputData< _TNeighborhood >( "Neighborhood" );
+  auto filter = this->_CreateITK< _TFilter >( );
+  this->_ConfigureFilter( filter, image );
   auto cost = this->GetInputData< _TCost >( "Cost" );
   auto conv = this->GetInputData< _TCostConversion >( "CostConversion" );
-
-  // Configure filter
-  auto filter = this->_CreateITK< _TFilter >( );
-  filter->SetInput( image );
-  if( neig != NULL )
-    filter->SetNeighborhoodFunction( neig );
   if( cost != NULL )
     filter->SetCostFunction( cost );
   if( conv != NULL )
     filter->SetCostConversionFunction( conv );
-  filter->SetStopAtOneFront( this->m_Parameters.GetBool( "StopAtOneFront" ) );
-
-  // Assign seeds
-  auto seeds = this->GetInputData< vtkPolyData >( "Seeds" );
-  if( seeds != NULL )
-  {
-    typename _TInputImage::PointType pnt;
-    typename _TInputImage::IndexType idx;
-    unsigned int dim =
-      ( _TInputImage::ImageDimension < 3 )? _TInputImage::ImageDimension: 3;
-
-    for( int i = 0; i < seeds->GetNumberOfPoints( ); ++i )
-    {
-      double buf[ 3 ];
-      seeds->GetPoint( i, buf );
-      pnt.Fill( 0 );
-      for( unsigned int d = 0; d < dim; ++d )
-        pnt[ d ] = buf[ d ];
-
-      if( image->TransformPhysicalPointToIndex( pnt, idx ) )
-        filter->AddSeed( idx, 0 );
-
-    } // rof
-
-  } // fi
-
-  // Assign outputs
   filter->Update( );
   this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
   this->GetOutput( "MST" )->SetITK( filter->GetMinimumSpanningTree( ) );
diff --git a/plugins/ImageAlgorithms/Dijkstra.h b/plugins/ImageAlgorithms/Dijkstra.h
new file mode 100644 (file)
index 0000000..5ac2233
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef __fpaPluginsImageAlgorithms__Dijkstra__h__
+#define __fpaPluginsImageAlgorithms__Dijkstra__h__
+
+#include <ImageAlgorithms/BaseFilter.h>
+
+namespace fpaPluginsImageAlgorithms
+{
+  /**
+   */
+  class fpaPluginsImageAlgorithms_EXPORT Dijkstra
+    : public BaseFilter
+  {
+    cpPluginsObject( Dijkstra, BaseFilter, fpaImageAlgorithms );
+
+  protected:
+    template< class _TImage >
+    inline void _GD0( _TImage* image );
+
+    template< class _TInputImage, class _TOutputPixel >
+    inline void _GD1( _TInputImage* image );
+  };
+
+} // ecapseman
+
+#endif // __fpaPluginsImageAlgorithms__Dijkstra__h__
+
+// eof - $RCSfile$
diff --git a/plugins/ImageAlgorithms/ImageAlgorithms.i b/plugins/ImageAlgorithms/ImageAlgorithms.i
new file mode 100644 (file)
index 0000000..9655ca3
--- /dev/null
@@ -0,0 +1,46 @@
+header #define ITK_MANUAL_INSTANTIATION
+
+tinclude fpa/Image/Functors/SimpleNeighborhood:h|hxx
+instances fpa::Image::Functors::SimpleNeighborhood< itk::Image< #scalar_types#, #pdims# > >
+
+cinclude fpa/Base/RegionGrow.hxx
+define all_int_types=#int_types#;#uint_types#
+tinclude fpa/Image/RegionGrow:h|hxx
+instances fpa::Image::RegionGrow< itk::Image< #scalar_types#, #pdims# >, itk::Image< #all_int_types#, #pdims# > >
+
+cinclude fpa/Base/Dijkstra.hxx
+tinclude fpa/Image/Dijkstra:h|hxx
+instances fpa::Image::Dijkstra< itk::Image< #scalar_types#, #pdims# >, itk::Image< #real_types#, #pdims# > >
+
+tinclude fpa/Image/SkeletonFilter:h|hxx
+instances fpa::Image::SkeletonFilter< itk::Image< #real_types#, #pdims# > >
+
+
+
+*define i_real=#real_types#
+*define o_real=#real_types#
+
+*tinclude fpa/Image/Functors/SimpleDijkstraCost:h|hxx
+*tinclude fpa/Base/Functors/Inverse:h|hxx
+*tinclude fpa/Base/Functors/GaussianModel:h|hxx
+*tinclude fpa/Image/Dijkstra:h|hxx
+*tinclude fpa/Image/SkeletonFilter:h|hxx
+*tinclude fpa/Image/Functors/RegionGrowBinaryThreshold:h|hxx
+
+*cinclude itkImage.h
+*cinclude itkSimpleDataObjectDecorator.hxx
+*cinclude fpa/Base/Dijkstra.hxx
+
+*instances fpa::Image::Functors::SimpleNeighborhood< itk::Image< #scalar_pixels#, #process_dims# > >
+*instances fpa::Image::Functors::SimpleDijkstraCost< itk::Image< #scalar_pixels#, #process_dims# >, #real_types# >
+*instances fpa::Image::Functors::RegionGrowBinaryThreshold< itk::Image< #scalar_pixels#, #process_dims# > >
+
+*instances fpa::Base::Functors::Inverse< #i_real#, #o_real# >
+*instances fpa::Base::Functors::GaussianModel< #i_real#, #o_real# >
+
+*instances fpa::Image::Dijkstra< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #real_types#, #process_dims# > >
+*instances fpa::Image::RegionGrow< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #int_types#, #process_dims# > >
+*instances fpa::Image::RegionGrow< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #uint_types#, #process_dims# > >
+*instances fpa::Image::SkeletonFilter< itk::Image< #real_types#, #process_dims# > >
+
+** eof - $RCSfile$
similarity index 53%
rename from plugins/Plugins/ImageRegionGrow.cxx
rename to plugins/ImageAlgorithms/RegionGrow.cxx
index 50562123a1caf7cd50163f088aae4a31169aa2f6..f620b719d8b4041787a1f09284fe71803b8cc8bf 100644 (file)
@@ -1,33 +1,29 @@
-#include <Plugins/ImageRegionGrow.h>
+#include <ImageAlgorithms/RegionGrow.h>
 #include <cpInstances/Image.h>
-#include <cpInstances/Image_Demanglers.h>
 
 #include <fpa/Image/RegionGrow.h>
-#include <vtkPolyData.h>
 
 // -------------------------------------------------------------------------
-fpaPlugins::ImageRegionGrow::
-ImageRegionGrow( )
+fpaPluginsImageAlgorithms::RegionGrow::
+RegionGrow( )
   : Superclass( )
 {
   typedef cpPlugins::BaseObjects::DataObject _TData;
-  typedef cpInstances::Image      _TMST;
 
   this->_ConfigureInput< _TData >( "GrowFunction", true, false );
-
   this->m_Parameters.ConfigureAsInt( "InsideValue", 1 );
   this->m_Parameters.ConfigureAsInt( "OutsideValue", 0 );
   this->m_Parameters.ConfigureAsIntTypesChoices( "ResultType" );
 }
 
 // -------------------------------------------------------------------------
-fpaPlugins::ImageRegionGrow::
-~ImageRegionGrow( )
+fpaPluginsImageAlgorithms::RegionGrow::
+~RegionGrow( )
 {
 }
 
 // -------------------------------------------------------------------------
-void fpaPlugins::ImageRegionGrow::
+void fpaPluginsImageAlgorithms::RegionGrow::
 _GenerateData( )
 {
   auto o = this->GetInputData( "Input" );
@@ -37,79 +33,36 @@ _GenerateData( )
 
 // -------------------------------------------------------------------------
 template< class _TImage >
-void fpaPlugins::ImageRegionGrow::
+void fpaPluginsImageAlgorithms::RegionGrow::
 _GD0( _TImage* image )
 {
   auto rtype = this->m_Parameters.GetSelectedChoice( "ResultType" );
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_char
   if( rtype == "char" ) this->_GD1< _TImage, char >( image );
   if( rtype == "uchar" ) this->_GD1< _TImage, unsigned char >( image );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_char
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_short
   if( rtype == "short" ) this->_GD1< _TImage, short >( image );
   if( rtype == "ushort" ) this->_GD1< _TImage, unsigned short >( image );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_short
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_int
   if( rtype == "int" ) this->_GD1< _TImage, int >( image );
   if( rtype == "uint" ) this->_GD1< _TImage, unsigned int >( image );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_int
-#ifdef cpPlugins_CONFIG_INTEGER_TYPES_long
   if( rtype == "long" ) this->_GD1< _TImage, long >( image );
   if( rtype == "ulong" ) this->_GD1< _TImage, unsigned long >( image );
-#endif // cpPlugins_CONFIG_INTEGER_TYPES_long
 }
 
 // -------------------------------------------------------------------------
 template< class _TInputImage, class _TOutputPixel >
-void fpaPlugins::ImageRegionGrow::
+void fpaPluginsImageAlgorithms::RegionGrow::
 _GD1( _TInputImage* image )
 {
-  std::cout << "--------------> again <-----------------" << std::endl;
-
   typedef
     itk::Image< _TOutputPixel, _TInputImage::ImageDimension >
     _TOutputImage;
   typedef fpa::Image::RegionGrow< _TInputImage, _TOutputImage > _TFilter;
-  typedef typename _TFilter::TGrowFunction           _TGrow;
-  typedef typename _TFilter::TNeighborhoodFunction   _TNeighborhood;
-
-  // Get functors
-  auto neig = this->GetInputData< _TNeighborhood >( "Neighborhood" );
-  auto grow = this->GetInputData< _TGrow >( "GrowFunction" );
+  typedef typename _TFilter::TGrowFunction                      _TGrow;
 
-  // Configure filter
   auto filter = this->_CreateITK< _TFilter >( );
-  filter->SetInput( image );
-  filter->SetGrowFunction( grow );
+  this->_ConfigureFilter( filter, image );
+  filter->SetGrowFunction( this->GetInputData< _TGrow >( "GrowFunction" ) );
   filter->SetInsideValue( this->m_Parameters.GetInt( "InsideValue" ) );
   filter->SetOutsideValue( this->m_Parameters.GetInt( "OutsideValue" ) );
-  filter->SetStopAtOneFront( this->m_Parameters.GetBool( "StopAtOneFront" ) );
-
-  // Assign seeds
-  auto seeds = this->GetInputData< vtkPolyData >( "Seeds" );
-  if( seeds != NULL )
-  {
-    typename _TInputImage::PointType pnt;
-    typename _TInputImage::IndexType idx;
-    unsigned int dim =
-      ( _TInputImage::ImageDimension < 3 )? _TInputImage::ImageDimension: 3;
-
-    for( int i = 0; i < seeds->GetNumberOfPoints( ); ++i )
-    {
-      double buf[ 3 ];
-      seeds->GetPoint( i, buf );
-      pnt.Fill( 0 );
-      for( unsigned int d = 0; d < dim; ++d )
-        pnt[ d ] = buf[ d ];
-
-      if( image->TransformPhysicalPointToIndex( pnt, idx ) )
-        filter->AddSeed( idx, 0 );
-
-    } // rof
-
-  } // fi
-
-  // Assign outputs
   filter->Update( );
   this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
 }
diff --git a/plugins/ImageAlgorithms/RegionGrow.h b/plugins/ImageAlgorithms/RegionGrow.h
new file mode 100644 (file)
index 0000000..f5b49af
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef __fpaPluginsImageAlgorithms__RegionGrow__h__
+#define __fpaPluginsImageAlgorithms__RegionGrow__h__
+
+#include <ImageAlgorithms/BaseFilter.h>
+
+namespace fpaPluginsImageAlgorithms
+{
+  /**
+   */
+  class fpaPluginsImageAlgorithms_EXPORT RegionGrow
+    : public BaseFilter
+  {
+    cpPluginsObject( RegionGrow, BaseFilter, fpaImageAlgorithms );
+
+  protected:
+    template< class _TImage >
+    inline void _GD0( _TImage* image );
+
+    template< class _TInputImage, class _TOutputPixel >
+    inline void _GD1( _TInputImage* image );
+  };
+
+} // ecapseman
+
+#endif // __fpaPluginsImageAlgorithms__RegionGrow__h__
+
+// eof - $RCSfile$
similarity index 89%
rename from plugins/Plugins/SkeletonFilter.cxx
rename to plugins/ImageAlgorithms/SkeletonFilter.cxx
index 6e9102af78ef042b51205586418a471a518e8db1..d4d46c19b30cfaa6e8d97a2bf7e227a31fdbf40a 100644 (file)
@@ -1,6 +1,5 @@
-#include <Plugins/SkeletonFilter.h>
+#include <ImageAlgorithms/SkeletonFilter.h>
 #include <cpInstances/Image.h>
-#include <cpInstances/Image_Demanglers.h>
 #include <cpInstances/Skeleton.h>
 
 #include <fpa/Image/SkeletonFilter.h>
@@ -8,7 +7,7 @@
 #include <vtkPolyData.h>
 
 // -------------------------------------------------------------------------
-fpaPlugins::SkeletonFilter::
+fpaPluginsImageAlgorithms::SkeletonFilter::
 SkeletonFilter( )
   : Superclass( )
 {
@@ -23,13 +22,13 @@ SkeletonFilter( )
 }
 
 // -------------------------------------------------------------------------
-fpaPlugins::SkeletonFilter::
+fpaPluginsImageAlgorithms::SkeletonFilter::
 ~SkeletonFilter( )
 {
 }
 
 // -------------------------------------------------------------------------
-void fpaPlugins::SkeletonFilter::
+void fpaPluginsImageAlgorithms::SkeletonFilter::
 _GenerateData( )
 {
   auto o = this->GetInputData( "Input" );
@@ -39,7 +38,7 @@ _GenerateData( )
 
 // -------------------------------------------------------------------------
 template< class _TImage >
-void fpaPlugins::SkeletonFilter::
+void fpaPluginsImageAlgorithms::SkeletonFilter::
 _GD0( _TImage* image )
 {
   typedef fpa::Image::SkeletonFilter< _TImage > _TFilter;
similarity index 50%
rename from plugins/Plugins/SkeletonFilter.h
rename to plugins/ImageAlgorithms/SkeletonFilter.h
index ee940c7f773cb221e40353ca4e4a78e0bbd6bcaf..356b61cd2e6657e100edb3ad2f164c391692bdde 100644 (file)
@@ -1,20 +1,20 @@
-#ifndef __fpa__Plugins__SkeletonFilter__h__
-#define __fpa__Plugins__SkeletonFilter__h__
+#ifndef __fpaPluginsImageAlgorithms__SkeletonFilter__h__
+#define __fpaPluginsImageAlgorithms__SkeletonFilter__h__
 
-#include <fpaPlugins_Export.h>
+#include <fpaPluginsImageAlgorithms_Export.h>
 #include <cpPlugins/BaseObjects/ProcessObject.h>
 
-namespace fpaPlugins
+namespace fpaPluginsImageAlgorithms
 {
   /**
    */
-  class fpaPlugins_EXPORT SkeletonFilter
+  class fpaPluginsImageAlgorithms_EXPORT SkeletonFilter
     : public cpPlugins::BaseObjects::ProcessObject
   {
     cpPluginsObject(
       SkeletonFilter,
       cpPlugins::BaseObjects::ProcessObject,
-      fpa
+      fpaImageAlgorithms
       );
 
   protected:
@@ -24,6 +24,6 @@ namespace fpaPlugins
 
 } // ecapseman
 
-#endif // __fpa__Plugins__SkeletonFilter__h__
+#endif // __fpaPluginsImageAlgorithms__SkeletonFilter__h__
 
 // eof - $RCSfile$
diff --git a/plugins/Plugins/BaseImageFilter.h b/plugins/Plugins/BaseImageFilter.h
deleted file mode 100644 (file)
index 8afadd6..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef __fpa__Plugins__BaseImageFilter__h__
-#define __fpa__Plugins__BaseImageFilter__h__
-
-#include <fpaPlugins_Export.h>
-#include <cpPlugins/BaseObjects/ProcessObject.h>
-
-namespace fpaPlugins
-{
-  /**
-   */
-  class fpaPlugins_EXPORT BaseImageFilter
-    : public cpPlugins::BaseObjects::ProcessObject
-  {
-  public:
-    typedef BaseImageFilter                       Self;
-    typedef cpPlugins::BaseObjects::ProcessObject Superclass;
-    typedef itk::SmartPointer< Self >             Pointer;
-    typedef itk::SmartPointer< const Self >       ConstPointer;
-
-  public:
-    itkTypeMacro( BaseImageFilter, cpPlugins::BaseObjects::ProcessObject );
-    cpPlugins_Id_Macro( BaseImageFilter, fpaImageAlgorithm );
-
-  protected:
-    BaseImageFilter( );
-    virtual ~BaseImageFilter( );
-
-    /* TODO
-       template< class _TFilter >
-       inline _TFilter* _ConfigureFilter( );
-
-       template< class _TFilter >
-       inline void _ExecuteFilter( _TFilter* filter );
-
-       template< class _TFilter >
-       inline void _ConfigureDebugger( _TFilter* filter );
-
-       template< class _TFilter >
-       inline void _DeconfigureDebugger( _TFilter* filter );
-    */
-
-  private:
-    // Purposely not implemented.
-    BaseImageFilter( const Self& other );
-    Self& operator=( const Self& other );
-  };
-
-} // ecapseman
-
-#endif // __fpa__Plugins__BaseImageFilter__h__
-
-// eof - $RCSfile$
diff --git a/plugins/Plugins/ExtractPathFromMinimumSpanningTree.h b/plugins/Plugins/ExtractPathFromMinimumSpanningTree.h
deleted file mode 100644 (file)
index 6a46fa9..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef __fpa__Plugins__ExtractPathFromMinimumSpanningTree__h__
-#define __fpa__Plugins__ExtractPathFromMinimumSpanningTree__h__
-
-#include <fpaPlugins_Export.h>
-#include <cpPlugins/BaseObjects/ProcessObject.h>
-
-namespace fpaPlugins
-{
-  /**
-   */
-  class fpaPlugins_EXPORT ExtractPathFromMinimumSpanningTree
-    : public cpPlugins::BaseObjects::ProcessObject
-  {
-    cpPluginsObject(
-      ExtractPathFromMinimumSpanningTree,
-      cpPlugins::BaseObjects::ProcessObject,
-      fpa
-      );
-
-  protected:
-    template< class _TMST >
-    inline void _GD0( _TMST* mst );
-  };
-
-} // ecapseman
-
-#endif // __fpa__Plugins__ExtractPathFromMinimumSpanningTree__h__
-
-// eof - $RCSfile$
diff --git a/plugins/Plugins/ImageDijkstra.h b/plugins/Plugins/ImageDijkstra.h
deleted file mode 100644 (file)
index a76df17..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef __fpa__Plugins__ImageDijkstra__h__
-#define __fpa__Plugins__ImageDijkstra__h__
-
-#include <Plugins/BaseImageFilter.h>
-
-namespace fpaPlugins
-{
-  /**
-   */
-  class fpaPlugins_EXPORT ImageDijkstra
-    : public BaseImageFilter
-  {
-    cpPluginsObject( ImageDijkstra, BaseImageFilter, fpa );
-
-  protected:
-    template< class _TImage >
-    inline void _GD0( _TImage* image );
-
-    template< class _TInputImage, class _TOutputImage >
-    inline void _GD1( _TInputImage* image );
-  };
-
-} // ecapseman
-
-#endif // __fpa__Plugins__ImageDijkstra__h__
-
-// eof - $RCSfile$
diff --git a/plugins/Plugins/ImageRegionGrow.h b/plugins/Plugins/ImageRegionGrow.h
deleted file mode 100644 (file)
index d2a9661..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef __fpa__Plugins__ImageRegionGrow__h__
-#define __fpa__Plugins__ImageRegionGrow__h__
-
-#include <Plugins/BaseImageFilter.h>
-
-namespace fpaPlugins
-{
-  /**
-   */
-  class fpaPlugins_EXPORT ImageRegionGrow
-    : public BaseImageFilter
-  {
-    cpPluginsObject( ImageRegionGrow, BaseImageFilter, fpa );
-
-  protected:
-    template< class _TImage >
-    inline void _GD0( _TImage* image );
-
-    template< class _TInputImage, class _TOutputPixel >
-    inline void _GD1( _TInputImage* image );
-  };
-
-} // ecapseman
-
-#endif // __fpa__Plugins__ImageRegionGrow__h__
-
-// eof - $RCSfile$
diff --git a/plugins/Plugins/RegionGrowBinaryThreshold.cxx b/plugins/Plugins/RegionGrowBinaryThreshold.cxx
deleted file mode 100644 (file)
index 20d5e78..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#include <Plugins/RegionGrowBinaryThreshold.h>
-#include <cpInstances/Image.h>
-#include <cpInstances/Image_Demanglers.h>
-
-#include <itkImage.h>
-#include <fpa/Image/Functors/RegionGrowBinaryThreshold.h>
-
-// -------------------------------------------------------------------------
-fpaPlugins::RegionGrowBinaryThreshold::
-RegionGrowBinaryThreshold( )
-  : Superclass( )
-{
-  typedef cpPlugins::BaseObjects::DataObject _TData;
-  typedef cpInstances::Image _TImage;
-
-  this->_ConfigureInput< _TImage >( "Input", true, false );
-  this->_ConfigureOutput< _TData >( "Output" );
-
-  this->m_Parameters.ConfigureAsReal( "LowerThreshold", 0 );
-  this->m_Parameters.ConfigureAsReal( "UpperThreshold", 0 );
-}
-
-// -------------------------------------------------------------------------
-fpaPlugins::RegionGrowBinaryThreshold::
-~RegionGrowBinaryThreshold( )
-{
-}
-
-// -------------------------------------------------------------------------
-void fpaPlugins::RegionGrowBinaryThreshold::
-_GenerateData( )
-{
-  auto o = this->GetInputData( "Input" );
-  cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 )
-    this->_Error( "Invalid input image." );
-}
-
-// -------------------------------------------------------------------------
-template< class _TImage >
-void fpaPlugins::RegionGrowBinaryThreshold::
-_GD0( _TImage* image )
-{
-  typedef
-    fpa::Image::Functors::RegionGrowBinaryThreshold< _TImage >
-    _TFunctor;
-  auto out = this->GetOutput( "Output" );
-  auto f = out->GetITK< _TFunctor >( );
-  if( f == NULL )
-  {
-    typename _TFunctor::Pointer ptr_f = _TFunctor::New( );
-    f = ptr_f.GetPointer( );
-    out->SetITK( f );
-
-  } // fi
-  f->SetLowerThreshold( this->m_Parameters.GetReal( "LowerThreshold" ) );
-  f->SetUpperThreshold( this->m_Parameters.GetReal( "UpperThreshold" ) );
-}
-
-// eof - $RCSfile$
diff --git a/plugins/Plugins/RegionGrowBinaryThreshold.h b/plugins/Plugins/RegionGrowBinaryThreshold.h
deleted file mode 100644 (file)
index 17c19e0..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef __fpa__Plugins__RegionGrowBinaryThreshold__h__
-#define __fpa__Plugins__RegionGrowBinaryThreshold__h__
-
-#include <fpaPlugins_Export.h>
-#include <cpPlugins/BaseObjects/ProcessObject.h>
-
-namespace fpaPlugins
-{
-  /**
-   */
-  class fpaPlugins_EXPORT RegionGrowBinaryThreshold
-    : public cpPlugins::BaseObjects::ProcessObject
-  {
-    cpPluginsObject(
-      RegionGrowBinaryThreshold,
-      cpPlugins::BaseObjects::ProcessObject,
-      fpaFunctors
-      );
-
-  protected:
-    template< class _TImage >
-    inline void _GD0( _TImage* image );
-  };
-
-} // ecapseman
-
-#endif // __fpa__Plugins__RegionGrowBinaryThreshold__h__
-
-// eof - $RCSfile$
diff --git a/plugins/Plugins/RegionGrowBinaryThresholdWithSeeds.h b/plugins/Plugins/RegionGrowBinaryThresholdWithSeeds.h
deleted file mode 100644 (file)
index cb8ebe9..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef __fpa__Plugins__RegionGrowBinaryThresholdWithSeeds__h__
-#define __fpa__Plugins__RegionGrowBinaryThresholdWithSeeds__h__
-
-#include <fpaPlugins_Export.h>
-#include <cpPlugins/BaseObjects/ProcessObject.h>
-
-namespace fpaPlugins
-{
-  /**
-   */
-  class fpaPlugins_EXPORT RegionGrowBinaryThresholdWithSeeds
-    : public cpPlugins::BaseObjects::ProcessObject
-  {
-    cpPluginsObject(
-      RegionGrowBinaryThresholdWithSeeds,
-      cpPlugins::BaseObjects::ProcessObject,
-      fpaFunctors
-      );
-
-  protected:
-    template< class _TImage >
-    inline void _GD0( _TImage* image );
-  };
-
-} // ecapseman
-
-#endif // __fpa__Plugins__RegionGrowBinaryThresholdWithSeeds__h__
-
-// eof - $RCSfile$
diff --git a/plugins/Plugins/SimpleImageNeighborhood.cxx b/plugins/Plugins/SimpleImageNeighborhood.cxx
deleted file mode 100644 (file)
index 3d3e943..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#include <Plugins/SimpleImageNeighborhood.h>
-#include <cpInstances/Image.h>
-#include <cpInstances/Image_Demanglers.h>
-
-#include <itkImage.h>
-#include <fpa/Image/Functors/SimpleNeighborhood.h>
-
-// -------------------------------------------------------------------------
-fpaPlugins::SimpleImageNeighborhood::
-SimpleImageNeighborhood( )
-  : Superclass( )
-{
-  typedef cpPlugins::BaseObjects::DataObject _TData;
-  typedef cpInstances::Image _TImage;
-
-  this->_ConfigureInput< _TImage >( "Input", true, false );
-  this->_ConfigureOutput< _TData >( "Output" );
-
-  this->m_Parameters.ConfigureAsUint( "Order", 1 );
-}
-
-// -------------------------------------------------------------------------
-fpaPlugins::SimpleImageNeighborhood::
-~SimpleImageNeighborhood( )
-{
-}
-
-// -------------------------------------------------------------------------
-void fpaPlugins::SimpleImageNeighborhood::
-_GenerateData( )
-{
-  auto o = this->GetInputData( "Input" );
-  cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 )
-    this->_Error( "Invalid input image." );
-}
-
-// -------------------------------------------------------------------------
-template< class _TImage >
-void fpaPlugins::SimpleImageNeighborhood::
-_GD0( _TImage* image )
-{
-  typedef fpa::Image::Functors::SimpleNeighborhood< _TImage > _TFunctor;
-  auto out = this->GetOutput( "Output" );
-  auto f = out->GetITK< _TFunctor >( );
-  if( f == NULL )
-  {
-    typename _TFunctor::Pointer ptr_f = _TFunctor::New( );
-    f = ptr_f.GetPointer( );
-    out->SetITK( f );
-
-  } // fi
-  f->SetOrder( this->m_Parameters.GetUint( "Order" ) );
-}
-
-// eof - $RCSfile$
diff --git a/plugins/Plugins/SimpleImageNeighborhood.h b/plugins/Plugins/SimpleImageNeighborhood.h
deleted file mode 100644 (file)
index 6c0ac92..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef __fpa__Plugins__SimpleImageNeighborhood__h__
-#define __fpa__Plugins__SimpleImageNeighborhood__h__
-
-#include <fpaPlugins_Export.h>
-#include <cpPlugins/BaseObjects/ProcessObject.h>
-
-namespace fpaPlugins
-{
-  /**
-   */
-  class fpaPlugins_EXPORT SimpleImageNeighborhood
-    : public cpPlugins::BaseObjects::ProcessObject
-  {
-    cpPluginsObject(
-      SimpleImageNeighborhood,
-      cpPlugins::BaseObjects::ProcessObject,
-      fpaFunctors
-      );
-
-  protected:
-    template< class _TImage >
-    inline void _GD0( _TImage* image );
-  };
-
-} // ecapseman
-
-#endif // __fpa__Plugins__SimpleImageNeighborhood__h__
-
-// eof - $RCSfile$
diff --git a/plugins/Plugins/fpaPlugins.i b/plugins/Plugins/fpaPlugins.i
deleted file mode 100644 (file)
index 34a013a..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-header #define ITK_MANUAL_INSTANTIATION
-
-define i_real=#real_types#
-define o_real=#real_types#
-
-tinclude fpa/Image/Functors/SimpleNeighborhood:h|hxx
-tinclude fpa/Image/Functors/SimpleDijkstraCost:h|hxx
-tinclude fpa/Base/Functors/Inverse:h|hxx
-tinclude fpa/Base/Functors/GaussianModel:h|hxx
-tinclude fpa/Image/RegionGrow:h|hxx
-tinclude fpa/Image/Dijkstra:h|hxx
-tinclude fpa/Image/SkeletonFilter:h|hxx
-tinclude fpa/Image/Functors/RegionGrowBinaryThreshold:h|hxx
-
-cinclude itkImage.h
-cinclude itkSimpleDataObjectDecorator.hxx
-cinclude fpa/Base/RegionGrow.hxx
-cinclude fpa/Base/Dijkstra.hxx
-
-instances fpa::Image::Functors::SimpleNeighborhood< itk::Image< #scalar_pixels#, #process_dims# > >
-instances fpa::Image::Functors::SimpleDijkstraCost< itk::Image< #scalar_pixels#, #process_dims# >, #real_types# >
-instances fpa::Image::Functors::RegionGrowBinaryThreshold< itk::Image< #scalar_pixels#, #process_dims# > >
-
-instances fpa::Base::Functors::Inverse< #i_real#, #o_real# >
-instances fpa::Base::Functors::GaussianModel< #i_real#, #o_real# >
-
-instances fpa::Image::Dijkstra< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #real_types#, #process_dims# > >
-instances fpa::Image::RegionGrow< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #int_types#, #process_dims# > >
-instances fpa::Image::RegionGrow< itk::Image< #scalar_pixels#, #process_dims# >, itk::Image< #uint_types#, #process_dims# > >
-instances fpa::Image::SkeletonFilter< itk::Image< #real_types#, #process_dims# > >
-
-** eof - $RCSfile$
similarity index 55%
rename from plugins/Plugins/RegionGrowBinaryThresholdWithSeeds.cxx
rename to plugins/RegionGrowFunctors/BinaryThreshold.cxx
index e799ae219584e6b7a57f80afae6b8d6c8d9a039f..05010ab4974efd39bdf28d082e29b491dcbe711e 100644 (file)
@@ -1,34 +1,35 @@
-#include <Plugins/RegionGrowBinaryThresholdWithSeeds.h>
+#include <RegionGrowFunctors/BinaryThreshold.h>
 #include <cpInstances/Image.h>
-#include <cpInstances/Image_Demanglers.h>
 
 #include <fpa/Image/Functors/RegionGrowBinaryThreshold.h>
 #include <itkConstNeighborhoodIterator.h>
 #include <vtkPolyData.h>
 
 // -------------------------------------------------------------------------
-fpaPlugins::RegionGrowBinaryThresholdWithSeeds::
-RegionGrowBinaryThresholdWithSeeds( )
+fpaPluginsRegionGrowFunctors::BinaryThreshold::
+BinaryThreshold( )
   : Superclass( )
 {
   typedef cpPlugins::BaseObjects::DataObject _TData;
   typedef cpInstances::Image _TImage;
 
   this->_ConfigureInput< _TImage >( "Input", true, false );
-  this->_ConfigureInput< _TData >( "Seeds", true, false );
+  this->_ConfigureInput< _TData >( "Seeds", false, false );
   this->_ConfigureOutput< _TData >( "Output" );
 
   this->m_Parameters.ConfigureAsUint( "Radius", 1 );
+  this->m_Parameters.ConfigureAsReal( "LowerThreshold", 0 );
+  this->m_Parameters.ConfigureAsReal( "UpperThreshold", 0 );
 }
 
 // -------------------------------------------------------------------------
-fpaPlugins::RegionGrowBinaryThresholdWithSeeds::
-~RegionGrowBinaryThresholdWithSeeds( )
+fpaPluginsRegionGrowFunctors::BinaryThreshold::
+~BinaryThreshold( )
 {
 }
 
 // -------------------------------------------------------------------------
-void fpaPlugins::RegionGrowBinaryThresholdWithSeeds::
+void fpaPluginsRegionGrowFunctors::BinaryThreshold::
 _GenerateData( )
 {
   auto o = this->GetInputData( "Input" );
@@ -38,7 +39,7 @@ _GenerateData( )
 
 // -------------------------------------------------------------------------
 template< class _TImage >
-void fpaPlugins::RegionGrowBinaryThresholdWithSeeds::
+void fpaPluginsRegionGrowFunctors::BinaryThreshold::
 _GD0( _TImage* image )
 {
   typedef itk::ConstNeighborhoodIterator< _TImage > _TInIt;
@@ -57,9 +58,9 @@ _GD0( _TImage* image )
 
   // Compute thresholds from seeds
   auto seeds = this->GetInputData< vtkPolyData >( "Seeds" );
-  std::vector< typename _TImage::IndexType > indices;
   if( seeds != NULL )
   {
+    std::vector< typename _TImage::IndexType > indices;
     typename _TImage::PointType pnt;
     typename _TImage::IndexType idx;
     unsigned int dim =
@@ -77,36 +78,40 @@ _GD0( _TImage* image )
 
     } // rof
 
-  } // fi
-
-  typename _TImage::SizeType r;
-  r.Fill( this->m_Parameters.GetUint( "Radius" ) );
-  _TInIt iIt( r, image, image->GetRequestedRegion( ) );
-  double v_s1 = double( 0 );
-  double v_s2 = double( 0 );
-  double v_n = double( 0 );
-  double v_min = std::numeric_limits< double >::max( );
-  double v_max = -v_min;
-  for( auto idxIt = indices.begin( ); idxIt != indices.end( ); ++idxIt )
-  {
-    iIt.SetLocation( *idxIt );
-    for( unsigned int i = 0; i < iIt.Size( ); ++i )
+    typename _TImage::SizeType r;
+    r.Fill( this->m_Parameters.GetUint( "Radius" ) );
+    _TInIt iIt( r, image, image->GetRequestedRegion( ) );
+    double v_s1 = double( 0 );
+    double v_s2 = double( 0 );
+    double v_n = double( 0 );
+    double v_min = std::numeric_limits< double >::max( );
+    double v_max = -v_min;
+    for( auto idxIt = indices.begin( ); idxIt != indices.end( ); ++idxIt )
     {
-      double v = double( iIt.GetPixel( i ) );
-      v_s1 += v;
-      v_s2 += v * v;
-      v_n += double( 1 );
-      v_min = ( v < v_min )? v: v_min;
-      v_max = ( v_max < v )? v: v_max;
+      iIt.SetLocation( *idxIt );
+      for( unsigned int i = 0; i < iIt.Size( ); ++i )
+      {
+        double v = double( iIt.GetPixel( i ) );
+        v_s1 += v;
+        v_s2 += v * v;
+        v_n += double( 1 );
+        v_min = ( v < v_min )? v: v_min;
+        v_max = ( v_max < v )? v: v_max;
+
+      } // rof
 
     } // rof
+    double s = ( v_s2 - ( ( v_s1 * v_s1 ) / v_n ) ) / ( v_n - double( 1 ) );
+    s = std::sqrt( s ) / double( 2 );
+    f->SetLowerThreshold( v_min );
+    f->SetUpperThreshold( v_max );
+  }
+  else
+  {
+    f->SetLowerThreshold( this->m_Parameters.GetReal( "LowerThreshold" ) );
+    f->SetUpperThreshold( this->m_Parameters.GetReal( "UpperThreshold" ) );
 
-  } // rof
-  double s = ( v_s2 - ( ( v_s1 * v_s1 ) / v_n ) ) / ( v_n - double( 1 ) );
-  s = std::sqrt( s ) / double( 2 );
-
-  f->SetLowerThreshold( v_min );
-  f->SetUpperThreshold( v_max );
+  } // fi
 }
 
 // eof - $RCSfile$
diff --git a/plugins/RegionGrowFunctors/BinaryThreshold.h b/plugins/RegionGrowFunctors/BinaryThreshold.h
new file mode 100644 (file)
index 0000000..30f9a0e
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef __fpaPluginsRegionGrowFunctors__BinaryThreshold__h__
+#define __fpaPluginsRegionGrowFunctors__BinaryThreshold__h__
+
+#include <fpaPluginsRegionGrowFunctors_Export.h>
+#include <cpPlugins/BaseObjects/ProcessObject.h>
+
+namespace fpaPluginsRegionGrowFunctors
+{
+  /**
+   */
+  class fpaPluginsRegionGrowFunctors_EXPORT BinaryThreshold
+    : public cpPlugins::BaseObjects::ProcessObject
+  {
+    cpPluginsObject(
+      BinaryThreshold,
+      cpPlugins::BaseObjects::ProcessObject,
+      fpaRegionGrowFunctors
+      );
+
+  protected:
+    template< class _TImage >
+    inline void _GD0( _TImage* image );
+  };
+
+} // ecapseman
+
+#endif // __fpaPluginsRegionGrowFunctors__BinaryThreshold__h__
+
+// eof - $RCSfile$
diff --git a/plugins/RegionGrowFunctors/RegionGrowFunctors.i b/plugins/RegionGrowFunctors/RegionGrowFunctors.i
new file mode 100644 (file)
index 0000000..c310a00
--- /dev/null
@@ -0,0 +1,7 @@
+header #define ITK_MANUAL_INSTANTIATION
+
+cinclude itkImage.h
+tinclude fpa/Image/Functors/RegionGrowBinaryThreshold:h|hxx
+instances fpa::Image::Functors::RegionGrowBinaryThreshold< itk::Image< #scalar_types#, #pdims# > >
+
+** eof - $RCSfile$