From 3895259354d50760187c84e5a23807f6336fbbdf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leonardo=20Fl=C3=B3rez-Valencia?= Date: Mon, 21 Nov 2016 11:38:24 -0500 Subject: [PATCH] ... --- CMakeLists.txt | 15 ++++--------- cmake/Functions.cmake | 3 +-- cmake/QtTools.cmake | 2 +- .../CMakeLists.txt | 21 ++++++++++--------- .../DataObjects.i} | 0 .../fpa_Filters.i => fpaInstances/Filters.i} | 0 plugins/CMakeLists.txt | 9 ++++---- plugins/Plugins/BaseImageFilter.cxx | 4 ++-- .../ExtractPathFromMinimumSpanningTree.cxx | 8 +++---- plugins/Plugins/GaussianModelCost.cxx | 2 +- plugins/Plugins/ImageDijkstra.cxx | 6 +++--- plugins/Plugins/ImageRegionGrow.cxx | 8 ++++--- plugins/Plugins/InvertCost.cxx | 2 +- plugins/Plugins/RegionGrowBinaryThreshold.cxx | 6 +++--- .../RegionGrowBinaryThresholdWithSeeds.cxx | 6 +++--- plugins/Plugins/SimpleImageDijkstraCost.cxx | 6 +++--- plugins/Plugins/SimpleImageNeighborhood.cxx | 6 +++--- plugins/Plugins/SkeletonFilter.cxx | 10 ++++----- 18 files changed, 55 insertions(+), 59 deletions(-) rename lib/{Instances => fpaInstances}/CMakeLists.txt (50%) rename lib/{Instances/fpa_DataObjects.i => fpaInstances/DataObjects.i} (100%) rename lib/{Instances/fpa_Filters.i => fpaInstances/Filters.i} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index fec6ee2..3cdfd45 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,20 +35,13 @@ SET(prj_SHORT_VERSION "${prj_MAJOR_VERSION}") ## == Functions, packages and options == ## ===================================== -INCLUDE(cmake/Restrictions.cmake) -INCLUDE(cmake/KitwareTools.cmake) OPTION(USE_cpPlugins "Build cpPlugins-based code" OFF) IF(USE_cpPlugins) FIND_PACKAGE(cpPlugins REQUIRED) - IF(USE_QT4) - INCLUDE(cmake/QtTools.cmake) - SET( - cpPlugins_Qt4_VTKWidget QVTKWidget - CACHE STRING "Base Qt4-based vtkRenderWindow" - ) - MARK_AS_ADVANCED(FORCE cpPlugins_Qt4_VTKWidget) - ENDIF(USE_QT4) ENDIF(USE_cpPlugins) +INCLUDE(cmake/Restrictions.cmake) +INCLUDE(cmake/KitwareTools.cmake) +INCLUDE(cmake/QtTools.cmake) INCLUDE(cmake/Functions.cmake) ## =========================== @@ -56,6 +49,6 @@ INCLUDE(cmake/Functions.cmake) ## =========================== ## SUBDIRS(appli cmake lib plugins) -SUBDIRS(lib) +SUBDIRS(lib plugins) ## eof - $RCSfile$ diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake index aebf89f..91f026a 100644 --- a/cmake/Functions.cmake +++ b/cmake/Functions.cmake @@ -177,8 +177,7 @@ FOREACH(_i ${_instances}) ## -- Infere source code filenames MATH(EXPR _last_range "${cpPlugins_CONFIG_NUMBER_OF_FILES}-1") - SET(_out_code "${_i_path}/${_out_name}.h") - LIST(APPEND _hdrs ${_i_path}/${_out_name}.h) + SET(_out_code) FOREACH(_n RANGE 0 ${_last_range}) LIST(APPEND _out_code ${_i_path}/${_out_name}_${_n}.cxx) LIST(APPEND _srcs ${_i_path}/${_out_name}_${_n}.cxx) diff --git a/cmake/QtTools.cmake b/cmake/QtTools.cmake index 8e884b0..a3b4966 100644 --- a/cmake/QtTools.cmake +++ b/cmake/QtTools.cmake @@ -2,7 +2,6 @@ ## == Find Qt4 and check if it was well configured == ## ================================================== -OPTION(USE_QT4 "Build Qt4-based code" OFF) IF(USE_QT4) SET(QT4_FOUND "0") FIND_PACKAGE(Qt4 REQUIRED) @@ -23,6 +22,7 @@ IF(USE_QT4) QVTKWidget CACHE STRING "Base Qt4-based vtkRenderWindow" ) + MARK_AS_ADVANCED(FORCE cpPlugins_Qt4_VTKWidget) ENDIF(USE_QT4) ## eof - $RCSfile$ diff --git a/lib/Instances/CMakeLists.txt b/lib/fpaInstances/CMakeLists.txt similarity index 50% rename from lib/Instances/CMakeLists.txt rename to lib/fpaInstances/CMakeLists.txt index a51aa87..ed34274 100644 --- a/lib/Instances/CMakeLists.txt +++ b/lib/fpaInstances/CMakeLists.txt @@ -3,24 +3,25 @@ ## =========================== SET( - _all_defs + _definitions DataObjects Filters ) SET(_all_libs) -FOREACH(_def ${_all_defs}) - CreateLib( - fpaInstances${_def} SHARED ${CMAKE_CURRENT_SOURCE_DIR}/fpa_${_def}.i +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} ) - LIST(APPEND _all_libs fpaInstances_${_def}) -ENDFOREACH(_def) + LIST(APPEND _all_libs fpaInstances${_d}) +ENDFOREACH(_d) TARGET_LINK_LIBRARIES( fpaInstancesDataObjects - ${ITK_LIBRARIES} - ${VTK_LIBRARIES} - ${cpPlugins_Instances} + ${cpPlugins_AllInstances} ) TARGET_LINK_LIBRARIES( fpaInstancesFilters @@ -28,7 +29,7 @@ TARGET_LINK_LIBRARIES( ) SET( - fpa_Instances ${_all_libs} + fpa_AllInstances ${_all_libs} CACHE INTERNAL "All valid instances." FORCE ) diff --git a/lib/Instances/fpa_DataObjects.i b/lib/fpaInstances/DataObjects.i similarity index 100% rename from lib/Instances/fpa_DataObjects.i rename to lib/fpaInstances/DataObjects.i diff --git a/lib/Instances/fpa_Filters.i b/lib/fpaInstances/Filters.i similarity index 100% rename from lib/Instances/fpa_Filters.i rename to lib/fpaInstances/Filters.i diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 36271c8..b032409 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -7,13 +7,14 @@ IF(USE_cpPlugins) ${PROJECT_SOURCE_DIR}/lib ${PROJECT_BINARY_DIR}/lib ) - CreatePlugin(fpaPlugins Plugins ${cpPlugins_CONFIG_NUMBER_OF_FILES}) + CreatePlugin(fpaPlugins Plugins) TARGET_LINK_LIBRARIES( fpaPlugins - cpPlugins cpExtensions - ${cpPlugins_Instances} - ${fpa_Instances} + cpPlugins + ${cpPlugins_AllInstances} + ${fpa_AllInstances} ) + MESSAGE(STATUS ${cpPlugins_AllInstances}) ENDIF(USE_cpPlugins) ## eof - $RCSfile$ \ No newline at end of file diff --git a/plugins/Plugins/BaseImageFilter.cxx b/plugins/Plugins/BaseImageFilter.cxx index 746bd31..0059246 100644 --- a/plugins/Plugins/BaseImageFilter.cxx +++ b/plugins/Plugins/BaseImageFilter.cxx @@ -1,5 +1,5 @@ #include -#include +#include // ------------------------------------------------------------------------- fpaPlugins::BaseImageFilter:: @@ -7,7 +7,7 @@ BaseImageFilter( ) : Superclass( ) { typedef cpPlugins::BaseObjects::DataObject _TData; - typedef cpPlugins::DataObjects::Image _TImage; + typedef cpInstances::Image _TImage; this->_ConfigureInput< _TImage >( "Input", true, false ); this->_ConfigureInput< _TData >( "Seeds", true, false ); diff --git a/plugins/Plugins/ExtractPathFromMinimumSpanningTree.cxx b/plugins/Plugins/ExtractPathFromMinimumSpanningTree.cxx index 8d3b9c7..80d4111 100644 --- a/plugins/Plugins/ExtractPathFromMinimumSpanningTree.cxx +++ b/plugins/Plugins/ExtractPathFromMinimumSpanningTree.cxx @@ -1,6 +1,6 @@ #include -#include -#include +#include +#include #include #include @@ -10,8 +10,8 @@ ExtractPathFromMinimumSpanningTree( ) : Superclass( ) { typedef cpPlugins::BaseObjects::DataObject _TData; - typedef cpPlugins::DataObjects::Image _TMST; - typedef cpPlugins::DataObjects::PolyLineParametricPath _TPath; + typedef cpInstances::Image _TMST; + typedef cpInstances::PolyLineParametricPath _TPath; this->_ConfigureInput< _TMST >( "MST", true, false ); this->_ConfigureInput< _TData >( "Seeds", true, false ); diff --git a/plugins/Plugins/GaussianModelCost.cxx b/plugins/Plugins/GaussianModelCost.cxx index e817fb6..c84f5e7 100644 --- a/plugins/Plugins/GaussianModelCost.cxx +++ b/plugins/Plugins/GaussianModelCost.cxx @@ -1,5 +1,5 @@ #include -#include +#include #include diff --git a/plugins/Plugins/ImageDijkstra.cxx b/plugins/Plugins/ImageDijkstra.cxx index d5ce7df..7c8212e 100644 --- a/plugins/Plugins/ImageDijkstra.cxx +++ b/plugins/Plugins/ImageDijkstra.cxx @@ -1,6 +1,6 @@ #include -#include -#include +#include +#include #include #include @@ -11,7 +11,7 @@ ImageDijkstra( ) : Superclass( ) { typedef cpPlugins::BaseObjects::DataObject _TData; - typedef cpPlugins::DataObjects::Image _TMST; + typedef cpInstances::Image _TMST; this->_ConfigureInput< _TData >( "Cost", false, false ); this->_ConfigureInput< _TData >( "CostConversion", false, false ); diff --git a/plugins/Plugins/ImageRegionGrow.cxx b/plugins/Plugins/ImageRegionGrow.cxx index df1713c..5056212 100644 --- a/plugins/Plugins/ImageRegionGrow.cxx +++ b/plugins/Plugins/ImageRegionGrow.cxx @@ -1,6 +1,6 @@ #include -#include -#include +#include +#include #include #include @@ -11,7 +11,7 @@ ImageRegionGrow( ) : Superclass( ) { typedef cpPlugins::BaseObjects::DataObject _TData; - typedef cpPlugins::DataObjects::Image _TMST; + typedef cpInstances::Image _TMST; this->_ConfigureInput< _TData >( "GrowFunction", true, false ); @@ -64,6 +64,8 @@ template< class _TInputImage, class _TOutputPixel > void fpaPlugins::ImageRegionGrow:: _GD1( _TInputImage* image ) { + std::cout << "--------------> again <-----------------" << std::endl; + typedef itk::Image< _TOutputPixel, _TInputImage::ImageDimension > _TOutputImage; diff --git a/plugins/Plugins/InvertCost.cxx b/plugins/Plugins/InvertCost.cxx index d50676a..4abfe33 100644 --- a/plugins/Plugins/InvertCost.cxx +++ b/plugins/Plugins/InvertCost.cxx @@ -1,5 +1,5 @@ #include -#include +#include #include diff --git a/plugins/Plugins/RegionGrowBinaryThreshold.cxx b/plugins/Plugins/RegionGrowBinaryThreshold.cxx index 8f7c620..20d5e78 100644 --- a/plugins/Plugins/RegionGrowBinaryThreshold.cxx +++ b/plugins/Plugins/RegionGrowBinaryThreshold.cxx @@ -1,6 +1,6 @@ #include -#include -#include +#include +#include #include #include @@ -11,7 +11,7 @@ RegionGrowBinaryThreshold( ) : Superclass( ) { typedef cpPlugins::BaseObjects::DataObject _TData; - typedef cpPlugins::DataObjects::Image _TImage; + typedef cpInstances::Image _TImage; this->_ConfigureInput< _TImage >( "Input", true, false ); this->_ConfigureOutput< _TData >( "Output" ); diff --git a/plugins/Plugins/RegionGrowBinaryThresholdWithSeeds.cxx b/plugins/Plugins/RegionGrowBinaryThresholdWithSeeds.cxx index 5dceb2c..e799ae2 100644 --- a/plugins/Plugins/RegionGrowBinaryThresholdWithSeeds.cxx +++ b/plugins/Plugins/RegionGrowBinaryThresholdWithSeeds.cxx @@ -1,6 +1,6 @@ #include -#include -#include +#include +#include #include #include @@ -12,7 +12,7 @@ RegionGrowBinaryThresholdWithSeeds( ) : Superclass( ) { typedef cpPlugins::BaseObjects::DataObject _TData; - typedef cpPlugins::DataObjects::Image _TImage; + typedef cpInstances::Image _TImage; this->_ConfigureInput< _TImage >( "Input", true, false ); this->_ConfigureInput< _TData >( "Seeds", true, false ); diff --git a/plugins/Plugins/SimpleImageDijkstraCost.cxx b/plugins/Plugins/SimpleImageDijkstraCost.cxx index 4662b62..dbd3f7e 100644 --- a/plugins/Plugins/SimpleImageDijkstraCost.cxx +++ b/plugins/Plugins/SimpleImageDijkstraCost.cxx @@ -1,6 +1,6 @@ #include -#include -#include +#include +#include #include #include @@ -11,7 +11,7 @@ SimpleImageDijkstraCost( ) : Superclass( ) { typedef cpPlugins::BaseObjects::DataObject _TData; - typedef cpPlugins::DataObjects::Image _TImage; + typedef cpInstances::Image _TImage; this->_ConfigureInput< _TImage >( "Input", true, false ); this->_ConfigureOutput< _TData >( "Output" ); diff --git a/plugins/Plugins/SimpleImageNeighborhood.cxx b/plugins/Plugins/SimpleImageNeighborhood.cxx index 37382a8..3d3e943 100644 --- a/plugins/Plugins/SimpleImageNeighborhood.cxx +++ b/plugins/Plugins/SimpleImageNeighborhood.cxx @@ -1,6 +1,6 @@ #include -#include -#include +#include +#include #include #include @@ -11,7 +11,7 @@ SimpleImageNeighborhood( ) : Superclass( ) { typedef cpPlugins::BaseObjects::DataObject _TData; - typedef cpPlugins::DataObjects::Image _TImage; + typedef cpInstances::Image _TImage; this->_ConfigureInput< _TImage >( "Input", true, false ); this->_ConfigureOutput< _TData >( "Output" ); diff --git a/plugins/Plugins/SkeletonFilter.cxx b/plugins/Plugins/SkeletonFilter.cxx index 31f0f5c..6e9102a 100644 --- a/plugins/Plugins/SkeletonFilter.cxx +++ b/plugins/Plugins/SkeletonFilter.cxx @@ -1,7 +1,7 @@ #include -#include -#include -#include +#include +#include +#include #include #include @@ -12,8 +12,8 @@ fpaPlugins::SkeletonFilter:: SkeletonFilter( ) : Superclass( ) { - typedef cpPlugins::DataObjects::Image _TImage; - typedef cpPlugins::DataObjects::Skeleton _TSkeleton; + typedef cpInstances::Image _TImage; + typedef cpInstances::Skeleton _TSkeleton; typedef cpPlugins::BaseObjects::DataObject _TData; this->_ConfigureInput< _TImage >( "Input", true, false ); -- 2.47.1