]> Creatis software - FrontAlgorithms.git/commitdiff
Gaussian model estimator debugged
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Tue, 14 Apr 2015 23:54:18 +0000 (18:54 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Tue, 14 Apr 2015 23:54:18 +0000 (18:54 -0500)
CMakeLists.txt
appli/examples/CMakeLists.txt
lib/CMakeLists.txt
lib/fpa/Image/Functors/GaussianModelEstimatorFunction.hxx

index 15cf2d947cf44c9636594be9bd85cc2b310dc8dc..e652e5bd96773dc08b03a8a94fa87ae8216f466a 100644 (file)
@@ -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 =
index 3e000b89de5836599318ee1557fa7fb3544db10d..cf7ebf4198178df58fd6729452bdff15fcf15dea 100644 (file)
@@ -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$
index 744f619422d54d9122779d347f9d1b2735e686e8..1ddfbb5374b354823894293fc96a1c03b65f48bb 100644 (file)
@@ -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$
index a90a39a4b99bc067353367f8d9b23f7b20e0ab71..c9adb715e337ee25a284a5764e3d3a149e822dc4 100644 (file)
@@ -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
 }