* mln/essential/routine.hh
* mln/canvas/morpho/connected_filter.hh
* mln/canvas/morpho/all.hh
* mln/all.hh: add missing includes.
* mln/canvas/morpho/algebraic_filter.hh,
* mln/canvas/morpho/algebraic_union_find.hh: move implementation of
find_root()...
* mln/canvas/morpho/internal/find_root.hh: ... here.
* mln/core/image/extension_fun.hh,
* mln/core/image/extension_ima.hh,
* mln/core/image/extension_val.hh: remove extended_with() (duplicate
core/routine/extend).
* mln/value/label.hh
* mln/value/rgb.hh: fix badly closed namespace.
* tests/registration/registration.cc: fix call to registration.
* tests/util/Makefile.am,
* tests/util/set.cc: re-enable this test.
---
milena/ChangeLog | 27 +++++++
milena/mln/all.hh | 1 +
milena/mln/canvas/morpho/algebraic_filter.hh | 25 +------
milena/mln/canvas/morpho/algebraic_union_find.hh | 23 +------
milena/mln/canvas/morpho/all.hh | 2 +
milena/mln/canvas/morpho/connected_filter.hh | 24 ++++---
.../morpho/{all.hh => internal/find_root.hh} | 75 ++++++++++++++++----
milena/mln/core/image/extension_fun.hh | 11 ---
milena/mln/core/image/extension_ima.hh | 13 ----
milena/mln/core/image/extension_val.hh | 11 ---
milena/mln/essential/routine.hh | 1 +
milena/mln/value/label.hh | 5 +-
milena/mln/value/rgb.hh | 7 +-
milena/tests/registration/registration.cc | 6 ++-
milena/tests/util/Makefile.am | 2 +
milena/tests/util/set.cc | 12 ++--
16 files changed, 127 insertions(+), 118 deletions(-)
copy milena/mln/canvas/morpho/{all.hh => internal/find_root.hh} (51%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 81868ae..5727ea3 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,32 @@
2009-02-24 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Various small fixes.
+
+ * mln/essential/routine.hh
+ * mln/canvas/morpho/connected_filter.hh
+ * mln/canvas/morpho/all.hh
+ * mln/all.hh: add missing includes.
+
+ * mln/canvas/morpho/algebraic_filter.hh,
+ * mln/canvas/morpho/algebraic_union_find.hh: move implementation of
+ find_root()...
+ * mln/canvas/morpho/internal/find_root.hh: ... here.
+
+ * mln/core/image/extension_fun.hh,
+ * mln/core/image/extension_ima.hh,
+ * mln/core/image/extension_val.hh: remove extended_with() (duplicate
+ core/routine/extend).
+
+ * mln/value/label.hh
+ * mln/value/rgb.hh: fix badly closed namespace.
+
+ * tests/registration/registration.cc: fix call to registration.
+
+ * tests/util/Makefile.am,
+ * tests/util/set.cc: re-enable this test.
+
+2009-02-24 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Update tutorial.
* doc/tutorial/doxyfile_tuto.local: new doxyfile. Generate only the
diff --git a/milena/mln/all.hh b/milena/mln/all.hh
index f9f16d0..879cd94 100644
--- a/milena/mln/all.hh
+++ b/milena/mln/all.hh
@@ -60,6 +60,7 @@
#include <mln/metal/all.hh>
#include <mln/morpho/all.hh>
#include <mln/norm/all.hh>
+#include <mln/opt/all.hh>
#include <mln/pw/all.hh>
#include <mln/set/all.hh>
#include <mln/tag/all.hh>
diff --git a/milena/mln/canvas/morpho/algebraic_filter.hh
b/milena/mln/canvas/morpho/algebraic_filter.hh
index 460bc44..bfcf55e 100644
--- a/milena/mln/canvas/morpho/algebraic_filter.hh
+++ b/milena/mln/canvas/morpho/algebraic_filter.hh
@@ -45,7 +45,7 @@
# include <mln/level/sort_psites.hh>
# include <mln/level/sort_offsets.hh>
-
+# include <mln/canvas/morpho/internal/find_root.hh>
namespace mln
{
@@ -81,17 +81,6 @@ namespace mln
namespace generic
{
- template <typename I>
- inline
- mln_psite(I)
- find_root(I& parent, const mln_psite(I)& x)
- {
- if (parent(x) == x)
- return x;
- else
- return parent(x) = find_root(parent, parent(x));
- }
-
template <typename I, typename N, typename S, typename A>
inline
mln_concrete(I)
@@ -205,18 +194,6 @@ namespace mln
// Fastest version.
-
- template <typename I>
- inline
- unsigned
- find_root_fastest(I& parent, unsigned x)
- {
- if (parent.element(x) == 0)
- return x;
- else
- return parent.element(x) = find_root_fastest(parent, parent.element(x));
- }
-
template <typename I, typename N, typename A>
inline
mln_concrete(I)
diff --git a/milena/mln/canvas/morpho/algebraic_union_find.hh
b/milena/mln/canvas/morpho/algebraic_union_find.hh
index a19ace8..75ac3f6 100644
--- a/milena/mln/canvas/morpho/algebraic_union_find.hh
+++ b/milena/mln/canvas/morpho/algebraic_union_find.hh
@@ -41,6 +41,7 @@
# include <mln/data/fill.hh>
# include <mln/util/pix.hh>
+# include <mln/canvas/morpho/internal/find_root.hh>
namespace mln
{
@@ -69,17 +70,6 @@ namespace mln
namespace generic
{
- template <typename I>
- inline
- mln_psite(I)
- find_root(I& parent, const mln_psite(I)& x)
- {
- if (parent(x) == x)
- return x;
- else
- return parent(x) = find_root(parent, parent(x));
- }
-
template <typename I, typename N, typename F>
inline
mln_concrete(I)
@@ -219,17 +209,6 @@ namespace mln
// Fastest version.
- template <typename I>
- inline
- unsigned
- find_root_fastest(I& parent, unsigned x)
- {
- if (parent.element(x) == x)
- return x;
- else
- return parent.element(x) = find_root_fastest(parent, parent.element(x));
- }
-
template <typename I, typename N, typename F>
inline
diff --git a/milena/mln/canvas/morpho/all.hh b/milena/mln/canvas/morpho/all.hh
index d3847db..5720829 100644
--- a/milena/mln/canvas/morpho/all.hh
+++ b/milena/mln/canvas/morpho/all.hh
@@ -46,8 +46,10 @@ namespace mln
}
+# include <mln/canvas/morpho/internal/find_root.hh>
# include <mln/canvas/morpho/algebraic_filter.hh>
# include <mln/canvas/morpho/algebraic_union_find.hh>
+//# include <mln/canvas/morpho/connected_filter.hh>
#endif // ! MLN_CANVAS_MORPHO_ALL_HH
diff --git a/milena/mln/canvas/morpho/connected_filter.hh
b/milena/mln/canvas/morpho/connected_filter.hh
index beec8e4..d092a08 100644
--- a/milena/mln/canvas/morpho/connected_filter.hh
+++ b/milena/mln/canvas/morpho/connected_filter.hh
@@ -32,7 +32,8 @@
/// \file mln/canvas/morpho/connected_filter.hh
///
/// Connected filters dispatch (algebraic & leveling filters).
-///
+
+
# include <mln/core/concept/image.hh>
# include <mln/core/concept/neighborhood.hh>
# include <mln/core/concept/accumulator.hh>
@@ -42,6 +43,9 @@
# include <mln/level/sort_psites.hh>
# include <mln/level/sort_offsets.hh>
+# include <mln/util/pix.hh>
+
+# include <mln/data/fill.hh>
namespace mln {
namespace canvas {
@@ -181,9 +185,9 @@ namespace mln {
// Initialization.
{
initialize(deja_vu, input);
- mln::data::fill(deja_vu, false);
+ data::fill(deja_vu, false);
initialize(activity, input);
- mln::data::fill(activity, true);
+ data::fill(activity, true);
initialize(parent, input);
initialize(data, input);
//a.init(); // init required.
@@ -304,11 +308,11 @@ namespace mln {
// Initialization.
{
initialize(deja_vu, input);
- mln::data::fill(deja_vu, false);
+ data::fill(deja_vu, false);
initialize(activity, input);
- mln::data::fill(activity, true);
+ data::fill(activity, true);
initialize(parent, input);
- mln::data::fill(parent, 0);
+ data::fill(parent, 0);
initialize(data, input);
}
@@ -506,7 +510,7 @@ namespace mln {
template <typename I, typename N, typename A>
inline
mln_concrete(I)
- connected_filter_dispatch(mln::trait::accumulator::when_pix::use_none,
+ connected_filter_dispatch(trait::accumulator::when_pix::use_none,
const Image<I>& input,
const Neighborhood<N>& nbh,
const Accumulator<A>& a,
@@ -519,7 +523,7 @@ namespace mln {
template <typename I, typename N, typename A>
inline
mln_concrete(I)
- connected_filter_dispatch(mln::trait::accumulator::when_pix::use_p,
+ connected_filter_dispatch(trait::accumulator::when_pix::use_p,
const Image<I>& input,
const Neighborhood<N>& nbh,
const Accumulator<A>& a,
@@ -532,7 +536,7 @@ namespace mln {
template <typename I, typename N, typename A>
inline
mln_concrete(I)
- connected_filter_dispatch(mln::trait::accumulator::when_pix::use_v,
+ connected_filter_dispatch(trait::accumulator::when_pix::use_v,
const Image<I>& input,
const Neighborhood<N>& nbh,
const Accumulator<A>& a,
@@ -545,7 +549,7 @@ namespace mln {
template <typename I, typename N, typename A>
inline
mln_concrete(I)
- connected_filter_dispatch(mln::trait::accumulator::when_pix::use_pix,
+ connected_filter_dispatch(trait::accumulator::when_pix::use_pix,
const Image<I>& input,
const Neighborhood<N>& nbh,
const Accumulator<A>& a,
diff --git a/milena/mln/canvas/morpho/all.hh
b/milena/mln/canvas/morpho/internal/find_root.hh
similarity index 51%
copy from milena/mln/canvas/morpho/all.hh
copy to milena/mln/canvas/morpho/internal/find_root.hh
index d3847db..8011122 100644
--- a/milena/mln/canvas/morpho/all.hh
+++ b/milena/mln/canvas/morpho/internal/find_root.hh
@@ -1,5 +1,4 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
-// Laboratory (LRDE)
+// Copyright (C) 2009 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
@@ -26,28 +25,76 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CANVAS_MORPHO_ALL_HH
-# define MLN_CANVAS_MORPHO_ALL_HH
+#ifndef MLN_CANVAS_MORPHO_FIND_ROOT_HH
+# define MLN_CANVAS_MORPHO_FIND_ROOT_HH
-/// \file mln/canvas/morpho/all.hh
+/// \file mln/canvas/morpho/internal/find_root.hh.hh
///
-/// File that includes morphological canvas-related routines.
-
+/// Routines to handle parent image.
+///
+/// \todo write a 'parent' image instead?
namespace mln
{
+
namespace canvas
{
- /// Namespace of morphological canvas.
- namespace morpho {}
+ namespace morpho
+ {
+
+ namespace internal
+ {
+
+ template <typename I>
+ inline
+ mln_psite(I)
+ find_root(I& parent, const mln_psite(I)& x);
+
+
+ template <typename I>
+ inline
+ unsigned
+ find_root_fastest(I& parent, unsigned x);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ template <typename I>
+ inline
+ mln_psite(I)
+ find_root(I& parent, const mln_psite(I)& x)
+ {
+ if (parent(x) == x)
+ return x;
+ else
+ return parent(x) = find_root(parent, parent(x));
+ }
+
+
+ template <typename I>
+ inline
+ unsigned
+ find_root_fastest(I& parent, unsigned x)
+ {
+ if (parent.element(x) == 0)
+ return x;
+ else
+ return parent.element(x) = find_root_fastest(parent,
+ parent.element(x));
+ }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::canvas::morpho::internal
- }
-}
+ } // end of namespace mln::canvas::morpho
+ } // end of namespace mln::canvas
-# include <mln/canvas/morpho/algebraic_filter.hh>
-# include <mln/canvas/morpho/algebraic_union_find.hh>
+} // end of namespace mln
+#endif // ! MLN_CANVAS_MORPHO_FIND_ROOT_HH
-#endif // ! MLN_CANVAS_MORPHO_ALL_HH
diff --git a/milena/mln/core/image/extension_fun.hh
b/milena/mln/core/image/extension_fun.hh
index 0cd09b6..67e5bb4 100644
--- a/milena/mln/core/image/extension_fun.hh
+++ b/milena/mln/core/image/extension_fun.hh
@@ -267,17 +267,6 @@ namespace mln
target = model.extension();
}
- template <typename I, typename F>
- extension_fun<I,F>
- extended_with(Image<I>& ima, const Function_v2v<F>& f)
- {
- mlc_not_equal(mln_trait_image_ext_domain(I),
- trait::image::ext_domain::none)::check();
- mln_precondition(exact(ima).is_valid());
- extension_fun<I,F> tmp(exact(ima), exact(f));
- return tmp;
- }
-
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln
diff --git a/milena/mln/core/image/extension_ima.hh
b/milena/mln/core/image/extension_ima.hh
index 98360b4..91055dd 100644
--- a/milena/mln/core/image/extension_ima.hh
+++ b/milena/mln/core/image/extension_ima.hh
@@ -268,19 +268,6 @@ namespace mln
target_ = ext_;
}
-
- template <typename I, typename J>
- extension_ima<I,J>
- extended_with(Image<I>& ima, const Image<J> ext)
- {
- mlc_not_equal(mln_trait_image_ext_domain(I),
- trait::image::ext_domain::none)::check();
- mln_precondition(exact(ima).is_valid());
- mln_precondition(exact(ext).is_valid());
- extension_ima<I,J> tmp(exact(ima), exact(ext));
- return tmp;
- }
-
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln
diff --git a/milena/mln/core/image/extension_val.hh
b/milena/mln/core/image/extension_val.hh
index 9dbfadc..63dbeb7 100644
--- a/milena/mln/core/image/extension_val.hh
+++ b/milena/mln/core/image/extension_val.hh
@@ -268,17 +268,6 @@ namespace mln
target = static_cast<V>(model.extension());
}
- template <typename I>
- extension_val<I>
- extended_with(Image<I>& ima, const mln_value(I)& val)
- {
- mlc_not_equal(mln_trait_image_ext_domain(I),
- trait::image::ext_domain::none)::check();
- mln_precondition(exact(ima).is_valid());
- extension_val<I> tmp(exact(ima), val);
- return tmp;
- }
-
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln
diff --git a/milena/mln/essential/routine.hh b/milena/mln/essential/routine.hh
index ba164b4..434519f 100644
--- a/milena/mln/essential/routine.hh
+++ b/milena/mln/essential/routine.hh
@@ -57,6 +57,7 @@
# include <mln/metal/essential.hh>
# include <mln/morpho/essential.hh>
# include <mln/norm/essential.hh>
+# include <mln/opt/essential.hh>
# include <mln/pw/essential.hh>
# include <mln/registration/essential.hh>
# include <mln/set/essential.hh>
diff --git a/milena/mln/value/label.hh b/milena/mln/value/label.hh
index ceabea5..53c3d60 100644
--- a/milena/mln/value/label.hh
+++ b/milena/mln/value/label.hh
@@ -275,10 +275,11 @@ namespace mln
return ostr << debug::format(i.to_equiv());
}
-# endif // ! MLN_INCLUDE_ONLY
-
} // end of namespace mln::value
+
+# endif // ! MLN_INCLUDE_ONLY
+
} // end of namespace mln
diff --git a/milena/mln/value/rgb.hh b/milena/mln/value/rgb.hh
index 2bd1b8b..2d13f94 100644
--- a/milena/mln/value/rgb.hh
+++ b/milena/mln/value/rgb.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2007, 2008, 2009 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
@@ -725,8 +726,6 @@ namespace mln
return istr >> c.red() >> c.green() >> c.blue();
}
-# endif // ! MLN_INCLUDE_ONLY
-
} // end of namespace mln::value
@@ -792,5 +791,7 @@ namespace mln
} // end of namespace mln
+# endif // ! MLN_INCLUDE_ONLY
+
#endif // ! MLN_VALUE_RGB_HH
diff --git a/milena/tests/registration/registration.cc
b/milena/tests/registration/registration.cc
index 4129b5b..9433f5a 100644
--- a/milena/tests/registration/registration.cc
+++ b/milena/tests/registration/registration.cc
@@ -54,6 +54,10 @@ int main()
typedef p_array<point3d> arr_t;
arr_t arr1 = convert::to<arr_t>(img1);
arr_t arr2 = convert::to<arr_t>(img2);
- registration::registration1(arr1,arr2);
+
+ box3d bbox = img2.bbox();
+ bbox.enlarge(1, 10);
+ bbox.enlarge(2, 10);
+ registration::registration1(bbox, arr1, arr2);
//FIXME: Auto test result
}
diff --git a/milena/tests/util/Makefile.am b/milena/tests/util/Makefile.am
index f6b4306..b348587 100644
--- a/milena/tests/util/Makefile.am
+++ b/milena/tests/util/Makefile.am
@@ -13,6 +13,7 @@ check_PROGRAMS = \
lemmings \
line_graph \
ord_pair \
+ set \
soft_heap \
tree \
tree_fast \
@@ -29,6 +30,7 @@ lazy_set_SOURCES = lazy_set.cc
lemmings_SOURCES = lemmings.cc
line_graph_SOURCES = line_graph.cc
ord_pair_SOURCES = ord_pair.cc
+set_SOURCES = set.cc
soft_heap_SOURCES = soft_heap.cc
tree_SOURCES = tree.cc
tree_fast_SOURCES = tree_fast.cc
diff --git a/milena/tests/util/set.cc b/milena/tests/util/set.cc
index 7dc23ef..f97449f 100644
--- a/milena/tests/util/set.cc
+++ b/milena/tests/util/set.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory
+// Copyright (C) 2008, 2009 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
@@ -25,12 +25,10 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*!
- * \file tests/util/set.cc
- *
- * \brief test of mln::util::set
- *
- */
+///
+/// \file tests/util/set.cc
+///
+/// test of mln::util::set
#include <mln/util/set.hh>
--
1.5.6.5