From b3fd971f5a819f8816198406290371bcbc2f8245 Mon Sep 17 00:00:00 2001 From: Carl Johnsen Date: Wed, 20 Mar 2024 10:18:20 +0100 Subject: [PATCH] #37 apply_renamings also needed total_shape --- src/lib/cpp/cpu/connected_components.cc | 2 +- src/lib/cpp/cpu_seq/connected_components.cc | 2 +- src/lib/cpp/gpu/connected_components.cc | 2 +- src/lib/cpp/include/connected_components.hh | 2 +- src/pybind/connected_components-pybind.cc | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/cpp/cpu/connected_components.cc b/src/lib/cpp/cpu/connected_components.cc index 9355ddb..ac8cc93 100644 --- a/src/lib/cpp/cpu/connected_components.cc +++ b/src/lib/cpp/cpu/connected_components.cc @@ -240,7 +240,7 @@ void apply_renaming(int64_t *__restrict__ img, const int64_t n, const std::vecto } } -int64_t apply_renamings(const std::string &base_path, std::vector &n_labels, const idx3d &global_shape, const std::vector> &renames, const bool verbose) { +int64_t apply_renamings(const std::string &base_path, std::vector &n_labels, const idx3d &total_shape, const idx3d &global_shape, const std::vector> &renames, const bool verbose) { auto cc_app_start = std::chrono::high_resolution_clock::now(); // Apply the renaming to a new global file diff --git a/src/lib/cpp/cpu_seq/connected_components.cc b/src/lib/cpp/cpu_seq/connected_components.cc index 3d73af7..35afe02 100644 --- a/src/lib/cpp/cpu_seq/connected_components.cc +++ b/src/lib/cpp/cpu_seq/connected_components.cc @@ -3,7 +3,7 @@ namespace cpu_seq { #pragma GCC diagnostic ignored "-Wunused-parameter" -int64_t apply_renamings(const std::string &base_path, std::vector &n_labels, const idx3d &global_shape, const std::vector> &renames, const bool verbose) { +int64_t apply_renamings(const std::string &base_path, std::vector &n_labels, const idx3d &total_shape, const idx3d &global_shape, const std::vector> &renames, const bool verbose) { throw std::runtime_error("Not implemented"); } diff --git a/src/lib/cpp/gpu/connected_components.cc b/src/lib/cpp/gpu/connected_components.cc index fb7b9fc..34dd584 100644 --- a/src/lib/cpp/gpu/connected_components.cc +++ b/src/lib/cpp/gpu/connected_components.cc @@ -3,7 +3,7 @@ namespace gpu { #pragma GCC diagnostic ignored "-Wunused-parameter" -int64_t apply_renamings(const std::string &base_path, std::vector &n_labels, const idx3d &global_shape, const std::vector> &renames, const bool verbose) { +int64_t apply_renamings(const std::string &base_path, std::vector &n_labels, const idx3d &total_shape, const idx3d &global_shape, const std::vector> &renames, const bool verbose) { throw std::runtime_error("Not implemented"); } diff --git a/src/lib/cpp/include/connected_components.hh b/src/lib/cpp/include/connected_components.hh index eaa9542..7288308 100644 --- a/src/lib/cpp/include/connected_components.hh +++ b/src/lib/cpp/include/connected_components.hh @@ -6,7 +6,7 @@ namespace NS { // External Functions - int64_t apply_renamings(const std::string &base_path, std::vector &n_labels, const idx3d &global_shape, const std::vector> &renames, const bool verbose); + int64_t apply_renamings(const std::string &base_path, std::vector &n_labels, const idx3d &total_shape, const idx3d &global_shape, const std::vector> &renames, const bool verbose); std::vector> connected_components(const std::string &base_path, std::vector &n_labels, const idx3d &total_shape, const idx3d &global_shape, const bool verbose); void filter_largest(const std::string &base_path, bool *__restrict__ mask, const std::vector> &renames, const int64_t largest, const idx3d &total_shape, const idx3d &global_shape, const bool verbose); int64_t largest_component(const std::string &base_path, const std::vector> &renames, const int64_t n_labels, const idx3d &total_shape, const idx3d &global_shape, const bool verbose = false); diff --git a/src/pybind/connected_components-pybind.cc b/src/pybind/connected_components-pybind.cc index f605a54..ab9d2a7 100644 --- a/src/pybind/connected_components-pybind.cc +++ b/src/pybind/connected_components-pybind.cc @@ -13,7 +13,7 @@ namespace python_api { global_shape = {std::get<0>(py_global_shape), std::get<1>(py_global_shape), std::get<2>(py_global_shape)}; auto renamings = NS::connected_components(base_path, n_labels_vec, total_shape, global_shape, verbose); - return NS::apply_renamings(base_path, n_labels_vec, global_shape, renamings, verbose); + return NS::apply_renamings(base_path, n_labels_vec, total_shape, global_shape, renamings, verbose); } void largest_connected_component(np_array &result, const std::string &base_path, np_array &py_n_labels, const std::tuple &py_total_shape, const std::tuple &py_global_shape, const bool verbose = false) {