* mln/topo/skeleton/breadth_first_thinning.hh: Use a p_queue_fast
site set instead of a pair of p_set's to ensure an actual
breadth-first processing of sites.
---
milena/ChangeLog | 8 +++
milena/mln/topo/skeleton/breadth_first_thinning.hh | 63 ++++++++-----------
2 files changed, 35 insertions(+), 36 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 45c94c8..7554064 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,11 @@
+2010-09-17 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Fix the processing order in topo::breadth_first_thinning.
+
+ * mln/topo/skeleton/breadth_first_thinning.hh: Use a p_queue_fast
+ site set instead of a pair of p_set's to ensure an actual
+ breadth-first processing of sites.
+
2010-09-16 Roland Levillain <roland(a)lrde.epita.fr>
Split interface and implementation of topo::is_not_end_point.
diff --git a/milena/mln/topo/skeleton/breadth_first_thinning.hh b/milena/mln/topo/skeleton/breadth_first_thinning.hh
index 3be9539..348b271 100644
--- a/milena/mln/topo/skeleton/breadth_first_thinning.hh
+++ b/milena/mln/topo/skeleton/breadth_first_thinning.hh
@@ -37,7 +37,7 @@
# include <mln/core/concept/image.hh>
# include <mln/core/concept/neighborhood.hh>
-# include <mln/core/site_set/p_set.hh>
+# include <mln/core/site_set/p_queue_fast.hh>
# include <mln/fun/p2b/tautology.hh>
@@ -116,9 +116,9 @@ namespace mln
is_simple.set_image(output);
typedef mln_psite(I) psite;
- typedef p_set<psite> set_t;
- set_t set;
- // Populate SET with candidate simple points.
+ typedef p_queue_fast<psite> queue_t;
+ queue_t queue;
+ // Populate QUEUE with candidate simple points.
mln_piter(I) p_(output.domain());
for_all(p_)
{
@@ -129,43 +129,34 @@ namespace mln
the compiler and pass an actual, explicit psite. */
psite p = p_;
if (output(p) && constraint(p) && is_simple(p))
- set.insert(p);
+ queue.push(p);
}
- while (!set.is_empty())
+ while (!queue.is_empty())
{
- set_t next_set;
-
- mln_piter(set_t) ps(set);
- for_all(ps)
- {
- // Same remark as above.
- psite p = ps;
-
- /* FIXME: We compute the cell and attachment of P twice:
- during the call to is_simple() and within detach().
- How could we reuse this elegantly, without breaking
- the genericity of the skeleton algorithm?
- Also, keep in mind that functors can maintain an
- internal state and make side effects, meaning that
- e.g. constraint(p) might not be constant for a
- given p during the thinning. */
- if (output(p) && constraint(p) && is_simple(p))
+ psite p = queue.pop_front();
+
+ /* FIXME: We compute the cell and attachment of P twice:
+ during the call to is_simple() and within detach().
+ How could we reuse this elegantly, without breaking
+ the genericity of the skeleton algorithm?
+ Also, keep in mind that functors can maintain an
+ internal state and make side effects, meaning that
+ e.g. constraint(p) might not be constant for a
+ given p during the thinning. */
+ if (output(p) && constraint(p) && is_simple(p))
+ {
+ detach(p, output);
+ mln_niter(N) n_(nbh, p);
+ for_all(n_)
{
- detach(p, output);
- mln_niter(N) n_(nbh, p);
- for_all(n_)
- {
- // Same remark as above regarding P and P_.
- psite n = n_;
- if (output.domain().has(n)
- && output(n) && constraint(n) && is_simple(n))
- next_set.insert(n);
- }
+ // Same remark as above regarding P and P_.
+ psite n = n_;
+ if (output.domain().has(n)
+ && output(n) && constraint(n) && is_simple(n))
+ queue.push(n);
}
- }
- set.clear();
- std::swap(set, next_set);
+ }
}
trace::exiting("topo::skeleton::breadth_first_thinning");
--
1.5.6.5
* mln/topo/skeleton/breadth_first_thinning.hh: Remove a comment.
* mln/topo/skeleton/priority_driven_thinning.hh: Likewise.
Rename p_queue to queue to avoid confusions with mln::p_queue and
improve uniformity w.r.t. topo::breadth_first_thinning.
---
milena/ChangeLog | 9 +++++++
milena/mln/topo/skeleton/breadth_first_thinning.hh | 9 -------
.../mln/topo/skeleton/priority_driven_thinning.hh | 23 ++++++-------------
3 files changed, 16 insertions(+), 25 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 7554064..11924f1 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,14 @@
2010-09-17 Roland Levillain <roland(a)lrde.epita.fr>
+ Aesthetic changes in thinning algorithms.
+
+ * mln/topo/skeleton/breadth_first_thinning.hh: Remove a comment.
+ * mln/topo/skeleton/priority_driven_thinning.hh: Likewise.
+ Rename p_queue to queue to avoid confusions with mln::p_queue and
+ improve uniformity w.r.t. topo::breadth_first_thinning.
+
+2010-09-17 Roland Levillain <roland(a)lrde.epita.fr>
+
Fix the processing order in topo::breadth_first_thinning.
* mln/topo/skeleton/breadth_first_thinning.hh: Use a p_queue_fast
diff --git a/milena/mln/topo/skeleton/breadth_first_thinning.hh b/milena/mln/topo/skeleton/breadth_first_thinning.hh
index 348b271..d2f33b5 100644
--- a/milena/mln/topo/skeleton/breadth_first_thinning.hh
+++ b/milena/mln/topo/skeleton/breadth_first_thinning.hh
@@ -135,15 +135,6 @@ namespace mln
while (!queue.is_empty())
{
psite p = queue.pop_front();
-
- /* FIXME: We compute the cell and attachment of P twice:
- during the call to is_simple() and within detach().
- How could we reuse this elegantly, without breaking
- the genericity of the skeleton algorithm?
- Also, keep in mind that functors can maintain an
- internal state and make side effects, meaning that
- e.g. constraint(p) might not be constant for a
- given p during the thinning. */
if (output(p) && constraint(p) && is_simple(p))
{
detach(p, output);
diff --git a/milena/mln/topo/skeleton/priority_driven_thinning.hh b/milena/mln/topo/skeleton/priority_driven_thinning.hh
index f074b6a..42e1b13 100644
--- a/milena/mln/topo/skeleton/priority_driven_thinning.hh
+++ b/milena/mln/topo/skeleton/priority_driven_thinning.hh
@@ -126,9 +126,9 @@ namespace mln
typedef mln_psite(I) psite;
typedef p_queue_fast<psite> queue_t;
- typedef p_priority<mln_value(J), queue_t> p_queue_t;
- p_queue_t p_queue;
- // Populate P_QUEUE with candidate simple points.
+ typedef p_priority<mln_value(J), queue_t> priority_queue_t;
+ priority_queue_t queue;
+ // Populate QUEUE with candidate simple points.
mln_piter(I) p_(output.domain());
for_all(p_)
{
@@ -139,21 +139,12 @@ namespace mln
the compiler and pass an actual, explicit psite. */
psite p = p_;
if (output(p) && constraint(p) && is_simple(p))
- p_queue.push(priority(p), p);
+ queue.push(priority(p), p);
}
- while (!p_queue.is_empty())
+ while (!queue.is_empty())
{
- psite p = p_queue.pop_front();
-
- /* FIXME: We compute the cell and attachment of P twice:
- during the call to is_simple() and within detach().
- How could we reuse this elegantly, without breaking
- the genericity of the skeleton algorithm?
- Also, keep in mind that functors can maintain an
- internal state and make side effects, meaning that
- e.g. constraint(p) might not be constant for a
- given p during the thinning. */
+ psite p = queue.pop_front();
if (output(p) && constraint(p) && is_simple(p))
{
detach(p, output);
@@ -164,7 +155,7 @@ namespace mln
psite n = n_;
if (output.domain().has(n)
&& output(n) && constraint(n) && is_simple(n))
- p_queue.push(priority(n), n);
+ queue.push(priority(n), n);
}
}
}
--
1.5.6.5
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch vtk-format has been updated
via 6629f93070da7d9eea9fa6a7b99e96154d624565 (commit)
via e402de7a1c8b372d768e93fdb76718e73ab48681 (commit)
via 21a5b46f16b712625498aaa2b01a601cdd614990 (commit)
from 57d5538008bc881e674005421f55b85b43a5125e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
6629f93 Add preliminary VTK input for binary images.
e402de7 Add VTK-format meshes.
21a5b46 Add a pre-allocation routine to mln::geom::complex_geometry.
-----------------------------------------------------------------------
Summary of changes:
milena/ChangeLog | 35 ++
milena/mesh/Makefile.am | 20 +-
milena/mesh/pseudo-manifold.vtk | 188 ++++++++
milena/mesh/tetrahedron.vtk | 48 ++
milena/mln/geom/complex_geometry.hh | 17 +-
milena/mln/io/off/load.hh | 30 +-
milena/mln/io/vtk/all.hh | 3 +-
milena/mln/io/vtk/load.hh | 615 +++++++++++++++++++++++++
milena/tests/io/vtk/Makefile.am | 7 +-
milena/tests/io/{off => vtk}/load_bin.cc | 12 +-
milena/tests/io/{off => vtk}/load_save_bin.cc | 15 +-
11 files changed, 956 insertions(+), 34 deletions(-)
create mode 100644 milena/mesh/pseudo-manifold.vtk
create mode 100644 milena/mesh/tetrahedron.vtk
create mode 100644 milena/mln/io/vtk/load.hh
copy milena/tests/io/{off => vtk}/load_bin.cc (87%)
copy milena/tests/io/{off => vtk}/load_save_bin.cc (80%)
hooks/post-receive
--
Olena, a generic and efficient image processing platform
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch igr has been deleted
was dab5d674ff5a32dbbba0dbe53543864f89d405cc
-----------------------------------------------------------------------
dab5d674ff5a32dbbba0dbe53543864f89d405cc mln/io/dicom/load.hh: Fix invalid image loading.
-----------------------------------------------------------------------
hooks/post-receive
--
Olena, a generic and efficient image processing platform