From c9e5d1539deb12ec76e723444c785e70fce2038a Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Fri, 25 Oct 2024 00:21:37 +0200 Subject: [PATCH 1/6] add continue if max value reached --- CMakeLists.txt | 8 +++++++- src/PartSegCore_compiled_backend/multiscale_opening/mso.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 494af53..9415cc8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,7 +65,13 @@ target_include_directories(calc_bounds PRIVATE "${NUMPY_INCLUDE_DIR}") cython_transpile(src/PartSegCore_compiled_backend/multiscale_opening/mso_bind.pyx LANGUAGE CXX OUTPUT_VARIABLE mso_bind_cython_cxx) -python_add_library(mso_bind MODULE "${mso_bind_cython_cxx}" WITH_SOABI) +python_add_library( + mso_bind MODULE + "${mso_bind_cython_cxx}" + src/PartSegCore_compiled_backend/multiscale_opening/mso.cpp + src/PartSegCore_compiled_backend/multiscale_opening/mso.h + src/PartSegCore_compiled_backend/multiscale_opening/my_queue.h + WITH_SOABI) target_include_directories(mso_bind PRIVATE src/PartSegCore_compiled_backend/multiscale_opening/) target_include_directories(mso_bind PRIVATE "${NUMPY_INCLUDE_DIR}") diff --git a/src/PartSegCore_compiled_backend/multiscale_opening/mso.h b/src/PartSegCore_compiled_backend/multiscale_opening/mso.h index adb4179..1430a87 100644 --- a/src/PartSegCore_compiled_backend/multiscale_opening/mso.h +++ b/src/PartSegCore_compiled_backend/multiscale_opening/mso.h @@ -496,6 +496,7 @@ class MSO { components_arr[neigh_position] = components_arr[position]; } else { components_arr[neigh_position] = std::numeric_limits::max(); + continue; } if (!coord_in_queue[neigh_position]) { coord_in_queue[neigh_position] = true; From 5b96ae7783b2c0437dcc4dc11ddf90f063ba849c Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Fri, 25 Oct 2024 00:29:35 +0200 Subject: [PATCH 2/6] workaround cmake problem --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9415cc8..9e4d770 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,7 +68,7 @@ cython_transpile(src/PartSegCore_compiled_backend/multiscale_opening/mso_bind.py python_add_library( mso_bind MODULE "${mso_bind_cython_cxx}" - src/PartSegCore_compiled_backend/multiscale_opening/mso.cpp + # src/PartSegCore_compiled_backend/multiscale_opening/mso.cpp src/PartSegCore_compiled_backend/multiscale_opening/mso.h src/PartSegCore_compiled_backend/multiscale_opening/my_queue.h WITH_SOABI) From ecd9d1e8fc351fe9aa79679f140e2031d30717e3 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Fri, 25 Oct 2024 00:47:16 +0200 Subject: [PATCH 3/6] fix fuzzy_distance --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e4d770..f13fac0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,9 +49,9 @@ target_include_directories(sprawl_utils_cython PRIVATE src/PartSegCore_compiled_ cython_transpile(src/PartSegCore_compiled_backend/sprawl_utils/fuzzy_distance.pyx LANGUAGE CXX OUTPUT_VARIABLE fuzzy_distance_cython_cxx) -python_add_library(fuzzy_distance_cython MODULE "${fuzzy_distance_cython_cxx}" WITH_SOABI) -target_include_directories(fuzzy_distance_cython PRIVATE "${NUMPY_INCLUDE_DIR}") -target_include_directories(fuzzy_distance_cython PRIVATE src/PartSegCore_compiled_backend/sprawl_utils/) +python_add_library(fuzzy_distance MODULE "${fuzzy_distance_cython_cxx}" WITH_SOABI) +target_include_directories(fuzzy_distance PRIVATE "${NUMPY_INCLUDE_DIR}") +target_include_directories(fuzzy_distance PRIVATE src/PartSegCore_compiled_backend/sprawl_utils/) cython_transpile(src/PartSegCore_compiled_backend/color_image_cython.pyx LANGUAGE CXX OUTPUT_VARIABLE color_image_cython_cxx) @@ -91,7 +91,7 @@ target_link_libraries(_napari_mapping PRIVATE OpenMP::OpenMP_CXX) install(TARGETS euclidean_cython DESTINATION PartSegCore_compiled_backend/sprawl_utils) install(TARGETS path_sprawl_cython DESTINATION PartSegCore_compiled_backend/sprawl_utils) install(TARGETS sprawl_utils_cython DESTINATION PartSegCore_compiled_backend/sprawl_utils) -install(TARGETS fuzzy_distance_cython DESTINATION PartSegCore_compiled_backend/sprawl_utils) +install(TARGETS fuzzy_distance DESTINATION PartSegCore_compiled_backend/sprawl_utils) install(TARGETS color_image_cython DESTINATION PartSegCore_compiled_backend) install(TARGETS calc_bounds DESTINATION PartSegCore_compiled_backend) install(TARGETS mso_bind DESTINATION PartSegCore_compiled_backend/multiscale_opening) From ebc4a9e8425454b860fb5e665229ca5cd1dbc1bb Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Fri, 25 Oct 2024 08:53:42 +0200 Subject: [PATCH 4/6] change sprawl_utils_cython to sprawl_utils --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f13fac0..7149687 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,9 +43,9 @@ target_include_directories(path_sprawl_cython PRIVATE "${NUMPY_INCLUDE_DIR}") target_include_directories(path_sprawl_cython PRIVATE src/PartSegCore_compiled_backend/sprawl_utils/) cython_transpile(src/PartSegCore_compiled_backend/sprawl_utils/sprawl_utils.pyx LANGUAGE CXX OUTPUT_VARIABLE sprawl_utils_cython_cxx) -python_add_library(sprawl_utils_cython MODULE "${sprawl_utils_cython_cxx}" WITH_SOABI) -target_include_directories(sprawl_utils_cython PRIVATE "${NUMPY_INCLUDE_DIR}") -target_include_directories(sprawl_utils_cython PRIVATE src/PartSegCore_compiled_backend/sprawl_utils/) +python_add_library(sprawl_utils MODULE "${sprawl_utils_cython_cxx}" WITH_SOABI) +target_include_directories(sprawl_utils PRIVATE "${NUMPY_INCLUDE_DIR}") +target_include_directories(sprawl_utils PRIVATE src/PartSegCore_compiled_backend/sprawl_utils/) cython_transpile(src/PartSegCore_compiled_backend/sprawl_utils/fuzzy_distance.pyx LANGUAGE CXX OUTPUT_VARIABLE fuzzy_distance_cython_cxx) From 8f18e16e650c33501ccbb35faa03e6f86b2e8ca9 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Fri, 25 Oct 2024 09:08:03 +0200 Subject: [PATCH 5/6] change sprawl_utils_cython to sprawl_utils part 2 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7149687..c22d80c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,7 +90,7 @@ target_link_libraries(_napari_mapping PRIVATE OpenMP::OpenMP_CXX) install(TARGETS euclidean_cython DESTINATION PartSegCore_compiled_backend/sprawl_utils) install(TARGETS path_sprawl_cython DESTINATION PartSegCore_compiled_backend/sprawl_utils) -install(TARGETS sprawl_utils_cython DESTINATION PartSegCore_compiled_backend/sprawl_utils) +install(TARGETS sprawl_utils DESTINATION PartSegCore_compiled_backend/sprawl_utils) install(TARGETS fuzzy_distance DESTINATION PartSegCore_compiled_backend/sprawl_utils) install(TARGETS color_image_cython DESTINATION PartSegCore_compiled_backend) install(TARGETS calc_bounds DESTINATION PartSegCore_compiled_backend) From 5ab0659fde48877197fae67ec01a86deb76c6667 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Mon, 13 Oct 2025 12:08:09 +0200 Subject: [PATCH 6/6] trigger ci