Skip to content

Commit

Permalink
#37 apply_renamings also needed total_shape
Browse files Browse the repository at this point in the history
  • Loading branch information
carljohnsen committed Mar 20, 2024
1 parent c4173c2 commit b3fd971
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/lib/cpp/cpu/connected_components.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<int64_t> &n_labels, const idx3d &global_shape, const std::vector<std::vector<int64_t>> &renames, const bool verbose) {
int64_t apply_renamings(const std::string &base_path, std::vector<int64_t> &n_labels, const idx3d &total_shape, const idx3d &global_shape, const std::vector<std::vector<int64_t>> &renames, const bool verbose) {
auto cc_app_start = std::chrono::high_resolution_clock::now();

// Apply the renaming to a new global file
Expand Down
2 changes: 1 addition & 1 deletion src/lib/cpp/cpu_seq/connected_components.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace cpu_seq {

#pragma GCC diagnostic ignored "-Wunused-parameter"
int64_t apply_renamings(const std::string &base_path, std::vector<int64_t> &n_labels, const idx3d &global_shape, const std::vector<std::vector<int64_t>> &renames, const bool verbose) {
int64_t apply_renamings(const std::string &base_path, std::vector<int64_t> &n_labels, const idx3d &total_shape, const idx3d &global_shape, const std::vector<std::vector<int64_t>> &renames, const bool verbose) {
throw std::runtime_error("Not implemented");
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/cpp/gpu/connected_components.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace gpu {

#pragma GCC diagnostic ignored "-Wunused-parameter"
int64_t apply_renamings(const std::string &base_path, std::vector<int64_t> &n_labels, const idx3d &global_shape, const std::vector<std::vector<int64_t>> &renames, const bool verbose) {
int64_t apply_renamings(const std::string &base_path, std::vector<int64_t> &n_labels, const idx3d &total_shape, const idx3d &global_shape, const std::vector<std::vector<int64_t>> &renames, const bool verbose) {
throw std::runtime_error("Not implemented");
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/cpp/include/connected_components.hh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace NS {

// External Functions
int64_t apply_renamings(const std::string &base_path, std::vector<int64_t> &n_labels, const idx3d &global_shape, const std::vector<std::vector<int64_t>> &renames, const bool verbose);
int64_t apply_renamings(const std::string &base_path, std::vector<int64_t> &n_labels, const idx3d &total_shape, const idx3d &global_shape, const std::vector<std::vector<int64_t>> &renames, const bool verbose);
std::vector<std::vector<int64_t>> connected_components(const std::string &base_path, std::vector<int64_t> &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<std::vector<int64_t>> &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<std::vector<int64_t>> &renames, const int64_t n_labels, const idx3d &total_shape, const idx3d &global_shape, const bool verbose = false);
Expand Down
2 changes: 1 addition & 1 deletion src/pybind/connected_components-pybind.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool> &result, const std::string &base_path, np_array<int64_t> &py_n_labels, const std::tuple<int64_t, int64_t, int64_t> &py_total_shape, const std::tuple<int64_t, int64_t, int64_t> &py_global_shape, const bool verbose = false) {
Expand Down

0 comments on commit b3fd971

Please sign in to comment.