diff --git a/src/auxiliary.hpp b/src/auxiliary.hpp index f720dc1..7b7f9f4 100644 --- a/src/auxiliary.hpp +++ b/src/auxiliary.hpp @@ -190,8 +190,9 @@ std::tuple cross_section_slow( * connected component, so pre-filtering must be performed to * ensure a match. */ +template std::tuple cross_sectional_area_slow( - const uint8_t* binimg, + const LABEL* labels, const LABEL segid, const uint64_t sx, const uint64_t sy, const uint64_t sz, const float px, const float py, const float pz, @@ -239,7 +240,7 @@ std::tuple cross_sectional_area_slow( for (uint64_t x = 0; x < sx; x++) { uint64_t loc = x + sx * (y + sy * z); - if (!binimg[loc]) { + if (labels[loc] != segid) { continue; } diff --git a/src/fastxs3d.cpp b/src/fastxs3d.cpp index 486e589..a29b19c 100644 --- a/src/fastxs3d.cpp +++ b/src/fastxs3d.cpp @@ -79,21 +79,23 @@ auto section( return std::make_tuple(arr, std::get<1>(tup)); } +template auto calculate_area( - const py::array_t &binimg, + const py::array_t