From 8cf92baeeefc45bc80a2d0eb2850e04b6089111f Mon Sep 17 00:00:00 2001 From: Leonardo Florez-Valencia Date: Tue, 14 Apr 2015 18:54:18 -0500 Subject: [PATCH] Gaussian model estimator debugged --- CMakeLists.txt | 19 ++-- appli/examples/CMakeLists.txt | 91 ++++--------------- lib/CMakeLists.txt | 26 ++---- .../GaussianModelEstimatorFunction.hxx | 2 +- 4 files changed, 35 insertions(+), 103 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 15cf2d9..e652e5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,6 @@ SET(FrontAlgorithms_VERSION "${FrontAlgorithms_MAJOR_VERSION}.${FrontAlgorithms_ OPTION(BUILD_EXAMPLES "Build examples" OFF) OPTION(BUILD_SHARED_LIBS "Build shared libs" OFF) -OPTION(USE_VTK "Build using VTK" ON) IF(BUILD_SHARED_LIBS) SET(LIB_TYPE SHARED) @@ -46,19 +45,19 @@ ENDIF(BUILD_SHARED_LIBS) INCLUDE(GenerateExportHeader) +FIND_PACKAGE(VTK REQUIRED) FIND_PACKAGE(ITK REQUIRED) INCLUDE(${ITK_USE_FILE}) -IF(USE_VTK) - FIND_PACKAGE(VTK REQUIRED) - INCLUDE(${VTK_USE_FILE}) +## Check for required modules +IF(NOT ITKVtkGlue_LOADED) + MESSAGE(FATAL_ERROR "ITKVtkGlue module is required but not available.") +ENDIF(NOT ITKVtkGlue_LOADED) - OPTION(USE_cpPlugins "Build cpPlugins based stuff" OFF) - IF(USE_cpPlugins) - FIND_PACKAGE(cpPlugins REQUIRED) - ENDIF(USE_cpPlugins) - -ENDIF(USE_VTK) +OPTION(USE_cpPlugins "Build cpPlugins based stuff" OFF) +IF(USE_cpPlugins) + FIND_PACKAGE(cpPlugins REQUIRED) +ENDIF(USE_cpPlugins) ## ================================================ ## = Do not allow to build inside the source tree = diff --git a/appli/examples/CMakeLists.txt b/appli/examples/CMakeLists.txt index 3e000b8..cf7ebf4 100644 --- a/appli/examples/CMakeLists.txt +++ b/appli/examples/CMakeLists.txt @@ -7,80 +7,23 @@ FOREACH(EX ${SIMPLE_EXAMPLES}) TARGET_LINK_LIBRARIES(${EX} FrontAlgorithms) ENDFOREACH(EX) -IF(USE_VTK) - SET( - SIMPLE_VTK_EXAMPLES - example_Image_RegionGrow_AllPixels - example_Image_RegionGrow_AllRGBPixels - example_Image_RegionGrow_GaussianModelEstimation - example_Image_Dijkstra_CostFromInput - example_Image_Dijkstra_CostFromRGBInput - example_Image_Dijkstra_DanielssonCost - example_Image_Dijkstra_DanielssonCost_TwoSeedsPath - example_Image_Dijkstra_EndPointDetection - example_ShowSkeleton +SET( + SIMPLE_VTK_EXAMPLES + example_Image_RegionGrow_AllPixels + example_Image_RegionGrow_AllRGBPixels + example_Image_RegionGrow_GaussianModelEstimation + example_Image_Dijkstra_CostFromInput + example_Image_Dijkstra_CostFromRGBInput + example_Image_Dijkstra_DanielssonCost + example_Image_Dijkstra_DanielssonCost_TwoSeedsPath + example_Image_Dijkstra_EndPointDetection + example_ShowSkeleton + ) +FOREACH(EX ${SIMPLE_VTK_EXAMPLES}) + ADD_EXECUTABLE(${EX} ${EX}.cxx) + TARGET_LINK_LIBRARIES( + ${EX} FrontAlgorithms ) - FOREACH(EX ${SIMPLE_VTK_EXAMPLES}) - ADD_EXECUTABLE(${EX} ${EX}.cxx) - TARGET_LINK_LIBRARIES(${EX} FrontAlgorithms) - ENDFOREACH(EX) -ENDIF(USE_VTK) - -#IF(BUILD_EXAMPLES) -# SET( -# APPLIS -# example_Thinning -# example_BinaryDistanceMap -# example_HausdorffDistance -# example_ImageAlgorithmRegionGrow_00 -# example_ImageAlgorithmDijkstra_00 -# example_ImageAlgorithmFastMarching_00 -# ) - -# FOREACH(APP ${APPLIS}) -# ADD_EXECUTABLE(${APP} ${APP}.cxx) -# TARGET_LINK_LIBRARIES(${APP} FrontAlgorithms) -# ENDFOREACH(APP) - -# IF(USE_VTK) -# SET( -# vtk_APPLIS -# example_ImageAlgorithmRegionGrow_01 -# example_ImageAlgorithmRegionGrow_MultipleThresholds -# example_ImageAlgorithmDijkstra_01 -# example_ImageAlgorithmDijkstra_02 -# example_ImageAlgorithmDijkstra_03 -# example_ImageAlgorithmFastMarching_01 -# example_ImageAlgorithm_Skeletonization -# ) - -# FOREACH(APP ${vtk_APPLIS}) -# ADD_EXECUTABLE(${APP} ${APP}.cxx) -# TARGET_LINK_LIBRARIES( -# ${APP} -# FrontAlgorithms -# ${VTK_LIBRARIES} vtkIOLegacy -# ) -# ENDFOREACH(APP) - -# IF(USE_cpPlugins) -# SET( -# cpPlugins_APPLIS -# example_ImageAlgorithmRegionGrow_GaussianModelEstimator -# ) - -# FOREACH(APP ${cpPlugins_APPLIS}) -# ADD_EXECUTABLE(${APP} ${APP}.cxx) -# TARGET_LINK_LIBRARIES( -# ${APP} -# FrontAlgorithms -# ${cpPlugins_Extensions_LIBRARY_NAME} -# ) -# ENDFOREACH(APP) - -# ENDIF(USE_cpPlugins) - -# ENDIF(USE_VTK) -#ENDIF(BUILD_EXAMPLES) +ENDFOREACH(EX) ## eof - $RCSfile$ diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 744f619..1ddfbb5 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -19,10 +19,8 @@ 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") -IF(USE_VTK) - FILE(GLOB ${LIB_NAME}_VTK_HEADERS "fpa/VTK/*.h" "fpa/VTK/*.hxx") - FILE(GLOB ${LIB_NAME}_VTK_SOURCES "fpa/VTK/*.cxx") -ENDIF(USE_VTK) +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 @@ -60,19 +58,11 @@ GENERATE_EXPORT_HEADER( EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/lib/fpa/${LIB_NAME}_Export.h STATIC_DEFINE ${LIB_NAME}_BUILT_AS_STATIC ) -IF(USE_VTK) - TARGET_LINK_LIBRARIES( - ${LIB_NAME} - ${${LIB_NAME}_LINK_LIBRARIES} - ${ITK_LIBRARIES} - vtkInteractionWidgets - ) -ELSE(USE_VTK) - TARGET_LINK_LIBRARIES( - ${LIB_NAME} - ${${LIB_NAME}_LINK_LIBRARIES} - ${ITK_LIBRARIES} - ) -ENDIF(USE_VTK) +TARGET_LINK_LIBRARIES( + ${LIB_NAME} + ${${LIB_NAME}_LINK_LIBRARIES} + ${ITK_LIBRARIES} + vtkInteractionWidgets + ) ## eof - $RCSfile$ diff --git a/lib/fpa/Image/Functors/GaussianModelEstimatorFunction.hxx b/lib/fpa/Image/Functors/GaussianModelEstimatorFunction.hxx index a90a39a..c9adb71 100644 --- a/lib/fpa/Image/Functors/GaussianModelEstimatorFunction.hxx +++ b/lib/fpa/Image/Functors/GaussianModelEstimatorFunction.hxx @@ -20,7 +20,7 @@ Evaluate( const typename I::PixelType& rgb ) const else { S p = this->m_Estimator->Probability( this->m_YPbPrFunction( rgb ) ); - return( p > this->m_Estimator->GetMinimumProbability( ) ); + return( p >= this->m_Estimator->GetMinimumProbability( ) ); } // fi } -- 2.47.1