* mln/accu/count_adjacent_vertices.hh: make it work with the
new graph images.
* mln/accu/median_alt.hh: fix compilation issue.
* mln/util/multi_site.hh,
* mln/util/vertex.hh,
* mln/util/internal/graph_nbh_iter.hh,
* mln/core/internal/pixel_impl.hh,
* mln/core/internal/set_of.hh,
* mln/core/site_set/box_piter.hh,
* mln/core/site_set/p_centered.hh,
* mln/fun/p2b/has.hh,
* mln/fun/x2p/closest_point.hh,
* mln/geom/seeds2tiling_roundness.hh,
* mln/io/txt/save.hh,
* mln/metal/vec.hh,
* mln/morpho/internal/elementary.hh,
* mln/morpho/tree/data.hh,
* mln/registration/get_rot.hh,
* mln/registration/get_rtransf.hh,
* mln/registration/multiscale.hh,
* mln/topo/face.hh,
* mln/topo/face_iter.hh,
* mln/topo/n_face.hh,
* mln/trait/op/ord.hh,
* mln/util/edge.hh,
* mln/core/dpoints_pixter.hh,
* mln/core/internal/check/image_all.hh,
* mln/core/internal/check/image_fastest.hh,
* mln/core/internal/graph_neighborhood_base.hh,
* mln/core/internal/graph_window_base.hh,
* mln/core/concept/graph.hh,
* mln/canvas/browsing/snake_generic.hh,
* mln/accu/rank_high_quant.hh: fix includes.
* mln/border/resize.hh: avoid a warning.
* mln/core/internal/image_if_base.hh: removed since it is unused and
not updated.
* mln/util/internal/graph_edge_impl.hh: rename as...
* mln/util/internal/edge_impl.hh: ... this.
* mln/util/internal/graph_vertex_impl.hh: rename as...
* mln/util/internal/vertex_impl.hh: ... this.
* tests/morpho/Makefile.am: disable more tests.
* tests/unit_test/build_unit_test.sh: do not include mln/core/doc
headers.
---
milena/ChangeLog | 57 ++++++
milena/mln/accu/count_adjacent_vertices.hh | 56 +++---
milena/mln/accu/median_alt.hh | 12 +-
milena/mln/accu/rank_high_quant.hh | 2 +-
milena/mln/border/resize.hh | 2 +
milena/mln/canvas/browsing/snake_generic.hh | 1 +
milena/mln/core/concept/graph.hh | 2 +
milena/mln/core/dpoints_pixter.hh | 1 +
milena/mln/core/internal/check/image_all.hh | 10 +-
milena/mln/core/internal/check/image_fastest.hh | 45 +++--
.../mln/core/internal/graph_neighborhood_base.hh | 3 +
milena/mln/core/internal/graph_window_base.hh | 1 +
milena/mln/core/internal/image_if_base.hh | 202 --------------------
milena/mln/core/internal/pixel_impl.hh | 24 +--
milena/mln/core/internal/set_of.hh | 10 +-
milena/mln/core/site_set/box_piter.hh | 49 +++---
milena/mln/core/site_set/p_centered.hh | 1 +
milena/mln/fun/p2b/has.hh | 10 +-
milena/mln/fun/x2p/closest_point.hh | 3 +-
milena/mln/geom/seeds2tiling_roundness.hh | 10 +-
milena/mln/io/txt/save.hh | 25 +--
milena/mln/metal/vec.hh | 12 +-
milena/mln/morpho/internal/elementary.hh | 1 +
milena/mln/morpho/tree/data.hh | 2 +-
milena/mln/registration/get_rot.hh | 3 +
milena/mln/registration/get_rtransf.hh | 3 +
milena/mln/registration/multiscale.hh | 4 +
milena/mln/topo/face.hh | 9 +-
milena/mln/topo/face_iter.hh | 1 +
milena/mln/topo/n_face.hh | 10 +-
milena/mln/trait/op/ord.hh | 2 +-
milena/mln/util/edge.hh | 4 +-
.../internal/{graph_edge_impl.hh => edge_impl.hh} | 8 +-
milena/mln/util/internal/graph_nbh_iter.hh | 2 +
.../{graph_vertex_impl.hh => vertex_impl.hh} | 8 +-
milena/mln/util/multi_site.hh | 1 +
milena/mln/util/vertex.hh | 5 +-
milena/tests/morpho/Makefile.am | 8 +-
milena/tests/unit_test/build_unit_test.sh | 2 +-
39 files changed, 247 insertions(+), 364 deletions(-)
delete mode 100644 milena/mln/core/internal/image_if_base.hh
rename milena/mln/util/internal/{graph_edge_impl.hh => edge_impl.hh} (91%)
rename milena/mln/util/internal/{graph_vertex_impl.hh => vertex_impl.hh} (91%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 3b7e923..7416910 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,60 @@
+2008-11-28 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Fix more tests.
+
+ * mln/accu/count_adjacent_vertices.hh: make it work with the
+new graph images.
+
+ * mln/accu/median_alt.hh: fix compilation issue.
+
+ * mln/util/multi_site.hh,
+ * mln/util/vertex.hh,
+ * mln/util/internal/graph_nbh_iter.hh,
+ * mln/core/internal/pixel_impl.hh,
+ * mln/core/internal/set_of.hh,
+ * mln/core/site_set/box_piter.hh,
+ * mln/core/site_set/p_centered.hh,
+ * mln/fun/p2b/has.hh,
+ * mln/fun/x2p/closest_point.hh,
+ * mln/geom/seeds2tiling_roundness.hh,
+ * mln/io/txt/save.hh,
+ * mln/metal/vec.hh,
+ * mln/morpho/internal/elementary.hh,
+ * mln/morpho/tree/data.hh,
+ * mln/registration/get_rot.hh,
+ * mln/registration/get_rtransf.hh,
+ * mln/registration/multiscale.hh,
+ * mln/topo/face.hh,
+ * mln/topo/face_iter.hh,
+ * mln/topo/n_face.hh,
+ * mln/trait/op/ord.hh,
+ * mln/util/edge.hh,
+ * mln/core/dpoints_pixter.hh,
+ * mln/core/internal/check/image_all.hh,
+ * mln/core/internal/check/image_fastest.hh,
+ * mln/core/internal/graph_neighborhood_base.hh,
+ * mln/core/internal/graph_window_base.hh,
+ * mln/core/concept/graph.hh,
+ * mln/canvas/browsing/snake_generic.hh,
+ * mln/accu/rank_high_quant.hh: fix includes.
+
+ * mln/border/resize.hh: avoid a warning.
+
+ * mln/core/internal/image_if_base.hh: removed since it is unused and
+ not updated.
+
+ * mln/util/internal/graph_edge_impl.hh: rename as...
+ * mln/util/internal/edge_impl.hh: ... this.
+
+ * mln/util/internal/graph_vertex_impl.hh: rename as...
+ * mln/util/internal/vertex_impl.hh: ... this.
+
+ * tests/morpho/Makefile.am: disable more tests.
+
+ * tests/unit_test/build_unit_test.sh: do not include mln/core/doc
+ headers.
+
+
2008-11-28 Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Make morpho erosion rely on a general code.
diff --git a/milena/mln/accu/count_adjacent_vertices.hh b/milena/mln/accu/count_adjacent_vertices.hh
index 6d32509..164a150 100644
--- a/milena/mln/accu/count_adjacent_vertices.hh
+++ b/milena/mln/accu/count_adjacent_vertices.hh
@@ -31,11 +31,11 @@
/// \file mln/accu/count_adjacent_vertices.hh
/// Define an accumulator that counts the vertices adjacent to a
-/// set of line graph psite.
+/// set of p_edges psites.
# include <mln/accu/internal/base.hh>
# include <mln/core/concept/meta_accumulator.hh>
-# include <mln/core/image/line_graph_image.hh>
+# include <mln/pw/image.hh>
# include <mln/util/pix.hh>
namespace mln
@@ -45,20 +45,20 @@ namespace mln
{
/// Accumulator class counting the number of vertices
- /// adjacent to a set of mln::line_graph_psite (i.e., a set of
+ /// adjacent to a set of mln::p_edges_psite (i.e., a set of
/// edges).
///
- /// The type to be count is mln::util::pix< mln::line_graph_image<P, V> >
- /// where \p P and \p V are the parameters of this class.
+ /// The type to be count is mln::util::pix< pw::image<F, S> >
+ /// where \p F and \p S are the parameters of this class.
///
/// This accumulator is used by mln::closing_area_on_vertices and
/// mln::opening_area_on_vertices.
- template <typename P, typename V>
+ template <typename F, typename S>
struct count_adjacent_vertices
: public mln::accu::internal::base< unsigned,
- count_adjacent_vertices<P, V> >
+ count_adjacent_vertices<F,S> >
{
- typedef mln::util::pix< mln::line_graph_image<P, V> > argument;
+ typedef mln::util::pix< pw::image<F,S> > argument;
count_adjacent_vertices();
@@ -66,7 +66,7 @@ namespace mln
/// \{
void init();
void take(const argument& arg);
- void take(const count_adjacent_vertices<P, V>& other);
+ void take(const count_adjacent_vertices<F,S>& other);
/// Force the value of the counter to \a c.
void set_value(unsigned c);
@@ -83,7 +83,7 @@ namespace mln
/// The value of the counter.
unsigned count__;
/// The set of adjacent vertices.
- std::set<util::vertex_id> vertices_;
+ std::set<unsigned> vertices_;
};
@@ -94,10 +94,10 @@ namespace mln
struct count_adjacent_vertices
: public Meta_Accumulator< count_adjacent_vertices >
{
- template <typename P, typename V>
+ template <typename F, typename S>
struct with
{
- typedef accu::count_adjacent_vertices<P, V> ret;
+ typedef accu::count_adjacent_vertices<F,S> ret;
};
};
@@ -106,63 +106,63 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
- template <typename P, typename V>
+ template <typename F, typename S>
inline
- count_adjacent_vertices<P, V>::count_adjacent_vertices()
+ count_adjacent_vertices<F,S>::count_adjacent_vertices()
{
init();
}
- template <typename P, typename V>
+ template <typename F, typename S>
inline
void
- count_adjacent_vertices<P, V>::init()
+ count_adjacent_vertices<F,S>::init()
{
vertices_.clear();
update_();
}
- template <typename P, typename V>
+ template <typename F, typename S>
inline
void
- count_adjacent_vertices<P, V>::take(const argument& arg)
+ count_adjacent_vertices<F,S>::take(const argument& arg)
{
- vertices_.insert(arg.p().first_id());
- vertices_.insert(arg.p().second_id());
+ vertices_.insert(arg.p().v1());
+ vertices_.insert(arg.p().v2());
update_();
}
- template <typename P, typename V>
+ template <typename F, typename S>
inline
void
- count_adjacent_vertices<P, V>::take(const count_adjacent_vertices<P, V>& other)
+ count_adjacent_vertices<F,S>::take(const count_adjacent_vertices<F,S>& other)
{
vertices_.insert (other.vertices_.begin(), other.vertices_.end());
update_();
}
- template <typename P, typename V>
+ template <typename F, typename S>
inline
unsigned
- count_adjacent_vertices<P, V>::to_result() const
+ count_adjacent_vertices<F,S>::to_result() const
{
return count__;
}
- template <typename P, typename V>
+ template <typename F, typename S>
inline
void
- count_adjacent_vertices<P, V>::set_value(unsigned c)
+ count_adjacent_vertices<F,S>::set_value(unsigned c)
{
count__ = c;
/// Reset the other member.
vertices_.clear();
}
- template <typename P, typename V>
+ template <typename F, typename S>
inline
void
- count_adjacent_vertices<P, V>::update_()
+ count_adjacent_vertices<F,S>::update_()
{
count__ = vertices_.size();
}
diff --git a/milena/mln/accu/median_alt.hh b/milena/mln/accu/median_alt.hh
index 98d0cac..7815c95 100644
--- a/milena/mln/accu/median_alt.hh
+++ b/milena/mln/accu/median_alt.hh
@@ -99,24 +99,24 @@ namespace mln
/// Meta accumulator for median_alt.
- struct median_alt : public Meta_Accumulator< median_alt >
+ template <typename T>
+ struct median_alt : public Meta_Accumulator< median_alt<T> >
{
- median_alt(const Value_Set<S>& s_) : s(s_) {}
+ median_alt(const Value_Set<T>& s_) : s(s_) {}
- template <typename V>
struct with
{
- typedef accu::median_alt<V> ret;
+ typedef accu::median_alt<T> ret;
};
- Value_Set<S> s;
+ Value_Set<T> s;
};
} // end of namespace mln::accu::meta
template <typename T>
- median_alt<T> unmeta(const meta::median_alt& m, T)
+ median_alt<T> unmeta(const meta::median_alt<T>& m, T)
{
median_alt<T> a(m.s);
return a;
diff --git a/milena/mln/accu/rank_high_quant.hh b/milena/mln/accu/rank_high_quant.hh
index 0f002cd..5c91f99 100644
--- a/milena/mln/accu/rank_high_quant.hh
+++ b/milena/mln/accu/rank_high_quant.hh
@@ -204,6 +204,6 @@ namespace mln
} // end of namespace mln
-#include <mln/accu/rankbool.hh>
+#include <mln/accu/rank_bool.hh>
#endif // ! MLN_ACCU_RANK_HH
diff --git a/milena/mln/border/resize.hh b/milena/mln/border/resize.hh
index b7bdba5..02cbbc5 100644
--- a/milena/mln/border/resize.hh
+++ b/milena/mln/border/resize.hh
@@ -98,6 +98,8 @@ namespace mln
const Image<I>& ima, unsigned thickness)
{
// No-op.
+ (void) ima;
+ (void) thickness;
}
template <typename I>
diff --git a/milena/mln/canvas/browsing/snake_generic.hh b/milena/mln/canvas/browsing/snake_generic.hh
index 540c2e4..0bc951d 100644
--- a/milena/mln/canvas/browsing/snake_generic.hh
+++ b/milena/mln/canvas/browsing/snake_generic.hh
@@ -33,6 +33,7 @@
///
/// Browsing in a snake-way, forward.
+# include <vector>
# include <mln/core/concept/browsing.hh>
diff --git a/milena/mln/core/concept/graph.hh b/milena/mln/core/concept/graph.hh
index 80c2ae2..81f4f3c 100644
--- a/milena/mln/core/concept/graph.hh
+++ b/milena/mln/core/concept/graph.hh
@@ -32,6 +32,8 @@
///
/// Definition of the concept of mln::Graph.
+# include <mln/core/concept/object.hh>
+
namespace mln
{
diff --git a/milena/mln/core/dpoints_pixter.hh b/milena/mln/core/dpoints_pixter.hh
index 4d4e4d2..7b570d2 100644
--- a/milena/mln/core/dpoints_pixter.hh
+++ b/milena/mln/core/dpoints_pixter.hh
@@ -37,6 +37,7 @@
# include <cassert>
# include <vector>
+# include <mln/core/concept/proxy.hh>
# include <mln/core/concept/pixel_iterator.hh>
# include <mln/core/internal/pixel_impl.hh>
# include <mln/metal/converts_to.hh>
diff --git a/milena/mln/core/internal/check/image_all.hh b/milena/mln/core/internal/check/image_all.hh
index e389b06..6430046 100644
--- a/milena/mln/core/internal/check/image_all.hh
+++ b/milena/mln/core/internal/check/image_all.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,12 +29,11 @@
#ifndef MLN_CORE_INTERNAL_CHECK_IMAGE_ALL_HH
# define MLN_CORE_INTERNAL_CHECK_IMAGE_ALL_HH
-/*! \file mln/core/internal/check/image_all.hh
- *
- * \brief File that includes all image-related internal checks.
- */
-
+/// \file mln/core/internal/check/image_all.hh
+///
+/// File that includes all image-related internal checks.
+# include <mln/trait/images.hh>
# include <mln/core/internal/check/image_fastest.hh>
// ...
diff --git a/milena/mln/core/internal/check/image_fastest.hh b/milena/mln/core/internal/check/image_fastest.hh
index 44f5611..f225c1e 100644
--- a/milena/mln/core/internal/check/image_fastest.hh
+++ b/milena/mln/core/internal/check/image_fastest.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,14 +29,18 @@
#ifndef MLN_CORE_INTERNAL_CHECK_IMAGE_FASTEST_HH
# define MLN_CORE_INTERNAL_CHECK_IMAGE_FASTEST_HH
-/*! \file mln/core/internal/check/image_fastest.hh
- *
- * \brief Class that statically checks the interface of fastest
- * images.
- *
- * \todo Check and convert p in index_of_point towards E::psite.
- */
+/// \file mln/core/internal/check/image_fastest.hh
+///
+/// Class that statically checks the interface of fastest
+/// images.
+///
+/// \todo Check and convert p in index_of_point towards E::psite.
+
+# include <mln/metal/bool.hh>
+# include <mln/core/macros.hh>
+# include <mln/core/trait/pixter.hh>
+# include <mln/core/trait/qlf_value.hh>
# include <mln/core/internal/force_exact.hh>
namespace mln
@@ -47,21 +52,20 @@ namespace mln
namespace check
{
- /*! FIXME
- */
+ /// FIXME
template < typename E, typename B = metal::true_ >
struct image_fastest_
{
- /*! \brief Give the offset of the site \p p.
- *
- * \param[in] p A site.
- *
- * \warning This method is final.
- *
- * \pre The image has to be initialized and to own the point \p p.
- * \post p == point_at_index(result)
- */
+ /// \brief Give the offset of the site \p p.
+ ///
+ /// \param[in] p A site.
+ ///
+ /// \warning This method is final.
+ ///
+ /// \pre The image has to be initialized and to own the point \p p.
+ /// \post p == point_at_index(result)
+ ///
template <typename P>
unsigned
index_of_point(const P& p) const;
@@ -71,7 +75,6 @@ namespace mln
};
- ///
template <typename E>
struct image_fastest_< E, metal::false_ >
{
@@ -86,8 +89,8 @@ namespace mln
image_fastest_<E,B>::image_fastest_()
{
typedef mln_site(E) site;
- typedef mln_psite(E) psite;
- typedef mln_delta(psite) dpsite;
+ typedef mln_psite(E) psite;
+ typedef mln_delta(psite) dpsite;
typedef mln_fwd_pixter(E) fwd_pixter;
diff --git a/milena/mln/core/internal/graph_neighborhood_base.hh b/milena/mln/core/internal/graph_neighborhood_base.hh
index 0e39cce..451e527 100644
--- a/milena/mln/core/internal/graph_neighborhood_base.hh
+++ b/milena/mln/core/internal/graph_neighborhood_base.hh
@@ -32,6 +32,9 @@
///
/// FIXME: doc
+# include <set>
+# include <mln/core/concept/neighborhood.hh>
+
namespace mln
{
diff --git a/milena/mln/core/internal/graph_window_base.hh b/milena/mln/core/internal/graph_window_base.hh
index 3c91448..0ea95ec 100644
--- a/milena/mln/core/internal/graph_window_base.hh
+++ b/milena/mln/core/internal/graph_window_base.hh
@@ -29,6 +29,7 @@
# define MLN_CORE_INTERNAL_GRAPH_WINDOW_BASE_HH
# include <set>
+# include <mln/core/concept/window.hh>
/// \file mln/internal/graph_window_base.hh
///
diff --git a/milena/mln/core/internal/image_if_base.hh b/milena/mln/core/internal/image_if_base.hh
deleted file mode 100644
index 35fb2ae..0000000
--- a/milena/mln/core/internal/image_if_base.hh
+++ /dev/null
@@ -1,202 +0,0 @@
-// Copyright (C) 2007 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
-// of the GNU General Public License version 2 as published by the
-// Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this library; see the file COPYING. If not, write to
-// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-// Boston, MA 02111-1307, USA.
-//
-// As a special exception, you may use this file as part of a free
-// software library without restriction. Specifically, if other files
-// instantiate templates or use macros or inline functions from this
-// file, or you compile this file and link it with other files to
-// produce an executable, this file does not by itself cause the
-// resulting executable to be covered by the GNU General Public
-// License. This exception does not however invalidate any other
-// reasons why the executable file might be covered by the GNU General
-// Public License.
-
-#ifndef MLN_CORE_INTERNAL_IMAGE_IF_BASE_HH
-# define MLN_CORE_INTERNAL_IMAGE_IF_BASE_HH
-
-/*! \file mln/core/internal/image_if_base.hh
- *
- * \brief Definition of a image_if_base image.
- */
-
-# include <mln/core/internal/image_domain_morpher.hh>
-# include <mln/core/site_set/p_if.hh>
-# include <mln/pw/all.hh>
-# include <mln/value/interval.hh>
-
-
-namespace mln
-{
-
-
- namespace internal
- {
-
- // Fwd decl.
- template <typename I, typename F, typename E> struct image_if_base_;
-
- // data_.
-
- template <typename I, typename F, typename E>
- struct data< image_if_base_<I,F,E> >
- {
- data(I& ima, const F& f);
-
- I ima_;
- p_if<mln_pset(I), F> pset_;
- };
-
- } // end of namespace mln::internal
-
-
-
- namespace trait
- {
-
- template <typename I, typename F, typename E>
- struct image_< mln::internal::image_if_base_<I,F,E> > : default_image_morpher< I, mln_value(I), E >
- {
- private:
- typedef mln_trait_image_data(I) I_data_;
- typedef mlc_equal(I_data_, trait::image::data::linear) I_data_are_linear_;
- public:
-
- typedef trait::image::category::domain_morpher category;
-
- typedef mlc_if( mlc_is_const(I),
- trait::image::io::read_only, // I const => read_only
- mln_trait_image_io(I) ) io; // otherwise like I
-
- typedef mlc_if( I_data_are_linear_,
- trait::image::data::stored, // if linear then just stored
- I_data_ ) data; // otherwise like I
-
- typedef mln_trait_image_border(I) border;
- };
-
- } // end of namespace mln::trait
-
-
-
- namespace internal
- {
-
- /*! An base image class for image_if_'something.
- *
- */
- template <typename I, typename F, typename E>
- struct image_if_base_ : public internal::image_domain_morpher< I, p_if<mln_pset(I),F>, E >
- {
-
- /// Give the definition domain.
- const p_if<mln_pset(I), F>& domain() const;
-
- void init_(I& ima, const F& f);
-
- /// Test if the image owns the point site \p p.
- /// The result is the same than over the underlying image.
- bool has(const mln_psite(I)& p) const;
-
- protected:
-
- /// Constructor from an image \p ima and a predicate \p f.
- image_if_base_(I& ima, const F& f);
-
- /// Constructor without argument.
- image_if_base_();
- };
-
-
-# ifndef MLN_INCLUDE_ONLY
-
-// // init_
-
-// template <typename I, typename F, typename E>
-// void init_(tag::function_t, F& f, const image_if_base_<I,F,E>& model)
-// {
-// f = model.domain().predicate();
-// }
-
-// template <typename I, typename F, typename E, typename J>
-// void init_(tag::image_t, image_if_base_<I,F,E>& target, const J& model)
-// {
-// I ima;
-// init_(tag::image, ima, exact(model));
-// F f;
-// init_(tag::function, f, exact(model));
-// target.init_(ima, f);
-// }
-
- // internal::data< image_if_base_<I,S> >
-
- template <typename I, typename F, typename E>
- inline
- data< image_if_base_<I,F,E> >::data(I& ima, const F& f)
- : ima_(ima),
- pset_(ima.domain() | f)
- {
- }
-
- // image_if_base_<I,F,E>
-
- template <typename I, typename F, typename E>
- inline
- image_if_base_<I,F,E>::image_if_base_()
- {
- }
-
- template <typename I, typename F, typename E>
- inline
- image_if_base_<I,F,E>::image_if_base_(I& ima, const F& f)
- {
- init_(ima, f);
- }
-
- template <typename I, typename F, typename E>
- inline
- bool
- image_if_base_<I,F,E>::has(const mln_psite(I)& p) const
- {
- mln_precondition(this->has_data());
- return this->data_->ima_.has(p);
- }
-
- template <typename I, typename F, typename E>
- inline
- void
- image_if_base_<I,F,E>::init_(I& ima, const F& f)
- {
- mln_precondition(! this->has_data());
- this->data_ = new internal::data<E>(ima, f);
- }
-
- template <typename I, typename F, typename E>
- inline
- const p_if<mln_pset(I), F>&
- image_if_base_<I,F,E>::domain() const
- {
- return this->data_->pset_;
- }
-
-# endif // ! MLN_INCLUDE_ONLY
-
- } // end of namespace mln::internal
-
-} // end of namespace mln
-
-
-#endif // ! MLN_CORE_INTERNAL_IMAGE_IF_BASE_HH
diff --git a/milena/mln/core/internal/pixel_impl.hh b/milena/mln/core/internal/pixel_impl.hh
index e7bdc0b..5ab9509 100644
--- a/milena/mln/core/internal/pixel_impl.hh
+++ b/milena/mln/core/internal/pixel_impl.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,12 +28,12 @@
#ifndef MLN_CORE_INTERNAL_PIXEL_IMPL_HH
# define MLN_CORE_INTERNAL_PIXEL_IMPL_HH
-/*! \file mln/core/internal/pixel_impl.hh
- *
- * \brief Define a couple of implementation classes to provide methods
- * to classes of generalized pixels.
- */
+/// \file mln/core/internal/pixel_impl.hh
+///
+/// Define a couple of implementation classes to provide methods
+/// to classes of generalized pixels.
+# include <mln/core/concept/image.hh>
# include <mln/core/internal/force_exact.hh>
@@ -43,10 +43,8 @@ namespace mln
namespace internal
{
- /*! Implementation class to equip generalized pixel
- * classes based on mutable images.
- *
- */
+ /// Implementation class to equip generalized pixel
+ /// classes based on mutable images.
template <typename I, typename E>
class pixel_impl_
{
@@ -95,10 +93,8 @@ namespace mln
};
- /*! Implementation class to equip generalized pixel
- * classes based on constant images.
- *
- */
+ /// Implementation class to equip generalized pixel
+ /// classes based on constant images.
template <typename I, typename E>
class pixel_impl_< const I, E >
{
diff --git a/milena/mln/core/internal/set_of.hh b/milena/mln/core/internal/set_of.hh
index b7f16bf..4058e0d 100644
--- a/milena/mln/core/internal/set_of.hh
+++ b/milena/mln/core/internal/set_of.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,16 +28,16 @@
#ifndef MLN_CORE_INTERNAL_SET_OF_HH
# define MLN_CORE_INTERNAL_SET_OF_HH
-/*! \file mln/core/internal/set_of.hh
- *
- * \brief Definition of mln::set_of_ for internal use only.
- */
+/// \file mln/core/internal/set_of.hh
+///
+/// \brief Definition of mln::set_of_ for internal use only.
# include <vector>
# include <set>
# include <iterator>
# include <algorithm>
+# include <mln/core/contract.hh>
# include <mln/core/internal/force_exact.hh>
diff --git a/milena/mln/core/site_set/box_piter.hh b/milena/mln/core/site_set/box_piter.hh
index 3ec1aeb..cce30d6 100644
--- a/milena/mln/core/site_set/box_piter.hh
+++ b/milena/mln/core/site_set/box_piter.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,24 +29,24 @@
#ifndef MLN_CORE_SITE_SET_BOX_PITER_HH
# define MLN_CORE_SITE_SET_BOX_PITER_HH
-/*! \file mln/core/site_set/box_piter.hh
- *
- * \brief Definition of iterators on points of boxes.
- */
+/// \file mln/core/site_set/box_piter.hh
+///
+/// Definition of iterators on points of boxes.
# include <mln/core/internal/site_set_iterator_base.hh>
# include <mln/core/concept/box.hh>
+# include <mln/core/site_set/box.hh>
namespace mln
{
- /*! \brief A generic forward iterator on points of boxes.
- *
- * The parameter \c P is the type of points.
- *
- * \see mln::box_
- */
+ /// \brief A generic forward iterator on points of boxes.
+ ///
+ /// The parameter \c P is the type of points.
+ ///
+ /// \see mln::box
+ ///
template <typename P>
class box_fwd_piter_ : public internal::site_set_iterator_base< box<P>,
box_fwd_piter_<P> >
@@ -61,10 +62,10 @@ namespace mln
/// Constructor without argument.
box_fwd_piter_();
- /*! \brief Constructor.
- *
- * \param[in] b A box.
- */
+ /// Constructor.
+ ///
+ /// \param[in] b A box.
+ ///
box_fwd_piter_(const box<P>& b);
/// Test the iterator validity.
@@ -86,12 +87,12 @@ namespace mln
- /*! \brief A generic backward iterator on points of boxes.
- *
- * The parameter \c P is the type of points.
- *
- * \see mln::box_
- */
+ /// A generic backward iterator on points of boxes.
+ ///
+ /// The parameter \c P is the type of points.
+ ///
+ /// \see mln::box
+ ///
template <typename P>
class box_bkd_piter_ : public internal::site_set_iterator_base< box<P>,
box_bkd_piter_<P> >
@@ -107,10 +108,10 @@ namespace mln
/// Constructor without argument.
box_bkd_piter_();
- /*! \brief Constructor.
- *
- * \param[in] b A box.
- */
+ /// Constructor.
+ ///
+ /// \param[in] b A box.
+ ///
box_bkd_piter_(const box<P>& b);
/// Test the iterator validity.
diff --git a/milena/mln/core/site_set/p_centered.hh b/milena/mln/core/site_set/p_centered.hh
index ca961c5..ec75518 100644
--- a/milena/mln/core/site_set/p_centered.hh
+++ b/milena/mln/core/site_set/p_centered.hh
@@ -38,6 +38,7 @@
*/
# include <mln/core/internal/site_set_base.hh>
+# include <mln/core/internal/site_set_iterator_base.hh>
namespace mln
diff --git a/milena/mln/fun/p2b/has.hh b/milena/mln/fun/p2b/has.hh
index 142beb1..4e70840 100644
--- a/milena/mln/fun/p2b/has.hh
+++ b/milena/mln/fun/p2b/has.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,11 +29,12 @@
#ifndef MLN_FUN_P2B_HAS_HH
# define MLN_FUN_P2B_HAS_HH
-/*! \file mln/fun/p2b/has.hh
- *
- * \brief Function "psite-> bool" that maps the call "ima.has(p)".
- */
+/// \file mln/fun/p2b/has.hh
+///
+/// Function "psite-> bool" that maps the call "ima.has(p)".
+
+# include <mln/core/concept/image.hh>
# include <mln/core/concept/function.hh>
# include <mln/metal/const.hh>
# include <mln/metal/unconst.hh>
diff --git a/milena/mln/fun/x2p/closest_point.hh b/milena/mln/fun/x2p/closest_point.hh
index 8614cac..7fe3429 100644
--- a/milena/mln/fun/x2p/closest_point.hh
+++ b/milena/mln/fun/x2p/closest_point.hh
@@ -30,7 +30,8 @@
# include <mln/algebra/vec.hh>
# include <mln/norm/l2.hh>
-
+# include <mln/core/site_set/p_array.hh>
+# include <mln/core/site_set/box.hh>
namespace mln
{
diff --git a/milena/mln/geom/seeds2tiling_roundness.hh b/milena/mln/geom/seeds2tiling_roundness.hh
index 2da16b1..eb6c5a7 100644
--- a/milena/mln/geom/seeds2tiling_roundness.hh
+++ b/milena/mln/geom/seeds2tiling_roundness.hh
@@ -29,15 +29,15 @@
#ifndef MLN_GEOM_SEEDS2TILING_ROUNDNESS_HH
# define MLN_GEOM_SEEDS2TILING_ROUNDNESS_HH
-/*! \file mln/geom/seeds2tiling_roundness.hh
- *
- * \brief seeds2tiling with a method which makes tiles more roundness.
- */
+/// \file mln/geom/seeds2tiling_roundness.hh
+///
+/// seeds2tiling with a method which makes tiles more roundness.
# include <map>
-
+# include <mln/core/concept/image.hh>
# include <mln/core/concept/neighborhood.hh>
+# include <mln/core/alias/w_window2d_int.hh>
# include <mln/core/site_set/p_priority.hh>
# include <mln/core/site_set/p_queue_fast.hh>
# include <mln/core/routine/clone.hh>
diff --git a/milena/mln/io/txt/save.hh b/milena/mln/io/txt/save.hh
index ad5713b..597e07c 100644
--- a/milena/mln/io/txt/save.hh
+++ b/milena/mln/io/txt/save.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2008 EPITA
-// Research and Development Laboratory
+// Copyright (C) 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -29,18 +29,14 @@
#ifndef MLN_IO_TXT_SAVE_HH
# define MLN_IO_TXT_SAVE_HH
-/*!
- * \file mln/io/txt/save.hh
- *
- * \brief Define a function which saves an image of kind TXT into
- * given path.
- *
- */
+/// \file mln/io/txt/save.hh
+///
+/// \brief Save an image as txt file.
# include <iostream>
# include <fstream>
-# include <mln/core/concept/image.hh>
+# include <mln/core/image/image2d.hh>
# include <mln/metal/is.hh>
@@ -54,11 +50,10 @@ namespace mln
namespace txt
{
- /*! Save a Milena image as a txt image.
- *
- * \param[in] ima_ The image to save. Must be an image of char.
- * \param[in] filename the destination.
- */
+ /// Save an image as txt file.
+ ///
+ /// \param[in] ima_ The image to save. Must be an image of char.
+ /// \param[in] filename the destination.
void
save(const image2d<char>& ima, const std::string& filename);
diff --git a/milena/mln/metal/vec.hh b/milena/mln/metal/vec.hh
index 4c7bdc5..36f00ab 100644
--- a/milena/mln/metal/vec.hh
+++ b/milena/mln/metal/vec.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2006 EPITA Research and Development Laboratory
+// Copyright (C) 2006, 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,16 +29,15 @@
#ifndef MLN_METAL_VEC_HH
# define MLN_METAL_VEC_HH
-/*!
- * \file mln/metal/vec.hh
- *
- * \brief Definition of a generic vector class.
- */
+/// \file mln/metal/vec.hh
+///
+/// Definition of a generic vector class.
# include <iostream>
# include <cmath>
# include <mln/core/concept/object.hh>
+# include <mln/algebra/h_vec.hh>
# include <mln/trait/all.hh>
# include <mln/trait/value_.hh>
diff --git a/milena/mln/morpho/internal/elementary.hh b/milena/mln/morpho/internal/elementary.hh
index 8c08fc5..0136097 100644
--- a/milena/mln/morpho/internal/elementary.hh
+++ b/milena/mln/morpho/internal/elementary.hh
@@ -36,6 +36,7 @@
# include <mln/core/concept/image.hh>
# include <mln/core/concept/neighborhood.hh>
# include <mln/core/concept/accumulator.hh>
+# include <mln/core/concept/meta_accumulator.hh>
namespace mln
diff --git a/milena/mln/morpho/tree/data.hh b/milena/mln/morpho/tree/data.hh
index bafd3ea..2f91351 100644
--- a/milena/mln/morpho/tree/data.hh
+++ b/milena/mln/morpho/tree/data.hh
@@ -34,7 +34,7 @@
# include <mln/morpho/tree/compute_parent.hh>
# include <mln/core/image/sub_image.hh>
-
+# include <mln/core/site_set/p_array.hh>
namespace mln
diff --git a/milena/mln/registration/get_rot.hh b/milena/mln/registration/get_rot.hh
index 916f29f..6742abc 100644
--- a/milena/mln/registration/get_rot.hh
+++ b/milena/mln/registration/get_rot.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,8 +29,10 @@
#ifndef MLN_REGISTRATION_GET_ROT_HH
# define MLN_REGISTRATION_GET_ROT_HH
+# include <mln/core/site_set/p_array.hh>
# include <mln/fun/x2x/all.hh>
# include <mln/algebra/quat.hh>
+# include <mln/algebra/vec.hh>
# include <mln/math/jacobi.hh>
namespace mln
diff --git a/milena/mln/registration/get_rtransf.hh b/milena/mln/registration/get_rtransf.hh
index 3170acb..b380f30 100644
--- a/milena/mln/registration/get_rtransf.hh
+++ b/milena/mln/registration/get_rtransf.hh
@@ -1,4 +1,5 @@
// Copyright (C) 2008 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of the Olena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,8 +29,10 @@
#ifndef MLN_REGISTRATION_GET_RTRANSF_HH
# define MLN_REGISTRATION_GET_RTRANSF_HH
+# include <mln/core/site_set/p_array.hh>
# include <mln/fun/x2x/all.hh>
# include <mln/algebra/quat.hh>
+# include <mln/algebra/vec.hh>
# include <mln/math/jacobi.hh>
# include <mln/registration/get_rot.hh>
diff --git a/milena/mln/registration/multiscale.hh b/milena/mln/registration/multiscale.hh
index 3a202f7..f54a759 100644
--- a/milena/mln/registration/multiscale.hh
+++ b/milena/mln/registration/multiscale.hh
@@ -28,7 +28,11 @@
#ifndef MLN_REGISTRATION_MULTISCALE_HH
# define MLN_REGISTRATION_MULTISCALE_HH
+# include <mln/core/concept/image.hh>
+# include <mln/core/image/lazy_image.hh>
+# include <mln/core/site_set/p_array.hh>
# include <mln/registration/icp.hh>
+# include <mln/registration/registration.hh>
# include <mln/fun/x2p/closest_point.hh>
namespace mln
diff --git a/milena/mln/topo/face.hh b/milena/mln/topo/face.hh
index 53b5ad3..3d25954 100644
--- a/milena/mln/topo/face.hh
+++ b/milena/mln/topo/face.hh
@@ -31,11 +31,12 @@
/// \file mln/topo/face.hh
/// \brief Face of a complex.
-#include <limits>
-#include <vector>
+# include <iostream>
+# include <limits>
+# include <vector>
-#include <mln/core/contract.hh>
-#include <mln/metal/bool.hh>
+# include <mln/core/contract.hh>
+# include <mln/metal/bool.hh>
namespace mln
diff --git a/milena/mln/topo/face_iter.hh b/milena/mln/topo/face_iter.hh
index 2c0df92..4030594 100644
--- a/milena/mln/topo/face_iter.hh
+++ b/milena/mln/topo/face_iter.hh
@@ -34,6 +34,7 @@
# include <mln/topo/internal/complex_set_iterator_base.hh>
# include <mln/topo/face.hh>
+# include <mln/topo/face_iter.hh>
// FIXME: Factor a bit more? (Using complex_set_iterator_base.)
diff --git a/milena/mln/topo/n_face.hh b/milena/mln/topo/n_face.hh
index ef1aad8..e7a6475 100644
--- a/milena/mln/topo/n_face.hh
+++ b/milena/mln/topo/n_face.hh
@@ -29,13 +29,15 @@
# define MLN_TOPO_N_FACE_HH
/// \file mln/topo/n_face.hh
+///
/// \brief n-face of a complex.
-#include <limits>
-#include <vector>
-
-#include <mln/core/contract.hh>
+# include <iostream>
+# include <limits>
+# include <vector>
+# include <mln/core/contract.hh>
+# include <mln/metal/bool.hh>
namespace mln
{
diff --git a/milena/mln/trait/op/ord.hh b/milena/mln/trait/op/ord.hh
index c1b49ee..85fcd3d 100644
--- a/milena/mln/trait/op/ord.hh
+++ b/milena/mln/trait/op/ord.hh
@@ -33,7 +33,7 @@
/// Declaration of an ordering operator trait.
# include <mln/trait/op/decl.hh>
-
+# include <mln/trait/solve.hh>
namespace mln
diff --git a/milena/mln/util/edge.hh b/milena/mln/util/edge.hh
index f0895c5..57d4e49 100644
--- a/milena/mln/util/edge.hh
+++ b/milena/mln/util/edge.hh
@@ -33,8 +33,8 @@
/// Definition of a graph edge.
# include <iostream>
-# include <mln/util/internal/graph_edge_impl.hh>
-
+# include <mln/util/internal/edge_impl.hh>
+# include <mln/core/concept/proxy.hh>
namespace mln
{
diff --git a/milena/mln/util/internal/graph_edge_impl.hh b/milena/mln/util/internal/edge_impl.hh
similarity index 91%
rename from milena/mln/util/internal/graph_edge_impl.hh
rename to milena/mln/util/internal/edge_impl.hh
index 3b75086..5a2b59c 100644
--- a/milena/mln/util/internal/graph_edge_impl.hh
+++ b/milena/mln/util/internal/edge_impl.hh
@@ -25,10 +25,10 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_INTERNAL_GRAPH_EDGE_IMPL_HH
-# define MLN_CORE_INTERNAL_GRAPH_EDGE_IMPL_HH
+#ifndef MLN_CORE_INTERNAL_EDGE_IMPL_HH
+# define MLN_CORE_INTERNAL_EDGE_IMPL_HH
-/// \file mln/util/internal/graph_edge_impl.hh
+/// \file mln/util/internal/edge_impl.hh
///
/// Define a couple of implementation classes to provide methods
/// to classes of generalized edges.
@@ -85,4 +85,4 @@ namespace mln
#endif // ! MLN_INCLUDE_ONLY
-#endif // ! MLN_CORE_INTERNAL_GRAPH_EDGE_IMPL_HH
+#endif // ! MLN_CORE_INTERNAL_EDGE_IMPL_HH
diff --git a/milena/mln/util/internal/graph_nbh_iter.hh b/milena/mln/util/internal/graph_nbh_iter.hh
index e43c5ea..0780cab 100644
--- a/milena/mln/util/internal/graph_nbh_iter.hh
+++ b/milena/mln/util/internal/graph_nbh_iter.hh
@@ -30,6 +30,8 @@
# include <mln/core/concept/proxy.hh>
# include <mln/util/internal/graph_nbh_iter_base.hh>
+# include <mln/util/vertex.hh>
+# include <mln/util/edge.hh>
/// \file mln/util/internal/graph_nbh_iter.hh
/// \brief Implementation for graph vertex iterators centered to a vertex.
diff --git a/milena/mln/util/internal/graph_vertex_impl.hh b/milena/mln/util/internal/vertex_impl.hh
similarity index 91%
rename from milena/mln/util/internal/graph_vertex_impl.hh
rename to milena/mln/util/internal/vertex_impl.hh
index bfe6360..74c6f3c 100644
--- a/milena/mln/util/internal/graph_vertex_impl.hh
+++ b/milena/mln/util/internal/vertex_impl.hh
@@ -25,10 +25,10 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_INTERNAL_GRAPH_VERTEX_IMPL_HH
-# define MLN_CORE_INTERNAL_GRAPH_VERTEX_IMPL_HH
+#ifndef MLN_CORE_INTERNAL_VERTEX_IMPL_HH
+# define MLN_CORE_INTERNAL_VERTEX_IMPL_HH
-/// \file mln/util/internal/graph_vertex_impl.hh
+/// \file mln/util/internal/vertex_impl.hh
///
/// Define a couple of implementation classes to provide methods
/// to classes of generalized vertexs.
@@ -85,4 +85,4 @@ namespace mln
#endif // ! MLN_INCLUDE_ONLY
-#endif // ! MLN_CORE_INTERNAL_GRAPH_VERTEX_IMPL_HH
+#endif // ! MLN_CORE_INTERNAL_VERTEX_IMPL_HH
diff --git a/milena/mln/util/multi_site.hh b/milena/mln/util/multi_site.hh
index 2480369..3962751 100644
--- a/milena/mln/util/multi_site.hh
+++ b/milena/mln/util/multi_site.hh
@@ -35,6 +35,7 @@
# include <vector>
+# include <mln/core/concept/object.hh>
namespace mln
{
diff --git a/milena/mln/util/vertex.hh b/milena/mln/util/vertex.hh
index 9787c03..b1242e6 100644
--- a/milena/mln/util/vertex.hh
+++ b/milena/mln/util/vertex.hh
@@ -29,7 +29,8 @@
# define MLN_UTIL_VERTEX_HH
# include <iostream>
-# include <mln/util/internal/graph_vertex_impl.hh>
+# include <mln/util/internal/vertex_impl.hh>
+# include <mln/core/concept/proxy.hh>
/// \file mln/util/vertex.hh
///
@@ -52,7 +53,7 @@ namespace mln
/// Graph associated type.
typedef G graph_t;
-
+
/// Constructors.
/// \{
vertex();
diff --git a/milena/tests/morpho/Makefile.am b/milena/tests/morpho/Makefile.am
index 5c88623..631a2fd 100644
--- a/milena/tests/morpho/Makefile.am
+++ b/milena/tests/morpho/Makefile.am
@@ -8,7 +8,7 @@ SUBDIRS = \
tree
check_PROGRAMS = \
- artificial_line_graph_image_wst \
+## artificial_line_graph_image_wst \
closing_area \
closing_height \
closing_volume \
@@ -21,7 +21,7 @@ check_PROGRAMS = \
erosion \
## erosion_min_h \
gradient \
- graph_image_morpho \
+## graph_image_morpho \
## graph_image_wst \
hit_or_miss \
laplacian \
@@ -82,8 +82,8 @@ combined_SOURCES = combined.cc
# Complex tests. #
# --------------- #
-artificial_line_graph_image_wst_SOURCES = artificial_line_graph_image_wst.cc
-artificial_line_graph_image_wst_CXXFLAGS = $(TESTS_CXXFLAGS_SPEED)
+##artificial_line_graph_image_wst_SOURCES = artificial_line_graph_image_wst.cc
+##artificial_line_graph_image_wst_CXXFLAGS = $(TESTS_CXXFLAGS_SPEED)
dilation_SOURCES = dilation.cc
dilation_CXXFLAGS = $(TESTS_CXXFLAGS_SPEED)
diff --git a/milena/tests/unit_test/build_unit_test.sh b/milena/tests/unit_test/build_unit_test.sh
index 6a6006e..495d332 100755
--- a/milena/tests/unit_test/build_unit_test.sh
+++ b/milena/tests/unit_test/build_unit_test.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-HEADERS=`find ../../mln -name "*.hh" | grep -vE "*.spe.hh" | sed s/"\.\.\/\.\.\/"//g`
+HEADERS=`find ../../mln -name "*.hh" | grep -vE "*.spe.hh" | grep -v "mln/core/doc" | sed s/"\.\.\/\.\.\/"//g`
rm -f Makefile.am
rm -f *.hh *.cc
--
1.5.6.5
https://svn.lrde.epita.fr/svn/oln/trunk/milena/sandbox
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Add a test of attribute image computation.
* geraud/test_attribute.cc: New.
test_attribute.cc | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 122 insertions(+)
Index: geraud/test_attribute.cc
--- geraud/test_attribute.cc (revision 0)
+++ geraud/test_attribute.cc (revision 0)
@@ -0,0 +1,122 @@
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+/// \file tests/morpho/tree/compute_attribute_image.cc
+///
+/// Tests on mln::morpho::tree::compute_attribute_image.
+
+#include <mln/core/image/image2d.hh>
+#include <mln/core/alias/neighb2d.hh>
+#include <mln/core/site_set/p_array.hh>
+#include <mln/level/sort_psites.hh>
+#include <mln/level/transform.hh>
+
+#include <mln/debug/println.hh>
+#include <mln/core/var.hh>
+#include <mln/value/int_u8.hh>
+
+#include <mln/morpho/tree/data.hh>
+#include <mln/morpho/tree/compute_attribute_image.hh>
+
+#include <mln/morpho/closing_area.hh>
+#include <mln/morpho/opening_area.hh>
+
+#include <mln/accu/count.hh>
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
+#include <mln/io/pbm/save.hh>
+
+#include <mln/arith/min.hh>
+#include <mln/arith/diff_abs.hh>
+
+
+struct sat_t : mln::Function_v2v<sat_t>
+{
+ typedef mln::value::int_u8 result;
+ result operator()(unsigned u) const
+ {
+ return u > 255 ? 255 : u;
+ }
+}
+ sat;
+
+
+
+int main()
+{
+ using namespace mln;
+ using value::int_u8;
+
+ typedef image2d<int_u8> I;
+ typedef p_array<point2d> S;
+ typedef util::pix<I> Px;
+
+
+ I f;
+ io::pgm::load(f, "../../../img/tiny.pgm");
+
+
+ image2d<unsigned> area_inc, area_dec;
+ {
+ S s = level::sort_psites_increasing(f);
+ morpho::tree::data<I,S> t(f, s, c4());
+ accu::count<Px> a;
+ area_inc = morpho::tree::compute_attribute_image(a, t);
+ debug::println("area_inc =", area_inc);
+ }
+ {
+ S s = level::sort_psites_decreasing(f);
+ morpho::tree::data<I,S> t(f, s, c4());
+ accu::count<Px> a;
+ area_dec = morpho::tree::compute_attribute_image(a, t);
+ debug::println("area_dec =", area_dec);
+ }
+
+ io::pgm::save(level::transform(area_inc, sat), "inc.pgm");
+ io::pgm::save(level::transform(area_dec, sat), "dec.pgm");
+
+ image2d<unsigned> area = arith::min(area_inc, area_dec);
+ io::pgm::save(level::transform(area, sat), "min.pgm");
+
+ unsigned lambda = 20;
+
+ {
+ I clo = morpho::closing_area(f, c4(), lambda);
+ io::pgm::save(clo, "clo.pgm");
+
+ I ope(clo.domain());
+ morpho::opening_area(f, c4(), lambda, ope);
+ io::pgm::save(ope, "ope.pgm");
+
+ I d_clo = arith::diff_abs(f, clo);
+ io::pgm::save(d_clo, "d_clo.pgm");
+
+ I d_ope = arith::diff_abs(f, ope);
+ io::pgm::save(d_ope, "d_ope.pgm");
+ }
+
+}
https://svn.lrde.epita.fr/svn/oln/trunk/milena/sandbox
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Add a version of parent computation that store roots.
* geraud/compute_parent_more.hh: New.
compute_parent_more.hh | 191 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 191 insertions(+)
Index: geraud/compute_parent_more.hh
--- geraud/compute_parent_more.hh (revision 0)
+++ geraud/compute_parent_more.hh (revision 0)
@@ -0,0 +1,191 @@
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_MORPHO_TREE_COMPUTE_PARENT_HH
+# define MLN_MORPHO_TREE_COMPUTE_PARENT_HH
+
+/// \file mln/morpho/tree/compute_parent.hh
+///
+/// Compute a canonized tree from an image.
+///
+/// \todo Specialize for low quant (and try fastest).
+
+# include <mln/core/concept/image.hh>
+# include <mln/core/concept/neighborhood.hh>
+# include <mln/level/fill.hh>
+
+
+namespace mln
+{
+
+ namespace morpho
+ {
+
+ namespace tree
+ {
+
+
+ template <typename T>
+ inline
+ mln_psite(T)
+ zfind_root(T& zpar, const mln_psite(T)& x)
+ {
+ mlc_equal(mln_value(T), mln_psite(T))::check();
+ if (zpar(x) == x)
+ return x;
+ else
+ return zpar(x) = zfind_root(zpar, zpar(x));
+ }
+
+
+
+ template <typename I, typename N, typename S>
+ inline
+ mln_ch_value(I, mln_psite(I))
+ compute_parent_more(const Image<I>& f_,
+ const Neighborhood<N>& nbh_,
+ const Site_Set<S>& s_)
+ {
+ typedef mln_psite(I) P;
+
+ const I& f = exact(f_);
+ const N& nbh = exact(nbh_);
+ const S& s = exact(s_);
+
+ // Auxiliary data.
+ mln_ch_value(I, bool) deja_vu;
+ mln_ch_value(I, P) parent;
+ mln_ch_value(I, P) zpar;
+
+ initialize(deja_vu, f);
+ initialize(parent, f);
+ initialize(zpar, f);
+
+ typedef mln_vset(S) Vs;
+ typedef mln_pset(S) Ps;
+ S roots;
+
+ // Initialization.
+ level::fill(deja_vu, false);
+ unsigned nnodes = 0;
+
+ // Body.
+ mln_bkd_viter(Vs) v(s.values());
+ for_all(v)
+ {
+ if (s(v).is_empty())
+ continue;
+
+ mln_bkd_piter(Ps) p(s(v));
+ mln_niter(N) n(nbh, p);
+ for_all(p)
+ {
+ // Make-Set.
+ parent(p) = p;
+ zpar(p) = p;
+
+ for_all(n)
+ if (f.domain().has(n) && deja_vu(n))
+ {
+ // Do-Union.
+ P r = internal::zfind_root(zpar, n);
+ if (r != p)
+ {
+ parent(r) = p;
+ zpar(r) = p;
+ }
+ }
+ deja_vu(p) = true;
+ }
+
+
+ /*
+
+ // Canonization on the-fly.
+ {
+ // Intra-v:
+ mln_fwd_piter(Ps) p(s(v));
+ for_all(p)
+ parent(p) = parent(parent(p));
+
+ // Inter "previous v and current v":
+ mln_piter(Ps) r(v_roots);
+ for_all(r)
+ parent(r) = parent(parent(r));
+ v_roots.clear();
+
+ {
+ // New roots:
+ mln_piter(Ps) p(s(v));
+ for_all(p)
+ if (parent(p) == p)
+ v_roots.insert(p);
+ nnodes += v_roots.nsites();
+ }
+ }
+
+ */
+
+ // Storing roots.
+ {
+ mln_piter(Ps) p(s(v));
+ for_all(p)
+ if (parent(p) == p)
+ roots(v).insert(p);
+ nnodes += roots(v).nsites();
+ }
+
+ } // end of "for_all(v)"
+
+
+ // Canonization.
+ {
+ mln_fwd_piter(S) p(s);
+ for_all(p)
+ {
+ P q = parent(p);
+ if (f(parent(q)) == f(q))
+ parent(p) = parent(q);
+ }
+ }
+
+ std::cout << "roots = " << roots << std::endl;
+ std::cout << "nnodes = " << nnodes << std::endl;
+
+
+ return parent;
+ }
+
+
+ } // end of namespace mln::morpho::tree
+
+ } // end of namespace mln::morpho
+
+} // end of namespace mln
+
+
+#endif // ! MLN_MORPHO_TREE_COMPUTE_PARENT_HH
* doc/examples/erosion.cc: Apply a vertical and a horizontal erosion
on a given image.
* doc/examples/graph.cc: Show how to use graphes with images.
---
milena/ChangeLog | 9 +++
milena/doc/examples/erosion.cc | 110 +++++++++++++++++++++++++++++++++++++
milena/doc/examples/graph.cc | 116 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 235 insertions(+), 0 deletions(-)
create mode 100644 milena/doc/examples/erosion.cc
create mode 100644 milena/doc/examples/graph.cc
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 28fdcc9..374175c 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,4 +1,13 @@
2008-11-27 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Add new examples.
+
+ * doc/examples/erosion.cc: Apply a vertical and a horizontal erosion
+ on a given image.
+
+ * doc/examples/graph.cc: Show how to use graphes with images.
+
+2008-11-27 Guillaume Lazzara <z(a)lrde.epita.fr>
Various small fixes.
diff --git a/milena/doc/examples/erosion.cc b/milena/doc/examples/erosion.cc
new file mode 100644
index 0000000..890fd81
--- /dev/null
+++ b/milena/doc/examples/erosion.cc
@@ -0,0 +1,110 @@
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+/// \file doc/examples/my_test.cc
+///
+/// Test on mln::morpho::hit_or_miss.
+
+# include <mln/core/image/image2d.hh>
+
+# include <mln/core/image/image_if.hh>
+# include <mln/core/image/sub_image.hh>
+# include <mln/core/alias/neighb2d.hh>
+# include <mln/core/var.hh>
+# include <mln/core/site_set/p_vaccess.hh>
+
+# include <mln/binarization/threshold.hh>
+# include <mln/morpho/hit_or_miss.hh>
+# include <mln/level/fill.hh>
+# include <mln/border/fill.hh>
+# include <mln/io/pbm/load.hh>
+# include <mln/io/pgm/load.hh>
+# include <mln/io/pbm/save.hh>
+# include <mln/io/pgm/save.hh>
+# include <mln/debug/println.hh>
+# include <mln/morpho/opening.hh>
+# include <mln/trait/value_.hh>
+# include <mln/value/int_u8.hh>
+# include <mln/level/paste.hh>
+# include <mln/labeling/blobs.hh>
+# include <mln/level/fill.hh>
+# include <mln/pw/all.hh>
+# include <mln/convert/to_fun.hh>
+# include <mln/geom/bbox.hh>
+
+
+void clean_lines(mln::image2d<bool>& in,
+ const mln::image2d<bool>& ima,
+ unsigned bbox_larger)
+{
+ using namespace mln;
+ using value::label8;
+
+ label8 nlabels;
+ image2d<label8> lbl = labeling::blobs(ima, c4(), nlabels);
+
+ for (unsigned i = nlabels; i > 0; --i)
+ {
+ level::paste(pw::cst(false)
+ | geom::bbox(lbl | (pw::value(lbl) == pw::cst(i))),//.to_larger(bbox_larger),
+ in);
+ }
+}
+
+
+int main(int argc, char*argv[])
+{
+ using namespace mln;
+ using value::int_u8;
+
+ if (argc < 2)
+ {
+ std::cout << argv[0] << " <image.pgm> <height> <width>" << std::endl;
+ return 1;
+ }
+
+ image2d<bool> in;
+ io::pbm::load(in, argv[1]);
+
+ unsigned h = atoi(argv[2]);
+ unsigned w = atoi(argv[3]);
+ unsigned n = atoi(argv[4]);
+
+ // Remove vertical lines.
+ win::rectangle2d vwin(h, w);
+ image2d<bool> vout = morpho::opening(in, vwin);
+ io::pbm::save(vout, "./vout.pbm");
+ clean_lines(in, vout, n);
+
+ // Remove Horizontal lines.
+ win::rectangle2d hwin(w, h);
+ image2d<bool> hout = morpho::opening(in, hwin);
+ io::pbm::save(hout, "./hout.pbm");
+ clean_lines(in, hout, n);
+
+ io::pbm::save(in, "./out.pbm");
+}
diff --git a/milena/doc/examples/graph.cc b/milena/doc/examples/graph.cc
new file mode 100644
index 0000000..08f0944
--- /dev/null
+++ b/milena/doc/examples/graph.cc
@@ -0,0 +1,116 @@
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+
+#include <mln/essential/2d.hh>
+#include <mln/transform/influence_zone_geodesic.hh>
+#include <mln/make/graph.hh>
+#include <mln/util/graph.hh>
+#include <mln/util/line_graph.hh>
+#include <mln/debug/draw_graph.hh>
+#include <mln/debug/colorize.hh>
+
+template <typename G>
+struct gcolor_t : public mln::Function< gcolor_t<G> >
+{
+ typedef mln::value::rgb8 result;
+
+ mln::value::rgb8
+ operator()(const mln::util::vertex<G>& v) const
+ {
+ return mln::literal::cyan;
+ }
+
+ mln::value::rgb8
+ operator()(const mln::util::edge<G>& e) const
+ {
+ return mln::literal::magenta;
+ }
+
+};
+
+
+int main(int, char *argv[])
+{
+ using namespace mln;
+ using value::label16;
+ using value::rgb8;
+
+ image2d<bool> ima;
+ io::pbm::load(ima, argv[1]);
+ //logical::not_inplace(ima);
+
+ label16 nlabels;
+ image2d<label16> lbl = labeling::blobs(ima, c8(), nlabels);
+
+#ifndef NOUT
+ io::ppm::save(debug::colorize(rgb8(), lbl, nlabels), "01-lbl.ppm");
+#endif
+
+ image2d<label16> iz = transform::influence_zone_geodesic(lbl, c8(), mln_max(int));
+
+#ifndef NOUT
+ io::ppm::save(debug::colorize(rgb8(), iz, nlabels), "02-iz.ppm");
+#endif
+
+ util::graph g = make::graph(iz, nlabels);
+
+ // Compute the components center and use them as vertex.
+ //FIXME: Add fun::vertex2p
+ typedef fun::i2v::array<point2d> fv2p_t;
+ util::array<point2d> centers = labeling::compute(accu::center<point2d>(), iz, nlabels);
+ fv2p_t fv2p = convert::to<fv2p_t>(centers);
+
+ // Create a p_vertices.
+ p_vertices<util::graph, fv2p_t> pv(g, fv2p);
+
+#ifndef NOUT
+ image2d<rgb8> gima = level::convert(rgb8(), ima);
+ debug::draw_graph(gima, pv, gcolor_t<util::graph>());
+ io::ppm::save(gima, "03-graph.ppm");
+#endif
+
+ typedef util::line_graph<util::graph> LG;
+ LG lg(g);
+
+ // Find lines (sites) associated to edges in g.
+ typedef fun::i2v::array<p_line2d> i2e_t;
+ util::array<p_line2d> lines;
+ mln_edge_iter_(util::graph) e(g);
+ for_all(e)
+ lines.append(p_line2d(fv2p(e.v1()), fv2p(e.v2())));
+
+ // Map lines to vertices in lg.
+ p_vertices<LG, i2e_t> pvlg(lg, convert::to<i2e_t>(lines));
+/*
+#ifndef NOUT
+ image2d<rgb8> lgima = level::convert(rgb8(), ima);
+ debug::draw_graph(lgima, pvlg, gcolor_t<LG>());
+ io::ppm::save(gima, "04-line-graph.ppm");
+#endif
+*/
+}
--
1.5.6.5