Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Olena
pylene
Commits
f9da352b
Commit
f9da352b
authored
Jun 17, 2021
by
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
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
doc/source/morpho/watershed_hierarchy.rst
View file @
f9da352b
...
...
@@ -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);
...
...
doc/source/snippets/watershed_hierarchy_example.cpp
View file @
f9da352b
...
...
@@ -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
);
...
...
tests/morpho/watershed_hierarchy.cpp
View file @
f9da352b
...
...
@@ -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
);
});
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment