Commit f9da352b authored by Quentin Kaci's avatar Quentin Kaci
Browse files

Replace unsigned long with size_t to prevent loss of data

parent 802747af
Pipeline #28626 passed with stage
in 26 minutes
......@@ -75,7 +75,7 @@ This example is used to generate the grayscale lena watershed hierarchy by area
mln::image2d<uint8_t> input = ...;
// Compute the watershed hierarchy by area
auto area_attribute_func = [](auto tree, auto node_map) -> std::vector<unsigned long> {
auto area_attribute_func = [](auto tree, auto node_map) -> std::vector<size_t> {
return tree.compute_attribute_on_points(node_map, mln::accu::features::count<>());
};
auto [tree, node_map] = mln::morpho::watershed_hierarchy(input, area_attribute_func, mln::c4);
......
......@@ -13,7 +13,7 @@ template <typename V>
void process_example(const mln::image2d<V>& img, const std::string& output_filename, const double threshold)
{
// 2. Build the watershed hierarchy
auto area_attribute_func = [](auto tree, auto nm) -> std::vector<unsigned long> {
auto area_attribute_func = [](auto tree, auto nm) -> std::vector<size_t> {
return tree.compute_attribute_on_points(nm, mln::accu::features::count<>());
};
auto [t, nm] = mln::morpho::watershed_hierarchy(img, area_attribute_func, mln::c4);
......
......@@ -95,7 +95,7 @@ TEST(Morpho, AreaWatershedHierarchyGray)
auto [tree, _] = mln::morpho::watershed_hierarchy(
input,
[](auto tree, auto nm) -> std::vector<unsigned long> {
[](auto tree, auto nm) -> std::vector<size_t> {
return tree.compute_attribute_on_points(nm, mln::accu::features::count<>());
},
mln::c4, [](const auto& a, const auto& b) -> float { return mln::functional::l2dist_t<>()(a, b); });
......@@ -129,7 +129,7 @@ TEST(Morpho, AreaWatershedHierarchyGrayHQ)
auto [tree, _] = mln::morpho::watershed_hierarchy(
input,
[](auto tree, auto nm) -> std::vector<unsigned long> {
[](auto tree, auto nm) -> std::vector<size_t> {
return tree.compute_attribute_on_points(nm, mln::accu::features::count<>());
},
mln::c4, [](const auto& a, const auto& b) -> std::uint8_t { return mln::functional::l2dist_t<>()(a, b); });
......@@ -163,7 +163,7 @@ TEST(Morpho, AreaWatershedHierarchyRGB)
auto [tree, _] = mln::morpho::watershed_hierarchy(
input,
[](auto tree, auto nm) -> std::vector<unsigned long> {
[](auto tree, auto nm) -> std::vector<size_t> {
return tree.compute_attribute_on_points(nm, mln::accu::features::count<>());
},
mln::c4, [](const auto& a, const auto& b) -> float { return mln::functional::l2dist_t<>()(a, b); });
......@@ -197,7 +197,7 @@ TEST(Morpho, AreaWatershedHierarchyGrayC8)
auto [tree, _] = mln::morpho::watershed_hierarchy(
input,
[](auto tree, auto nm) -> std::vector<unsigned long> {
[](auto tree, auto nm) -> std::vector<size_t> {
return tree.compute_attribute_on_points(nm, mln::accu::features::count<>());
},
mln::c8, [](const auto& a, const auto& b) -> float { return mln::functional::l2dist_t<>()(a, b); });
......@@ -229,7 +229,7 @@ TEST(Morpho, AreaWatershedHierarchy3DImage)
auto [tree, _] = mln::morpho::watershed_hierarchy(
input,
[](auto tree, auto nm) -> std::vector<unsigned long> {
[](auto tree, auto nm) -> std::vector<size_t> {
return tree.compute_attribute_on_points(nm, mln::accu::features::count<>());
},
mln::c26, [](const auto& a, const auto& b) -> float { return mln::functional::l2dist_t<>()(a, b); });
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment