]> Creatis software - FrontAlgorithms.git/commitdiff
...
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Mon, 11 Apr 2016 23:15:11 +0000 (18:15 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Mon, 11 Apr 2016 23:15:11 +0000 (18:15 -0500)
30 files changed:
CMakeLists.txt
cmake/CMakeLists.txt
cmake/FrontAlgorithmsConfig.cmake.in
cmake/fpa_Policies.cmake [new file with mode: 0644]
lib/CMakeLists.txt
lib/fpa/Base/RegionGrow.hxx
lib/fpa/Image/RegionGrow.hxx
lib/fpa/VTK/Image/Observer2D.h [new file with mode: 0644]
lib/fpa/VTK/Image/Observer2D.hxx [moved from lib/fpa/VTK/Image2DObserver.hxx with 93% similarity]
lib/fpa/VTK/Image/Observer3D.h [new file with mode: 0644]
lib/fpa/VTK/Image/Observer3D.hxx [moved from lib/fpa/VTK/Image3DObserver.hxx with 94% similarity]
lib/fpa/VTK/Image2DObserver.h [deleted file]
lib/fpa/VTK/Image3DObserver.h [deleted file]
lib/fpa_Instances/Backtracking.i [new file with mode: 0644]
lib/fpa_Instances/CMakeLists.txt
lib/fpa_Instances/Filters.i
lib/fpa_Instances/Functors.i [new file with mode: 0644]
lib/fpa_Instances/Instances.i
lib/fpa_Instances/Observers.i
plugins/CMakeLists.txt
plugins/fpa/BaseImageFilter.cxx
plugins/fpa/BaseImageFilter.hxx
plugins/fpa/CMakeLists.txt
plugins/fpa/ExtractEndPointsAndBifurcationsFromMinimumSpanningTree.cxx
plugins/fpa/ExtractPathFromMinimumSpanningTree.cxx
plugins/fpa/GradientBaseImageFunctionSource.cxx
plugins/fpa/ImageDijkstra.cxx
plugins/fpa/ImageRegionGrow.cxx
plugins/fpa/MinimumSpanningTreeReader.cxx
plugins/fpa/MinimumSpanningTreeWriter.cxx

index 785164bb94404d7c14899a98f4c77b4eb5038934..c022af848dc66d2b1baae76a9ff9feebadfe8b05 100644 (file)
@@ -1,87 +1,32 @@
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+INCLUDE(cmake/fpa_Policies.cmake)
 
-## ============
-## = Policies =
-## ============
-
-SET(
-  policies
-  CMP0015
-  CMP0020
-  CMP0042
-  )
-FOREACH(policy ${policies})
-  IF(POLICY ${policy})
-    CMAKE_POLICY(SET ${policy} NEW)
-  ENDIF(POLICY ${policy})
-ENDFOREACH(policy)
-
-## ================
-## = Project name =
-## ================
+## ==================
+## == Project name ==
+## ==================
 
 PROJECT(FrontAlgorithms)
 SET(prj_MAJ_VER "0")
-SET(prj_MIN_VER "0")
-SET(prj_REL_VER "1")
+SET(prj_MIN_VER "1")
+SET(prj_REL_VER "0")
 SET(prj_VER "${prj_MAJ_VER}.${prj_MIN_VER}.${prj_REL_VER}")
 SET(prj_sVER "${prj_MAJ_VER}")
 
-## ===========
-## = Options =
-## ===========
-
-## OPTION(BUILD_EXAMPLES "Build examples" OFF)
-OPTION(BUILD_PLUGINS "Build plugins" OFF)
-
-## ============
-## = Packages =
-## ============
+## =====================
+## == Main dependency ==
+## =====================
 
-# NOTE: It seems that by default on Visual Studio Compiler supports c++11,
-# so it only need to be test on other O.S.
-IF(NOT MSVC)
-  INCLUDE(CheckCXXCompilerFlag)
-  CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
-  CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
-  IF(COMPILER_SUPPORTS_CXX11)
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
-  ELSEIF(COMPILER_SUPPORTS_CXX0X)
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
-  ELSE()
-    MESSAGE(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
-  ENDIF()
-ENDIF(NOT MSVC)
-
-# Prepare header to build shared libs (windows)
-INCLUDE(GenerateExportHeader)
-
-# Find cpPlugins
 FIND_PACKAGE(cpPlugins REQUIRED)
 
-## ================================================
-## = Do not allow to build inside the source tree =
-## ================================================
-
-IF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
-  MESSAGE(FATAL_ERROR "Building in the source tree is not allowed")
-ENDIF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR})
+## =============
+## == Options ==
+## =============
 
-## =====================================
-## = Where to put executables and libs =
-## =====================================
-
-SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
-SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
-MARK_AS_ADVANCED(
-  CMAKE_BACKWARDS_COMPATIBILITY
-  EXECUTABLE_OUTPUT_PATH
-  LIBRARY_OUTPUT_PATH
-  )
+OPTION(BUILD_PLUGINS "Build plugins" ON)
 
-## ==============================
-## = Subdirs containing headers =
-## ==============================
+## =========================
+## == Include directories ==
+## =========================
 
 INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}
@@ -94,19 +39,15 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_BINARY_DIR}/plugins
   )
 
-## ===========================
-## = Subdirs containing code =
-## ===========================
+## =============================
+## == Subdirs containing code ==
+## =============================
 
 SUBDIRS(
   cmake
   lib
-  appli
+  plugins
+  #   appli
   )
-IF(BUILD_PLUGINS)
-  SUBDIRS(
-    plugins
-    )
-ENDIF(BUILD_PLUGINS)
 
 ## eof - $RCSfile$
index fc65c38466cfe1c9ff90f10952fcde845b4b1bba..44467ab420a3e8bb62f04d8c104b32284d8e922e 100644 (file)
@@ -5,7 +5,7 @@ CONFIGURE_FILE(
   )
 
 ## ========================
-## -- Installation rules --
+## == Installation rules ==
 ## ========================
 
 INSTALL(
index c22d4ae264fa694e8bcd057802522f5631f61488..e84ecbab47e0cc89d58311ba1b5511709a1714d8 100644 (file)
@@ -1,15 +1,17 @@
 # =========================
-# -- Include directories --
+# == Include directories ==
 # =========================
 
 INCLUDE_DIRECTORIES(
   @PROJECT_SOURCE_DIR@/lib
   @PROJECT_BINARY_DIR@/lib
+  @PROJECT_SOURCE_DIR@/lib/fpa_Instances
+  @PROJECT_BINARY_DIR@/lib/fpa_Instances
   @CMAKE_INSTALL_PREFIX@/include
   )
 
 # =========================
-# -- Library directories --
+# == Library directories ==
 # =========================
 
 IF(MSVC)
@@ -27,7 +29,7 @@ ELSE(MSVC)
 ENDIF(MSVC)
 
 # ===================
-# -- Library names --
+# == Library names ==
 # ===================
 
 SET(FrontAlgorithms_LIBRARY FrontAlgorithms)
diff --git a/cmake/fpa_Policies.cmake b/cmake/fpa_Policies.cmake
new file mode 100644 (file)
index 0000000..a26f448
--- /dev/null
@@ -0,0 +1,13 @@
+SET(
+  policies
+  CMP0015
+  CMP0020
+  CMP0042
+  )
+FOREACH(policy ${policies})
+  IF(POLICY ${policy})
+    CMAKE_POLICY(SET ${policy} NEW)
+  ENDIF(POLICY ${policy})
+ENDFOREACH(policy)
+
+## eof - $RCSfile$
index 3efe1bc315e3d09e6b09b1083452f86f029ceee2..feb186e5e560a33f4347536d5be496ce6544fc03 100644 (file)
@@ -1,113 +1,7 @@
-SET(lib_NAME fpa)
-
-## ================
-## = Source files =
-## ================
-
-CONFIGURE_FILE(
-  fpa/Common.cxx.in
-  ${PROJECT_BINARY_DIR}/lib/fpa/Common.cxx
-  )
-
-FILE(GLOB ${lib_NAME}_HEADERS "fpa/*.h" "fpa/*.hxx")
-FILE(GLOB ${lib_NAME}_BASE_HEADERS "fpa/Base/*.h" "fpa/Base/*.hxx")
-FILE(GLOB ${lib_NAME}_IO_HEADERS "fpa/IO/*.h" "fpa/IO/*.hxx")
-FILE(GLOB ${lib_NAME}_IMAGE_HEADERS "fpa/Image/*.h" "fpa/Image/*.hxx")
-
-FILE(GLOB ${lib_NAME}_SOURCES "fpa/*.cxx")
-FILE(GLOB ${lib_NAME}_BASE_SOURCES "fpa/Base/*.cxx")
-FILE(GLOB ${lib_NAME}_IO_SOURCES "fpa/IO/*.cxx")
-FILE(GLOB ${lib_NAME}_IMAGE_SOURCES "fpa/Image/*.cxx")
-
-FILE(GLOB ${lib_NAME}_VTK_HEADERS "fpa/VTK/*.h" "fpa/VTK/*.hxx")
-FILE(GLOB ${lib_NAME}_VTK_SOURCES "fpa/VTK/*.cxx")
-
-SET(
-  ${lib_NAME}_ALL_SOURCES
-  ${PROJECT_BINARY_DIR}/lib/fpa/Common.cxx
-  ${${lib_NAME}_SOURCES}
-  ${${lib_NAME}_BASE_SOURCES}
-  ${${lib_NAME}_IO_SOURCES}
-  ${${lib_NAME}_IMAGE_SOURCES}
-  ${${lib_NAME}_VTK_SOURCES}
-  )
-
-## =============
-## = Libraries =
-## =============
-
-SET(
-  ${lib_NAME}_LINK_LIBRARIES
-  ${ITK_LIBRARIES}
-  ${VTK_LIBRARIES}
-  )
-
-## =====================
-## = Compilation rules =
-## =====================
-
-ADD_LIBRARY(
-  ${lib_NAME}
-  SHARED
-  ${${lib_NAME}_ALL_SOURCES}
-  )
-SET_TARGET_PROPERTIES(
-  ${lib_NAME} PROPERTIES
-  VERSION "${prj_VER}"
-  SOVERSION "${prj_sVER}"
-  )
-GENERATE_EXPORT_HEADER(
-  ${lib_NAME}
-  BASE_NAME ${lib_NAME}
-  EXPORT_MACRO_NAME ${lib_NAME}_EXPORT
-  EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/lib/fpa/${lib_NAME}_Export.h
-  STATIC_DEFINE ${lib_NAME}_BUILT_AS_STATIC
-  )
-TARGET_LINK_LIBRARIES(
-  ${lib_NAME}
-  ${${lib_NAME}_LINK_LIBRARIES}
-  )
-
-## ========================
-## -- Installation rules --
-## ========================
-
-INSTALL(
-  TARGETS ${lib_NAME}
-  RUNTIME DESTINATION bin
-  LIBRARY DESTINATION lib
-  ARCHIVE DESTINATION lib/static
-  )
-SET(
-  local_install_dirs
-  fpa
-  )
-FOREACH(dir ${local_install_dirs})
-  INSTALL(
-    DIRECTORY ${dir}
-    DESTINATION include
-    FILES_MATCHING PATTERN "*.h"
+IF(BUILD_PLUGINS)
+  SUBDIRS(
+    fpa_Instances
     )
-  INSTALL(
-    DIRECTORY ${dir}
-    DESTINATION include
-    FILES_MATCHING PATTERN "*.hxx"
-    )
-  INSTALL(
-    DIRECTORY ${dir}
-    DESTINATION include
-    FILES_MATCHING PATTERN "*.hpp"
-    )
-ENDFOREACH(dir)
-
-INSTALL(
-  FILES
-  ${PROJECT_BINARY_DIR}/lib/fpa/${lib_NAME}_Export.h
-  DESTINATION include/fpa
-  )
-
-SUBDIRS(
-  fpa_Instances
-  )
+ENDIF(BUILD_PLUGINS)
 
-## eof - $RCSfile$
+# ## eof - $RCSfile$
index 1760ac1eb9b89d2f5b3937eb1e550b158fb0d434..8542f3028f3c857d2bce88e225d9331f8210ceca 100644 (file)
@@ -26,7 +26,7 @@ _CheckMembership( const TVertex& v ) const
   if( this->m_GrowingFunction.IsNotNull( ) )
     return( this->m_GrowingFunction->Evaluate( v ) );
   else
-    return( false );
+    return( true );
 }
 
 // -------------------------------------------------------------------------
index 9b5b0f792ba457240aa28ecf7530d697c44b5d06..a56c919b80b2ccb7b9830be8853c08297a6c1acf 100644 (file)
@@ -22,7 +22,8 @@ void fpa::Image::RegionGrow< I, O >::
 _InitResults( )
 {
   this->Superclass::_InitResults( );
-  this->m_GrowingFunction->SetSpace( this->GetInput( ) );
+  if( this->m_GrowingFunction.IsNotNull( ) )
+    this->m_GrowingFunction->SetSpace( this->GetInput( ) );
   this->GetOutput( )->FillBuffer( this->m_OutsideValue );
 }
 
diff --git a/lib/fpa/VTK/Image/Observer2D.h b/lib/fpa/VTK/Image/Observer2D.h
new file mode 100644 (file)
index 0000000..8abbecf
--- /dev/null
@@ -0,0 +1,88 @@
+#ifndef __FPA__VTK__IMAGE__OBSERVER2D__H__
+#define __FPA__VTK__IMAGE__OBSERVER2D__H__
+
+#include <set>
+#include <itkCommand.h>
+#include <vtkActor.h>
+#include <vtkImageActor.h>
+#include <vtkImageData.h>
+#include <vtkPolyData.h>
+#include <vtkSmartPointer.h>
+
+namespace fpa
+{
+  namespace VTK
+  {
+    namespace Image
+    {
+      /**
+       */
+      template< class F, class R >
+      class Observer2D
+        : public itk::Command
+      {
+      public:
+        typedef Observer2D                 Self;
+        typedef itk::Command                    Superclass;
+        typedef itk::SmartPointer< Self >       Pointer;
+        typedef itk::SmartPointer< const Self > ConstPointer;
+
+        typedef F                             TFilter;
+        typedef R                             TRenderWindow;
+        typedef typename TFilter::TInputImage TImage;
+        typedef typename TFilter::TVertex     TVertex;
+
+        typedef std::set< TVertex > TVertices;
+
+      public:
+        itkNewMacro( Self );
+        itkTypeMacro( Observer2D, itkCommand );
+
+        itkGetConstMacro( RenderPercentage, double );
+        itkSetMacro( RenderPercentage, double );
+
+      public:
+        void SetRenderWindow( R* rw );
+        void SetPixel(
+          typename TImage::IndexType idx,
+          unsigned char red,
+          unsigned char green,
+          unsigned char blue,
+          unsigned char alpha
+          );
+        void Render( );
+        void Execute( itk::Object* c, const itk::EventObject& e ) ITK_OVERRIDE
+          { this->Execute( ( const itk::Object* )( c ), e ); }
+        void Execute( const itk::Object* c, const itk::EventObject& e ) ITK_OVERRIDE;
+
+      protected:
+        Observer2D( );
+        virtual ~Observer2D( );
+
+      private:
+        Observer2D( const Self& ); // Not impl.
+        void operator=( const Self& );  // Not impl.
+
+      protected:
+        vtkSmartPointer< vtkImageData >  m_Stencil;
+        vtkSmartPointer< vtkImageActor > m_StencilActor;
+
+        R*            m_RenderWindow;
+        unsigned long m_Count;
+        unsigned long m_RenderCount;
+        double        m_RenderPercentage;
+      };
+
+    } // ecapseman
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <fpa/VTK/Image/Observer2D.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __FPA__VTK__IMAGE__OBSERVER2D__H__
+
+// eof - $RCSfile$
similarity index 93%
rename from lib/fpa/VTK/Image2DObserver.hxx
rename to lib/fpa/VTK/Image/Observer2D.hxx
index 61ea5a9e2cf571d11c905cff8cee76de40c8c1cb..da4c7bf2f16f272dbba80c67251a488697fb46fe 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __FPA__VTK__IMAGE2DOBSERVER__HXX__
-#define __FPA__VTK__IMAGE2DOBSERVER__HXX__
+#ifndef __FPA__VTK__IMAGE__OBSERVER2D__HXX__
+#define __FPA__VTK__IMAGE__OBSERVER2D__HXX__
 
 #include <vtkCellArray.h>
 #include <vtkPolyDataMapper.h>
@@ -11,7 +11,7 @@
 
 // -------------------------------------------------------------------------
 template< class F, class R >
-void fpa::VTK::Image2DObserver< F, R >::
+void fpa::VTK::Image::Observer2D< F, R >::
 SetRenderWindow( R* rw )
 {
   this->m_RenderWindow = rw;
@@ -19,7 +19,7 @@ SetRenderWindow( R* rw )
 
 // -------------------------------------------------------------------------
 template< class F, class R >
-void fpa::VTK::Image2DObserver< F, R >::
+void fpa::VTK::Image::Observer2D< F, R >::
 SetPixel(
   typename TImage::IndexType idx,
   unsigned char red,
@@ -42,7 +42,7 @@ SetPixel(
 
 // -------------------------------------------------------------------------
 template< class F, class R >
-void fpa::VTK::Image2DObserver< F, R >::
+void fpa::VTK::Image::Observer2D< F, R >::
 Render( )
 {
   if( this->m_RenderWindow != NULL )
@@ -51,7 +51,7 @@ Render( )
 
 // -------------------------------------------------------------------------
 template< class F, class R >
-void fpa::VTK::Image2DObserver< F, R >::
+void fpa::VTK::Image::Observer2D< F, R >::
 Execute( const itk::Object* c, const itk::EventObject& e )
 {
   typedef typename F::TStartEvent     _TStartEvent;
@@ -204,8 +204,8 @@ Execute( const itk::Object* c, const itk::EventObject& e )
 
 // -------------------------------------------------------------------------
 template< class F, class R >
-fpa::VTK::Image2DObserver< F, R >::
-Image2DObserver( )
+fpa::VTK::Image::Observer2D< F, R >::
+Observer2D( )
   : Superclass( ),
     m_RenderWindow( NULL ),
     m_RenderPercentage( double( 0.01 ) )
@@ -216,11 +216,11 @@ Image2DObserver( )
 
 // -------------------------------------------------------------------------
 template< class F, class R >
-fpa::VTK::Image2DObserver< F, R >::
-~Image2DObserver( )
+fpa::VTK::Image::Observer2D< F, R >::
+~Observer2D( )
 {
 }
 
-#endif // __FPA__VTK__IMAGE2DOBSERVER__HXX__
+#endif // __FPA__VTK__IMAGE__OBSERVER2D__HXX__
 
 // eof - $RCSfile$
diff --git a/lib/fpa/VTK/Image/Observer3D.h b/lib/fpa/VTK/Image/Observer3D.h
new file mode 100644 (file)
index 0000000..ce3c053
--- /dev/null
@@ -0,0 +1,86 @@
+#ifndef __FPA__VTK__IMAGE__OBSERVER3D__H__
+#define __FPA__VTK__IMAGE__OBSERVER3D__H__
+
+#include <map>
+
+#include <itkCommand.h>
+
+#include <vtkActor.h>
+#include <vtkPolyData.h>
+#include <vtkPolyDataMapper.h>
+#include <vtkSmartPointer.h>
+
+namespace fpa
+{
+  namespace VTK
+  {
+    namespace Image
+    {
+      /**
+       */
+      template< class F, class R >
+      class Observer3D
+        : public itk::Command
+      {
+      public:
+        typedef Observer3D                      Self;
+        typedef itk::Command                    Superclass;
+        typedef itk::SmartPointer< Self >       Pointer;
+        typedef itk::SmartPointer< const Self > ConstPointer;
+
+        typedef F                                TFilter;
+        typedef R                                TRenderWindow;
+        typedef typename TFilter::TInputImage    TImage;
+        typedef typename TFilter::TVertex        TVertex;
+        typedef typename TFilter::TVertexCompare TVertexCompare;
+
+        typedef std::set< TVertex > TVertices;
+
+      public:
+        itkNewMacro( Self );
+        itkTypeMacro( Observer3D, itkCommand );
+
+        itkGetConstMacro( RenderPercentage, double );
+        itkSetMacro( RenderPercentage, double );
+
+      public:
+        void SetRenderWindow( R* rw );
+        void Render( );
+        void Execute( itk::Object* c, const itk::EventObject& e ) ITK_OVERRIDE
+          { this->Execute( ( const itk::Object* )( c ), e ); }
+        void Execute( const itk::Object* c, const itk::EventObject& e ) ITK_OVERRIDE;
+
+      protected:
+        Observer3D( );
+        virtual ~Observer3D( );
+
+      private:
+        Observer3D( const Self& );     // Not impl.
+        void operator=( const Self& ); // Not impl.
+
+      protected:
+        vtkSmartPointer< vtkPolyData >       m_PolyData;
+        vtkSmartPointer< vtkPolyDataMapper > m_PolyDataMapper;
+        vtkSmartPointer< vtkActor >          m_PolyDataActor;
+        std::map< TVertex, unsigned long, TVertexCompare >   m_PointsToReplace;
+        std::map< TVertex, unsigned long, TVertexCompare >   m_PointsInFront;
+
+        R*            m_RenderWindow;
+        unsigned long m_Count;
+        unsigned long m_RenderCount;
+        double        m_RenderPercentage;
+      };
+
+    } // ecapseman
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <fpa/VTK/Observer3D.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __FPA__VTK__IMAGE__OBSERVER3D__H__
+
+// eof - $RCSfile$
similarity index 94%
rename from lib/fpa/VTK/Image3DObserver.hxx
rename to lib/fpa/VTK/Image/Observer3D.hxx
index 6efa1202e149aca607c8d0f95793e2448d312340..871142b7a0aa735f713caa1ca44ee97b701e306e 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __FPA__VTK__IMAGE3DOBSERVER__HXX__
-#define __FPA__VTK__IMAGE3DOBSERVER__HXX__
+#ifndef __FPA__VTK__IMAGE__OBSERVER3D__HXX__
+#define __FPA__VTK__IMAGE__OBSERVER3D__HXX__
 
 #include <vtkCellArray.h>
 #include <vtkPolyDataMapper.h>
@@ -11,7 +11,7 @@
 
 // -------------------------------------------------------------------------
 template< class F, class R >
-void fpa::VTK::Image3DObserver< F, R >::
+void fpa::VTK::Image::Observer3D< F, R >::
 SetRenderWindow( R* rw )
 {
   this->m_RenderWindow = rw;
@@ -19,7 +19,7 @@ SetRenderWindow( R* rw )
 
 // -------------------------------------------------------------------------
 template< class F, class R >
-void fpa::VTK::Image3DObserver< F, R >::
+void fpa::VTK::Image::Observer3D< F, R >::
 Render( )
 {
   if( this->m_RenderWindow != NULL )
@@ -28,7 +28,7 @@ Render( )
 
 // -------------------------------------------------------------------------
 template< class F, class R >
-void fpa::VTK::Image3DObserver< F, R >::
+void fpa::VTK::Image::Observer3D< F, R >::
 Execute( const itk::Object* c, const itk::EventObject& e )
 {
   typedef typename F::TStartEvent     _TStartEvent;
@@ -178,8 +178,8 @@ Execute( const itk::Object* c, const itk::EventObject& e )
 
 // -------------------------------------------------------------------------
 template< class F, class R >
-fpa::VTK::Image3DObserver< F, R >::
-Image3DObserver( )
+fpa::VTK::Image::Observer3D< F, R >::
+Observer3D( )
   : Superclass( ),
     m_RenderWindow( NULL ),
     m_RenderPercentage( double( 0.001 ) )
@@ -201,11 +201,11 @@ Image3DObserver( )
 
 // -------------------------------------------------------------------------
 template< class F, class R >
-fpa::VTK::Image3DObserver< F, R >::
-~Image3DObserver( )
+fpa::VTK::Image::Observer3D< F, R >::
+~Observer3D( )
 {
 }
 
-#endif // __FPA__VTK__IMAGE3DOBSERVER__HXX__
+#endif // __FPA__VTK__IMAGE__OBSERVER3D__HXX__
 
 // eof - $RCSfile$
diff --git a/lib/fpa/VTK/Image2DObserver.h b/lib/fpa/VTK/Image2DObserver.h
deleted file mode 100644 (file)
index c70b2af..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-#ifndef __FPA__VTK__IMAGE2DOBSERVER__H__
-#define __FPA__VTK__IMAGE2DOBSERVER__H__
-
-#include <set>
-#include <itkCommand.h>
-#include <vtkActor.h>
-#include <vtkImageActor.h>
-#include <vtkImageData.h>
-#include <vtkPolyData.h>
-#include <vtkSmartPointer.h>
-
-namespace fpa
-{
-  namespace VTK
-  {
-    /**
-     */
-    template< class F, class R >
-    class Image2DObserver
-      : public itk::Command
-    {
-    public:
-      typedef Image2DObserver                 Self;
-      typedef itk::Command                    Superclass;
-      typedef itk::SmartPointer< Self >       Pointer;
-      typedef itk::SmartPointer< const Self > ConstPointer;
-
-      typedef F                             TFilter;
-      typedef R                             TRenderWindow;
-      typedef typename TFilter::TInputImage TImage;
-      typedef typename TFilter::TVertex     TVertex;
-
-      typedef std::set< TVertex > TVertices;
-
-    public:
-      itkNewMacro( Self );
-      itkTypeMacro( Image2DObserver, itkCommand );
-
-      itkGetConstMacro( RenderPercentage, double );
-      itkSetMacro( RenderPercentage, double );
-
-    public:
-      void SetRenderWindow( R* rw );
-      void SetPixel(
-        typename TImage::IndexType idx,
-        unsigned char red,
-        unsigned char green,
-        unsigned char blue,
-        unsigned char alpha
-        );
-      void Render( );
-      void Execute( itk::Object* c, const itk::EventObject& e ) ITK_OVERRIDE
-        { this->Execute( ( const itk::Object* )( c ), e ); }
-      void Execute( const itk::Object* c, const itk::EventObject& e ) ITK_OVERRIDE;
-
-    protected:
-      Image2DObserver( );
-      virtual ~Image2DObserver( );
-
-    private:
-      Image2DObserver( const Self& ); // Not impl.
-      void operator=( const Self& );  // Not impl.
-
-    protected:
-      vtkSmartPointer< vtkImageData >  m_Stencil;
-      vtkSmartPointer< vtkImageActor > m_StencilActor;
-
-      R*            m_RenderWindow;
-      unsigned long m_Count;
-      unsigned long m_RenderCount;
-      double        m_RenderPercentage;
-    };
-
-  } // ecapseman
-
-} // ecapseman
-
-#ifndef ITK_MANUAL_INSTANTIATION
-#include <fpa/VTK/Image2DObserver.hxx>
-#endif // ITK_MANUAL_INSTANTIATION
-
-#endif // __FPA__VTK__IMAGE2DOBSERVER__H__
-
-// eof - $RCSfile$
diff --git a/lib/fpa/VTK/Image3DObserver.h b/lib/fpa/VTK/Image3DObserver.h
deleted file mode 100644 (file)
index a237696..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#ifndef __FPA__VTK__IMAGE3DOBSERVER__H__
-#define __FPA__VTK__IMAGE3DOBSERVER__H__
-
-#include <map>
-
-#include <itkCommand.h>
-
-#include <vtkActor.h>
-#include <vtkPolyData.h>
-#include <vtkPolyDataMapper.h>
-#include <vtkSmartPointer.h>
-
-namespace fpa
-{
-  namespace VTK
-  {
-    /**
-     */
-    template< class F, class R >
-    class Image3DObserver
-      : public itk::Command
-    {
-    public:
-      typedef Image3DObserver                 Self;
-      typedef itk::Command                    Superclass;
-      typedef itk::SmartPointer< Self >       Pointer;
-      typedef itk::SmartPointer< const Self > ConstPointer;
-
-      typedef F                                TFilter;
-      typedef R                                TRenderWindow;
-      typedef typename TFilter::TInputImage    TImage;
-      typedef typename TFilter::TVertex        TVertex;
-      typedef typename TFilter::TVertexCompare TVertexCompare;
-
-      typedef std::set< TVertex > TVertices;
-
-    public:
-      itkNewMacro( Self );
-      itkTypeMacro( Image3DObserver, itkCommand );
-
-      itkGetConstMacro( RenderPercentage, double );
-      itkSetMacro( RenderPercentage, double );
-
-    public:
-      void SetRenderWindow( R* rw );
-      void Render( );
-      void Execute( itk::Object* c, const itk::EventObject& e ) ITK_OVERRIDE
-        { this->Execute( ( const itk::Object* )( c ), e ); }
-      void Execute( const itk::Object* c, const itk::EventObject& e ) ITK_OVERRIDE;
-
-    protected:
-      Image3DObserver( );
-      virtual ~Image3DObserver( );
-
-    private:
-      Image3DObserver( const Self& ); // Not impl.
-      void operator=( const Self& );  // Not impl.
-
-    protected:
-      vtkSmartPointer< vtkPolyData >       m_PolyData;
-      vtkSmartPointer< vtkPolyDataMapper > m_PolyDataMapper;
-      vtkSmartPointer< vtkActor >          m_PolyDataActor;
-      std::map< TVertex, unsigned long, TVertexCompare >   m_PointsToReplace;
-      std::map< TVertex, unsigned long, TVertexCompare >   m_PointsInFront;
-
-      R*            m_RenderWindow;
-      unsigned long m_Count;
-      unsigned long m_RenderCount;
-      double        m_RenderPercentage;
-    };
-
-  } // ecapseman
-
-} // ecapseman
-
-#ifndef ITK_MANUAL_INSTANTIATION
-#include <fpa/VTK/Image3DObserver.hxx>
-#endif // ITK_MANUAL_INSTANTIATION
-
-#endif // __FPA__VTK__IMAGE3DOBSERVER__H__
-
-// eof - $RCSfile$
diff --git a/lib/fpa_Instances/Backtracking.i b/lib/fpa_Instances/Backtracking.i
new file mode 100644 (file)
index 0000000..aa162ee
--- /dev/null
@@ -0,0 +1,17 @@
+d #dims=2;3
+d #floats=float;double
+d #mst=fpa::Image::MinimumSpanningTree
+d #path=ExtractPathFromMinimumSpanningTree
+d #ebc=ExtractEndPointsAndBifurcationsFromMinimumSpanningTree
+
+f fpa_Instances/Instances.h
+
+t fpa/Base/#path.h
+t fpa/Base/#ebc.h
+t fpa/Image/#ebc.h
+
+c fpa::Base::#path< #mst< #dims > >
+c fpa::Base::#ebc< #mst< #dims > >
+c fpa::Image::#ebc< itk::Image< #floats, #dims >, #mst< #dims > >
+
+* eof - $RCSfile$
index 17d682643fac2b9d7f48180ead09018d5cf355e5..b0c55253984bfbc74a438fb515a4c2aad08bdd3b 100644 (file)
@@ -1,77 +1,24 @@
-FILE(
-  GLOB libs_DEFS RELATIVE
-  "${CMAKE_CURRENT_SOURCE_DIR}"
-  "${CMAKE_CURRENT_SOURCE_DIR}/*.i"
-  )
+## =================================
+## == Compile instances libraries ==
+## =================================
+
+SET(pfx "fpa_")
+SET(arg ${pfx} ${prj_VER} ${prj_sVER})
 
-SET(aux_ALL_INSTANCES)
-FOREACH(i ${libs_DEFS})
-  GET_FILENAME_COMPONENT(l_DEF ${i} NAME_WE)
-  SET(i_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${l_DEF}.i")
-  SET(h_FILE "${CMAKE_CURRENT_BINARY_DIR}/${l_DEF}.h")
-  SET(s_FILE "${CMAKE_CURRENT_BINARY_DIR}/${l_DEF}.cxx")
-  SET(o_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${l_DEF}_extra.cxx")
-  SET(l_NAME "fpa_${l_DEF}")
-  SET(aux_ALL_INSTANCES ${aux_ALL_INSTANCES} ${l_NAME})
-  ADD_CUSTOM_COMMAND(
-    OUTPUT ${h_FILE} ${s_FILE}
-    DEPENDS ${cpPlugins_CreateInstances} ${i_FILE}
-    COMMAND ${cpPlugins_CreateInstances} ${i_FILE} ${l_NAME} ${h_FILE} ${s_FILE}
-    )
-  IF(EXISTS ${o_FILE})
-    ADD_LIBRARY(${l_NAME} SHARED ${s_FILE} ${o_FILE})
-  ELSE(EXISTS ${o_FILE})
-    ADD_LIBRARY(${l_NAME} SHARED ${s_FILE})
-  ENDIF(EXISTS ${o_FILE})
-  SET_TARGET_PROPERTIES(
-    ${l_NAME} PROPERTIES
-    VERSION "${prj_VER}"
-    SOVERSION "${prj_sVER}"
-    )
-  GENERATE_EXPORT_HEADER(
-    ${l_NAME}
-    BASE_NAME ${l_NAME}
-    EXPORT_MACRO_NAME ${l_NAME}_EXPORT
-    EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/${l_NAME}_Export.h
-    STATIC_DEFINE ${l_NAME}_BUILT_AS_STATIC
-    )
-ENDFOREACH(i)
+cpPlugins_WrapInstances(Instances ${arg} ${cpPlugins_LIBRARIES})
+cpPlugins_WrapInstances(Functors ${arg} ${pfx}Instances)
+cpPlugins_WrapInstances(Filters ${arg} ${pfx}Instances)
+cpPlugins_WrapInstances(Backtracking ${arg} ${pfx}Instances)
+cpPlugins_WrapInstances(Observers ${arg} ${pfx}Filters)
 
 SET(
-  fpa_ALL_INSTANCES
-  ${aux_ALL_INSTANCES}
-  CACHE STRING "All instances libraries."
+  fpa_LIBRARIES
+  ${pfx}Instances
+  ${pfx}Functors
+  ${pfx}Filters
+  ${pfx}Backtracking
+  ${pfx}Observers
+  CACHE INTERNAL "All valid instances." FORCE
   )
 
-## Target links
-TARGET_LINK_LIBRARIES(fpa_Instances ${cpPlugins_LIBRARIES} ${ITK_LIBRARIES} ${VTK_LIBRARIES})
-TARGET_LINK_LIBRARIES(fpa_Filters fpa_Instances)
-TARGET_LINK_LIBRARIES(fpa_Observers fpa_Filters)
-
-# TARGET_LINK_LIBRARIES(fpa_Transforms ${ITK_LIBRARIES} fpa_Base)
-# TARGET_LINK_LIBRARIES(fpa_Paths fpa_Base)
-# TARGET_LINK_LIBRARIES(fpa_Mesh fpa_Base)
-# TARGET_LINK_LIBRARIES(fpa_Image fpa_Base)
-# TARGET_LINK_LIBRARIES(fpa_ImageIterators ${ITK_LIBRARIES} fpa_Image)
-# TARGET_LINK_LIBRARIES(fpa_ImageFiltersBase fpa_Image)
-# TARGET_LINK_LIBRARIES(fpa_InPlaceImageFiltersBase fpa_ImageFiltersBase)
-# TARGET_LINK_LIBRARIES(fpa_ImageITK2VTK fpa_ImageFiltersBase ${VTK_LIBRARIES})
-# TARGET_LINK_LIBRARIES(fpa_ThresholdFilters fpa_InPlaceImageFiltersBase fpa_ImageIterators)
-# TARGET_LINK_LIBRARIES(fpa_DistanceMapFilters fpa_ThresholdFilters)
-# TARGET_LINK_LIBRARIES(fpa_ResamplingFilters fpa_ImageFiltersBase fpa_ImageIterators fpa_Transforms)
-# TARGET_LINK_LIBRARIES(fpa_GaussianImageFilters fpa_ImageFiltersBase fpa_ImageIterators)
-# TARGET_LINK_LIBRARIES(fpa_ImageIO fpa_ImageFiltersBase fpa_ImageIterators)
-
-# INSTALL(
-#   TARGETS ${l_NAME}
-#   RUNTIME DESTINATION bin
-#   LIBRARY DESTINATION lib
-#   ARCHIVE DESTINATION lib/static
-#   )
-# INSTALL(
-#   FILES
-#   ${lib_HEADERS}
-#   DESTINATION include/${lib_DIR}
-#   )
-
 ## eof - $RCSfile$
index 0dfb9fffdce74da8c65d5844974176c7cd726d11..6452df01185bc0efbc9f3f87fe061cef9b58bd97 100644 (file)
@@ -1,17 +1,41 @@
 f fpa_Instances/Instances.h
 
-t fpa/Image/RegionGrow.h
-t fpa/Image/Dijkstra.h
-t fpa/Image/Algorithm.h
 t fpa/Base/Algorithm.h
 t fpa/Base/RegionGrow.h
 t fpa/Base/Dijkstra.h
 
+t fpa/Image/Algorithm.h
+t fpa/Image/RegionGrow.h
+t fpa/Image/Dijkstra.h
+
 d #dims=2;3
 d #int=char;short;int;long
 d #uint=unsigned #int
 d #float=float;double
 d #pixels=#int;#uint;#float
+d #b=fpa::Base
+d #i=fpa::Image
+d #mst=MinimumSpanningTree
+d #rg_ins=#pixels
+d #rg_outs=unsigned short;unsigned char
+d #d_ins=#pixels
+d #d_outs=#float
+d #inputs=#pixels
+d #outputs=#pixels
+
+* =====================
+* == Base algorithms ==
+* =====================
+
+c #b::Algorithm< itk::Index< #dims >, #inputs, #outputs, itk::Image< #inputs, #dims >, itk::Functor::IndexLexicographicCompare< #dims >, itk::ImageToImageFilter< itk::Image< #inputs, #dims >, itk::Image< #outputs, #dims > > >
+
+c #i::Algorithm< itk::Image< #rg_ins, #dims >, itk::Image< #rg_outs, #dims >, fpa::Base::RegionGrow< itk::Index< #dims >, #rg_ins, #rg_outs, itk::Image< #rg_ins, #dims >, itk::Functor::IndexLexicographicCompare< #dims >, itk::ImageToImageFilter< itk::Image< #rg_ins, #dims >, itk::Image< #rg_outs, #dims >  >  >  >
+
+* ======================
+* == Image algorithms ==
+* ======================
+
+c #i::RegionGrow< itk::Image< #rg_ins, #dims >, itk::Image< #rg_outs, #dims > >
+c #i::Dijkstra< itk::Image< #d_ins, #dims >, itk::Image< #d_outs, #dims > >
 
-c fpa::Image::RegionGrow< itk::Image< #pixels, #dims >, itk::Image< #uint, #dims > >
-c fpa::Image::Dijkstra< itk::Image< #pixels, #dims >, itk::Image< #float, #dims > >
+* eof - $RCSfile$
diff --git a/lib/fpa_Instances/Functors.i b/lib/fpa_Instances/Functors.i
new file mode 100644 (file)
index 0000000..0bb83ff
--- /dev/null
@@ -0,0 +1,31 @@
+d #functors=GulsunTekMedialness;FluxMedialness;MFluxMedialness
+d #filter=cpExtensions::Algorithms::ImageFunctionFilter
+d #vectors=itk::CovariantVector
+d #k=itk::Image
+
+f fpa_Instances/Instances.h
+
+t itkImageFunction.h
+t fpa/Image/Functors/#functors.h
+t fpa/Image/Functors/GradientImageFunctionBase.h
+t cpExtensions/Algorithms/ImageFunctionFilter.h
+
+d #dims=2;3
+d #int=char;short;int;long
+d #uint=unsigned #int
+d #float=float;double
+d #pixels=#int;#uint;#float
+d #b=fpa::Base
+d #i=fpa::Image
+d #mst=MinimumSpanningTree
+d #rg_ins=#pixels
+d #rg_outs=unsigned short;unsigned char
+d #d_ins=#pixels
+d #d_outs=#float
+d #inputs=#pixels
+d #outputs=#pixels
+
+c #i::Functors::#functors< #k< #vectors< #float, #dims >, #dims > >
+c #filter< #k< #vectors< #float, #dims >, #dims >, #k< #float, #dims >, #i::Functors::#functors< #k< #vectors< #float, #dims >, #dims > > >
+
+* eof - $RCSfile$
index c1d57ecfea44bfe7500bc9f9089edce13e67a4d7..526304688efb2d87685bc92280b68c492ca4bbb5 100644 (file)
@@ -1,23 +1,41 @@
 f cpPlugins_Instances/ScalarImagesBaseFilters.h
 
-t fpa/Image/MinimumSpanningTree.h
 t fpa/Base/MinimumSpanningTree.h
-t fpa/Base/RegionGrow.h
-t fpa/Base/Dijkstra.h
-t fpa/Base/Algorithm.h
-t itkImportImageContainer.h
+t fpa/Image/MinimumSpanningTree.h
+t fpa/IO/MinimumSpanningTreeReader.h
+t fpa/IO/MinimumSpanningTreeWriter.h
+
 t itkImage.h
+t itkImportImageContainer.h
+t itkImageRegionConstIteratorWithIndex.h
+t itkImageConstIteratorWithIndex.h
 
 d #dims=2;3
 d #int=char;short;int;long
 d #uint=unsigned #int
 d #float=float;double
 d #pixels=#int;#uint;#float
+d #b=fpa::Base
+d #i=fpa::Image
+d #mst=MinimumSpanningTree
+d #rg_ins=#pixels
+d #rg_outs=unsigned short;unsigned char
+d #d_ins=#pixels
+d #d_outs=#float
+d #inputs=#pixels
+d #outputs=#pixels
+
+* ================
+* == Base types ==
+* ================
+
+c itk::ImportImageContainer< unsigned long, #i::{#mst}Data< #dims > >
+c itk::Image< #i::{#mst}Data< #dims >, #dims >
+c #b::#mst< itk::Image< #i::{#mst}Data< #dims >, #dims >, itk::Index< #dims > >
+c #i::#mst@{Data;{}}< #dims >
+
+c itk::ImageConstIteratorWithIndex< #i::#mst< #dims > >
+c itk::ImageRegionConstIteratorWithIndex< #i::#mst< #dims > >
+c fpa::IO::MinimumSpanningTree@{Reader;Writer}< #i::#mst< #dims > >
 
-c itk::ImportImageContainer< unsigned long, fpa::Image::MinimumSpanningTreeData< #dims > >
-c itk::Image< fpa::Image::MinimumSpanningTreeData< #dims >, #dims >
-c fpa::Base::MinimumSpanningTree< itk::Image< fpa::Image::MinimumSpanningTreeData< #dims >, #dims >, itk::Index< #dims > >
-c fpa::Image::MinimumSpanningTree< #dims >
-c fpa::Base::Algorithm< itk::Index< #dims >, #pixels, #pixels, itk::Image< #pixels, #dims >, itk::Functor::IndexLexicographicCompare< #dims >, itk::ImageToImageFilter< itk::Image< #pixels, #dims >, itk::Image< #pixels, #dims > > >
-c fpa::Base::Dijkstra< itk::Index< #dims >, #pixels, #float, itk::Image< #pixels, #dims >, itk::Functor::IndexLexicographicCompare< #dims >, fpa::Image::MinimumSpanningTree< #dims >, itk::ImageToImageFilter< itk::Image< #pixels, #dims >, itk::Image< #float, #dims> > >
-c fpa::Base::RegionGrow< itk::Index< #dims >, #pixels, #uint, itk::Image< #pixels, #dims >, itk::Functor::IndexLexicographicCompare< #dims >, itk::ImageToImageFilter< itk::Image< #pixels, #dims >, itk::Image< #uint, #dims > > >
+* eof - $RCSfile$
index a7aa67b17fb65794471193454be0b410d7f03287..247788b1ac7fb5591d81a9fc1f99ead867f30e82 100644 (file)
@@ -1,15 +1,24 @@
-f fpa_Instances/Filters.h
-
-i vtkRenderWindow.h
-
-t fpa/VTK/Image2DObserver.h
-t fpa/VTK/Image3DObserver.h
-
 d #dims=2;3
 d #int=char;short;int;long
 d #uint=unsigned #int
 d #float=float;double
 d #pixels=#int;#uint;#float
+d #rg_ins=#pixels
+d #rg_outs=unsigned short;unsigned char
+d #d_ins=#pixels
+d #d_outs=#float
+d #cls=fpa::VTK::Image::Observer
+d #i=fpa::Image
+d #k=itk::Image
+
+f fpa_Instances/Filters.h
+
+i vtkRenderWindow.h
+
+t fpa/VTK/Image/Observer2D.h
+t fpa/VTK/Image/Observer3D.h
+
+c {#cls}{#dims}D< #i::RegionGrow< #k< #rg_ins, #dims >, #k< #rg_outs, #dims > >, vtkRenderWindow >
+c {#cls}{#dims}D< #i::Dijkstra< #k< #d_ins, #dims >, #k< #d_outs, #dims > >, vtkRenderWindow >
 
-c @{fpa::VTK::Image2DObserver;fpa::VTK::Image3DObserver}< fpa::Image::RegionGrow< itk::Image< #pixels, #dims >, itk::Image< #uint, #dims > >, vtkRenderWindow >
-c @{fpa::VTK::Image2DObserver;fpa::VTK::Image3DObserver}< fpa::Image::Dijkstra< itk::Image< #pixels, #dims >, itk::Image< #float, #dims > >, vtkRenderWindow >
+* eof - $RCSfile$
index df80a25a861484455b0bc8348117fd9d22aa7f11..fd17844020b56ca7d0eb682ac679e64a61789922 100644 (file)
@@ -1,5 +1,7 @@
-SUBDIRS(
-  fpa
-  )
+IF(BUILD_PLUGINS)
+  SUBDIRS(
+    fpa
+    )
+ENDIF(BUILD_PLUGINS)
 
 ## eof - $RCSfile$
index f10d067701feb94466e0fb1717652d8bddf98ebc..88e80f332542499d08362f257c331afa5eb5b8dc 100644 (file)
@@ -1,6 +1,5 @@
 #include "BaseImageFilter.h"
 #include <cpPlugins/Image.h>
-//#include <itkSimpleDataObjectDecorator.hxx>
 
 // -------------------------------------------------------------------------
 bool fpaPlugins::BaseImageFilter::
index 9db580a9bea296ab8484dc1026046656549a7a07..6bce1d5540c0900fbd2778b23b91e9f5ba05181b 100644 (file)
@@ -1,33 +1,23 @@
 #ifndef __FPAPLUGINS__BASEIMAGEFILTER__HXX__
 #define __FPAPLUGINS__BASEIMAGEFILTER__HXX__
 
+#include <cpExtensions/DataStructures/ImageIndexesContainer.h>
 #include <fpa_Instances/Observers.h>
-#include <itkSimpleDataObjectDecorator.h>
-/* TODO
-   #include <cpPlugins/Image.h>
-   #include <fpa/VTK/Image2DObserver.h>
-   #include <fpa/VTK/Image3DObserver.h>
-   #include <vtkRenderWindowInteractor.h>
-
-   #include <fpa/VTK/Image2DObserver.hxx>
-   #include <fpa/VTK/Image3DObserver.hxx>
-*/
 
 // -------------------------------------------------------------------------
 template< class _TFilter >
 _TFilter* fpaPlugins::BaseImageFilter::
 _ConfigureFilter( )
 {
-  typedef typename _TFilter::TInputImage                _TImage;
-  typedef typename _TImage::IndexType                   _TIndex;
-  typedef itk::Point< double, _TImage::ImageDimension > _TPoint;
-  typedef itk::SimpleDataObjectDecorator< std::vector< _TPoint > > _TPoints;
-  typedef itk::SimpleDataObjectDecorator< std::vector< _TIndex > > _TIndexes;
+  typedef typename _TFilter::TInputImage _TImage;
+  static const unsigned int Dim = _TImage::ImageDimension;
+  typedef
+    cpExtensions::DataStructures::ImageIndexesContainer< Dim >
+    _TIndexes;
 
   auto image = this->GetInputData( "Input" )->GetITK< _TImage >( );
   if( image == NULL )
     return( NULL );
-  auto points = this->GetInputData( "Seeds" )->GetITK< _TPoints >( );
   auto indexes = this->GetInputData( "Seeds" )->GetITK< _TIndexes >( );
 
   // Create filter and connect input
@@ -42,27 +32,10 @@ _ConfigureFilter( )
 
   // Assign seeds
   filter->ClearSeeds( );
-  if( points != NULL )
-  {
-    for(
-      auto pIt = points->Get( ).begin( );
-      pIt != points->Get( ).end( );
-      ++pIt
-      )
-    {
-      _TIndex idx;
-      if( image->TransformPhysicalPointToIndex( *pIt, idx ) )
-        filter->AddSeed( idx, 0 );
-
-    } // rof
-  }
-  else if( indexes != NULL )
+  if( indexes != NULL )
   {
-    for(
-      auto iIt = indexes->Get( ).begin( );
-      iIt != indexes->Get( ).end( );
-      ++iIt
-      )
+    auto iIt = indexes->Get( ).begin( );
+    for( ; iIt != indexes->Get( ).end( ); ++iIt )
       filter->AddSeed( *iIt, 0 );
 
   } // fi
@@ -92,8 +65,8 @@ void fpaPlugins::BaseImageFilter::
 _ConfigureDebugger( _TFilter* filter )
 {
   typedef typename _TFilter::TInputImage _TImage;
-  typedef fpa::VTK::Image2DObserver< _TFilter, vtkRenderWindow > _2D;
-  typedef fpa::VTK::Image3DObserver< _TFilter, vtkRenderWindow > _3D;
+  typedef fpa::VTK::Image::Observer2D< _TFilter, vtkRenderWindow > _2D;
+  typedef fpa::VTK::Image::Observer3D< _TFilter, vtkRenderWindow > _3D;
 
   this->m_Observers.clear( );
   if( this->m_Parameters.GetBool( "VisualDebug" ) )
index 18f6377cd19ab2a9c47377bfa6c24fe2a2ef7a36..cc21d762dee895fb0bc932e5c48ba5c4ca0c1afe 100644 (file)
@@ -1,98 +1,57 @@
 SET(lib_NAME fpaPlugins)
-SET(lib_DIR  fpa)
-
-## ===============
-## = Source code =
-## ===============
-
 SET(
-  base_HEADERS_H
-  ${CMAKE_CURRENT_SOURCE_DIR}/BaseImageFilter.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/MinimumSpanningTree.h
-  )
-
-SET(
-  filters_HEADERS_H
-  #${CMAKE_CURRENT_SOURCE_DIR}/MinimumSpanningTreeReader.h
-  #${CMAKE_CURRENT_SOURCE_DIR}/MinimumSpanningTreeWriter.h
+  lib_HEADERS
+  ${CMAKE_CURRENT_SOURCE_DIR}/GradientBaseImageFunctionSource.h
   ${CMAKE_CURRENT_SOURCE_DIR}/ImageRegionGrow.h
   ${CMAKE_CURRENT_SOURCE_DIR}/ImageDijkstra.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/MinimumSpanningTreeReader.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/MinimumSpanningTreeWriter.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/RegionGrowThresholdFunction.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/InvertCostFunction.h
   ${CMAKE_CURRENT_SOURCE_DIR}/ExtractPathFromMinimumSpanningTree.h
   ${CMAKE_CURRENT_SOURCE_DIR}/ExtractEndPointsAndBifurcationsFromMinimumSpanningTree.h
-  #${CMAKE_CURRENT_SOURCE_DIR}/RegionGrowThresholdFunction.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/InvertCostFunction.h
-  #${CMAKE_CURRENT_SOURCE_DIR}/GradientBaseImageFunctionSource.h
-  )
-
-SET(
-  base_HEADERS_HXX
-  ${CMAKE_CURRENT_SOURCE_DIR}/BaseImageFilter.hxx
-  )
-
-SET(
-  base_SOURCES_CXX
-  ${CMAKE_CURRENT_SOURCE_DIR}/BaseImageFilter.cxx
-  ${CMAKE_CURRENT_SOURCE_DIR}/MinimumSpanningTree.cxx
   )
-
 SET(
-  filters_SOURCES_CXX
-  #${CMAKE_CURRENT_SOURCE_DIR}/MinimumSpanningTreeReader.cxx
-  #${CMAKE_CURRENT_SOURCE_DIR}/MinimumSpanningTreeWriter.cxx
+  lib_SOURCES
+  ${CMAKE_CURRENT_SOURCE_DIR}/GradientBaseImageFunctionSource.cxx
   ${CMAKE_CURRENT_SOURCE_DIR}/ImageRegionGrow.cxx
   ${CMAKE_CURRENT_SOURCE_DIR}/ImageDijkstra.cxx
+  ${CMAKE_CURRENT_SOURCE_DIR}/MinimumSpanningTreeReader.cxx
+  ${CMAKE_CURRENT_SOURCE_DIR}/MinimumSpanningTreeWriter.cxx
+  ${CMAKE_CURRENT_SOURCE_DIR}/RegionGrowThresholdFunction.cxx
+  ${CMAKE_CURRENT_SOURCE_DIR}/InvertCostFunction.cxx
   ${CMAKE_CURRENT_SOURCE_DIR}/ExtractPathFromMinimumSpanningTree.cxx
   ${CMAKE_CURRENT_SOURCE_DIR}/ExtractEndPointsAndBifurcationsFromMinimumSpanningTree.cxx
-  #${CMAKE_CURRENT_SOURCE_DIR}/RegionGrowThresholdFunction.cxx
-  ${CMAKE_CURRENT_SOURCE_DIR}/InvertCostFunction.cxx
-  #${CMAKE_CURRENT_SOURCE_DIR}/GradientBaseImageFunctionSource.cxx
   )
-
 SET(
-  target_LIBRARIES
-  ${fpa_ALL_INSTANCES}
-  ${cpExtensions_LIBRARY}
+  lib_OTHER_SOURCES
+  ${CMAKE_CURRENT_SOURCE_DIR}/BaseImageFilter.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/BaseImageFilter.hxx
+  ${CMAKE_CURRENT_SOURCE_DIR}/BaseImageFilter.cxx
+  ${CMAKE_CURRENT_SOURCE_DIR}/MinimumSpanningTree.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/MinimumSpanningTree.cxx
   )
+SET(lib_QT4_HEADERS "")
 
-## =====================
-## = Compilation rules =
-## =====================
-
-ADD_CUSTOM_COMMAND(
-  OUTPUT ${lib_NAME}_Host.cxx
-  DEPENDS ${cpPlugins_HostCreator} ${filters_HEADERS_H}
-  COMMAND ${cpPlugins_HostCreator} ${lib_NAME}_Host.cxx ${filters_HEADERS_H}
-  )
-ADD_LIBRARY(
-  ${lib_NAME}
-  SHARED
-  ${lib_NAME}_Host.cxx
-  ${base_SOURCES_CXX}
-  ${filters_SOURCES_CXX}
-  )
-SET_TARGET_PROPERTIES(
-  ${lib_NAME} PROPERTIES
-  VERSION "${prj_VER}"
-  SOVERSION "${prj_sVER}"
-  )
-GENERATE_EXPORT_HEADER(
-  ${lib_NAME}
-  BASE_NAME ${lib_NAME}
-  EXPORT_MACRO_NAME ${lib_NAME}_EXPORT
-  EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/plugins/${lib_DIR}/${lib_NAME}_Export.h
-  STATIC_DEFINE ${lib_NAME}_BUILT_AS_STATIC
+cpPlugins_WrapPlugins(
+  ${lib_NAME} ${prj_VER} ${prj_sVER}
+  "${lib_HEADERS}"
+  "${lib_SOURCES}"
+  "${lib_OTHER_SOURCES}"
+  "${lib_QT4_HEADERS}"
+  ${cpExtensions_LIBRARY}
+  ${fpa_LIBRARIES}
   )
-TARGET_LINK_LIBRARIES(${lib_NAME} ${target_LIBRARIES})
 
 ## ========================
 ## -- Installation rules --
 ## ========================
 
-INSTALL(
-  TARGETS ${lib_NAME}
-  RUNTIME DESTINATION bin
-  LIBRARY DESTINATION lib
-  ARCHIVE DESTINATION lib/static
-  )
+#INSTALL(
+#  TARGETS ${lib_NAME}
+#  RUNTIME DESTINATION bin
+#  LIBRARY DESTINATION lib
+#  ARCHIVE DESTINATION lib/static
+#  )
 
 ## eof - $RCSfile$
index 0b1d597b9fd96f486324ca59a028e326e7874f43..793493b6f69847b2d821530744b4f36ff65bebc1 100644 (file)
@@ -1,12 +1,8 @@
 #include "ExtractEndPointsAndBifurcationsFromMinimumSpanningTree.h"
 
+#include <fpa_Instances/Backtracking.h>
 #include <cpPlugins/Image.h>
 #include <cpPlugins/ImageIndexesContainer.h>
-#include <fpa_Instances/Instances.h>
-#include <itkSimpleDataObjectDecorator.hxx>
-#include <fpa/Image/ExtractEndPointsAndBifurcationsFromMinimumSpanningTree.h>
-#include <fpa/Base/ExtractEndPointsAndBifurcationsFromMinimumSpanningTree.hxx>
-#include <fpa/Image/ExtractEndPointsAndBifurcationsFromMinimumSpanningTree.hxx>
 
 // -------------------------------------------------------------------------
 fpaPlugins::ExtractEndPointsAndBifurcationsFromMinimumSpanningTree::
index db5332a18e9a3d5818534989c31c060809ea867f..c263b9c0c09ab8830a78c513fa61f6c7e6a2a75d 100644 (file)
@@ -1,15 +1,7 @@
 #include "ExtractPathFromMinimumSpanningTree.h"
-#include <fpa_Instances/Instances.h>
-
-#include <itkDataObject.h>
-#include <itkIndex.h>
-#include <itkSimpleDataObjectDecorator.hxx>
-#include <itkVectorContainer.hxx>
-#include <itkParametricPath.hxx>
-#include <cpPlugins_Instances/Paths.h>
 #include <cpPlugins/Path.h>
-#include <fpa/Base/ExtractPathFromMinimumSpanningTree.h>
-#include <fpa/Base/ExtractPathFromMinimumSpanningTree.hxx>
+#include <cpExtensions/DataStructures/ImageIndexesContainer.h>
+#include <fpa_Instances/Backtracking.h>
 
 // -------------------------------------------------------------------------
 fpaPlugins::ExtractPathFromMinimumSpanningTree::
@@ -52,9 +44,10 @@ template< class _TMST >
 std::string fpaPlugins::ExtractPathFromMinimumSpanningTree::
 _GD0( _TMST* mst )
 {
-  typedef fpa::Base::ExtractPathFromMinimumSpanningTree< _TMST >    _TFilter;
-  typedef typename _TMST::TVertex                                   _TVertex;
-  typedef itk::SimpleDataObjectDecorator< std::vector< _TVertex > > _TVertices;
+  typedef fpa::Base::ExtractPathFromMinimumSpanningTree< _TMST > _TFilter;
+  typedef
+    cpExtensions::DataStructures::ImageIndexesContainer< _TMST::Dimension >
+    _TVertices;
   if( mst == NULL )
     return(
       "fpaPlugins::ExtractPathFromMinimumSpanningTree: No valid input tree."
index 129968e4545f9ca24c81dc980ec66f1bcb6138e4..926523d9dcdbe162e439d5253f87b0392ba39fe2 100644 (file)
@@ -1,19 +1,7 @@
 #include "GradientBaseImageFunctionSource.h"
+
 #include <cpPlugins/Image.h>
-#include <fpa/Image/Functors/GulsunTekMedialness.h>
-#include <fpa/Image/Functors/FluxMedialness.h>
-#include <fpa/Image/Functors/MFluxMedialness.h>
-#include <cpExtensions/Algorithms/ImageFunctionFilter.h>
-#include <fpa/Image/Functors/GulsunTekMedialness.hxx>
-#include <fpa/Image/Functors/FluxMedialness.hxx>
-#include <fpa/Image/Functors/MFluxMedialness.hxx>
-#include <fpa/Image/Functors/GradientImageFunctionBase.hxx>
-#include <cpExtensions/Algorithms/ImageFunctionFilter.hxx>
-#include <itkImageConstIteratorWithIndex.hxx>
-#include <itkImageIteratorWithIndex.hxx>
-#include <itkImageToImageFilter.hxx>
-#include <itkImageFunction.hxx>
-#include <itkImageRegionConstIteratorWithIndex.hxx>
+#include <fpa_Instances/Functors.h>
 
 // -------------------------------------------------------------------------
 fpaPlugins::GradientBaseImageFunctionSource::
index b5b3a628082937c1db2fbf47a576747ab80e3bd2..b906a2179c92d61ef6f9b1a37e5521618e9564b3 100644 (file)
@@ -3,14 +3,6 @@
 
 #include <cpPlugins/Image.h>
 #include <fpa_Instances/Filters.h>
-#include <fpa/Image/Functors/RegionGrowAllBelongsFunction.h>
-
-#include <fpa/Base/Algorithm.hxx>
-#include <fpa/Base/Dijkstra.hxx>
-#include <fpa/Image/Algorithm.hxx>
-#include <fpa/Image/Dijkstra.hxx>
-#include <fpa/VTK/Image2DObserver.hxx>
-#include <fpa/VTK/Image3DObserver.hxx>
 
 // -------------------------------------------------------------------------
 fpaPlugins::ImageDijkstra::
@@ -44,10 +36,12 @@ template< class _TImage >
 std::string fpaPlugins::ImageDijkstra::
 _GD0( _TImage* image )
 {
-  typedef fpa::Image::Dijkstra< _TImage, _TImage > _TFilter;
-  typedef typename _TFilter::TResult               _TCost;
-  typedef itk::FunctionBase< _TCost, _TCost >      _TCostFunctor;
-  typedef typename _TFilter::TMinimumSpanningTree  _TMST;
+  typedef float                                          _TPixel;
+  typedef itk::Image< _TPixel, _TImage::ImageDimension > _TOutImage;
+  typedef fpa::Image::Dijkstra< _TImage, _TOutImage >    _TFilter;
+  typedef typename _TFilter::TResult                     _TCost;
+  typedef itk::FunctionBase< _TCost, _TCost >            _TCostFunctor;
+  typedef typename _TFilter::TMinimumSpanningTree        _TMST;
 
   if( image == NULL )
     return( "fpaPlugins::ImageDijkstra: Invalid image type." );
index 27d5eca405c52c232d6102d760ec0defc12ee754..8ee71cabc001bdc21a1d4a3d12285985f64d8b40 100644 (file)
@@ -2,14 +2,6 @@
 
 #include <cpPlugins/Image.h>
 #include <fpa_Instances/Filters.h>
-#include <fpa/Image/Functors/RegionGrowAllBelongsFunction.h>
-
-#include <fpa/Base/Algorithm.hxx>
-#include <fpa/Base/RegionGrow.hxx>
-#include <fpa/Image/Algorithm.hxx>
-#include <fpa/Image/RegionGrow.hxx>
-#include <fpa/VTK/Image2DObserver.hxx>
-#include <fpa/VTK/Image3DObserver.hxx>
 
 // -------------------------------------------------------------------------
 fpaPlugins::ImageRegionGrow::
@@ -44,25 +36,24 @@ template< class _TImage >
 std::string fpaPlugins::ImageRegionGrow::
 _GD0( _TImage* image )
 {
-  typedef fpa::Image::RegionGrow< _TImage, _TImage > _TFilter;
-  typedef typename _TFilter::TGrowingFunction        _TGrowFunctor;
-  typedef typename _TFilter::TResult                 _TResult;
+  typedef unsigned short _TPixel;
+  typedef itk::Image< _TPixel, _TImage::ImageDimension > _TOutImage;
+  typedef fpa::Image::RegionGrow< _TImage, _TOutImage >  _TFilter;
+  typedef typename _TFilter::TGrowingFunction            _TGrowFunctor;
+  typedef typename _TFilter::TResult                     _TResult;
 
   if( image == NULL )
     return( "fpaPlugins::ImageRegionGrow: Invalid image type." );
 
-  // Get functor (if any)
+  // Create filter
+  _TFilter* filter = this->_ConfigureFilter< _TFilter >( );
+
   typename _TGrowFunctor::Pointer functor;
   auto wrap_functor = this->GetInputData( "GrowFunctor" );
   if( wrap_functor != NULL )
     functor = wrap_functor->GetITK< _TGrowFunctor >( );
   if( functor.IsNull( ) )
-    functor =
-      fpa::Image::Functors::RegionGrowAllBelongsFunction< _TImage >::New( );
-
-  // Create filter
-  _TFilter* filter = this->_ConfigureFilter< _TFilter >( );
-  filter->SetGrowingFunction( functor );
+    filter->SetGrowingFunction( functor );
   filter->SetInsideValue(
     _TResult( this->m_Parameters.GetUint( "InsideValue" ) )
     );
index 98ef9894f98d1b377394e47df8de772afab110aa..8326dfb6fefa31792773ca9a1ae01e12a194e68f 100644 (file)
@@ -1,8 +1,7 @@
 #include "MinimumSpanningTreeReader.h"
 #include "MinimumSpanningTree.h"
 
-#include <fpa/IO/MinimumSpanningTreeReader.h>
-#include <fpa/IO/MinimumSpanningTreeReader.hxx>
+#include <fpa_Instances/Instances.h>
 
 // -------------------------------------------------------------------------
 fpaPlugins::MinimumSpanningTreeReader::
index 90fd42897c5759f241b07638a35b3f16eea7446f..97570068a5b9195dd223a75fc5ee4a8e23a8c8b6 100644 (file)
@@ -1,8 +1,7 @@
 #include "MinimumSpanningTreeWriter.h"
 #include "MinimumSpanningTree.h"
 
-#include <fpa/IO/MinimumSpanningTreeWriter.h>
-#include <fpa/IO/MinimumSpanningTreeWriter.hxx>
+#include <fpa_Instances/Instances.h>
 
 // -------------------------------------------------------------------------
 fpaPlugins::MinimumSpanningTreeWriter::