https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Few updates.
* milena/tests/draw/line.cc: Fix missing update.
* milena/mln/draw/line.hh: Make it safe.
* milena/mln/morpho/closing_volume.hh (closing_volume): New
overload with output as return.
* milena/mln/morpho/all.hh: Better doc.
(include): Update.
* milena/sandbox/geraud/wst_edge.cc: Prefer volume closing over
area closing.
mln/draw/line.hh | 12 +++++++-----
mln/morpho/all.hh | 20 +++++++-------------
mln/morpho/closing_volume.hh | 12 ++++++++++++
sandbox/geraud/wst_edge.cc | 4 ++--
tests/draw/line.cc | 2 +-
5 files changed, 29 insertions(+), 21 deletions(-)
Index: milena/tests/draw/line.cc
--- milena/tests/draw/line.cc (revision 2717)
+++ milena/tests/draw/line.cc (working copy)
@@ -47,7 +47,7 @@
using namespace mln;
point2d b = point2d(0,0), e = point2d(6,9);
- line2d l(b, e);
+ p_line2d l(b, e);
mln_assertion(l.nsites() == 10);
image2d<bool> ima(10,10);
Index: milena/mln/draw/line.hh
--- milena/mln/draw/line.hh (revision 2717)
+++ milena/mln/draw/line.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -35,6 +35,7 @@
# include <mln/core/concept/image.hh>
# include <mln/core/site_set/p_line2d.hh>
+# include <mln/core/image/safe.hh>
# include <mln/level/paste.hh>
# include <mln/pw/image.hh>
# include <mln/pw/cst.hh>
@@ -69,14 +70,15 @@
template <typename I>
inline
- void line(Image<I>& ima,
+ void line(Image<I>& ima_,
const mln_psite(I)& beg, const mln_psite(I)& end,
const mln_value(I)& v)
{
- mln_precondition(exact(ima).has_data());
- mln_precondition(exact(ima).has(beg) && exact(ima).has(end));
+ I& ima = exact(ima_);
+ mln_precondition(ima.has_data());
+ // if (! ima.has(beg) || ! ima.has(end)) trace::warning("out");
level::paste(pw::cst(v) | p_line2d(beg, end),
- ima);
+ safe(ima).rw());
}
# endif // ! MLN_INCLUDE_ONLY
Index: milena/mln/morpho/closing_volume.hh
--- milena/mln/morpho/closing_volume.hh (revision 2717)
+++ milena/mln/morpho/closing_volume.hh (working copy)
@@ -30,6 +30,8 @@
/// \file mln/morpho/closing_volume.hh
/// \brief Morphological volume closing.
+///
+/// \todo Clean!
# include <mln/morpho/closing_attribute.hh>
# include <mln/accu/volume.hh>
@@ -46,6 +48,16 @@
void closing_volume(const Image<I>& input, const Neighborhood<N>&
nbh,
std::size_t lambda, Image<O>& output);
+ template <typename I, typename N>
+ mln_concrete(I)
+ closing_volume(const Image<I>& input, const Neighborhood<N>& nbh,
std::size_t lambda)
+ {
+ mln_concrete(I) output;
+ initialize(output, input);
+ closing_volume(input, nbh, lambda, output);
+ return output;
+ }
+
# ifndef MLN_INCLUDE_ONLY
Index: milena/mln/morpho/all.hh
--- milena/mln/morpho/all.hh (revision 2717)
+++ milena/mln/morpho/all.hh (working copy)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -41,26 +41,18 @@
namespace morpho
{
- /*!
- * Namespace of morphological image processing routines
- * implementation details.
- *
- */
+ /// Namespace of morphological image processing routines
+ /// implementations.
namespace impl
{
- /*!
- * Namespace of morphological image processing routines
- * implementation generic implementations.
- *
- */
+ /// Namespace of morphological image processing routines
+ /// generic implementations.
namespace generic
{}
}
-
}
-
}
@@ -88,6 +80,8 @@
# include <mln/morpho/thinning.hh>
# include <mln/morpho/top_hat.hh>
+# include <mln/morpho/elementary/all.hh>
+
#endif // ! MLN_MORPHO_ALL_HH
Index: milena/sandbox/geraud/wst_edge.cc
--- milena/sandbox/geraud/wst_edge.cc (revision 2717)
+++ milena/sandbox/geraud/wst_edge.cc (working copy)
@@ -33,7 +33,7 @@
# include <mln/extension/fill.hh>
# include <mln/morpho/meyer_wst.hh>
-# include <mln/morpho/closing_area.hh>
+# include <mln/morpho/closing_volume.hh>
# include <mln/debug/println.hh>
@@ -315,7 +315,7 @@
}
- level::paste( morpho::closing_area(edge, e2e, lambda), edge );
+ level::paste( morpho::closing_volume(edge, e2e, lambda), edge );
image2d<unsigned> label(ima.bbox(), 0);