
https://svn.lrde.epita.fr/svn/oln/trunk/milena Index: ChangeLog from Thierry Geraud <thierry.geraud@lrde.epita.fr> Update tests on morpho compute parent tree. * tests/core/site_set/p_vaccess.cc: Layout. * tests/morpho/tree/compute_parent.cc (main): Re-activate code and use a relevant image. (include): Update. * tests/morpho/tree/data.cc: Likewise. * mln/core/site_set/p_vaccess.hh: Update doc style. (pset): New typedef. (t_eligible_values_set): Fix missing typedef required by value iterators. * img/fly.pgm: New. img/fly.pgm | 5 +++++ mln/core/site_set/p_vaccess.hh | 11 +++++++---- tests/core/site_set/p_vaccess.cc | 1 + tests/morpho/tree/compute_parent.cc | 32 +++++++++++++------------------- tests/morpho/tree/data.cc | 17 +++++++---------- 5 files changed, 33 insertions(+), 33 deletions(-) Index: tests/core/site_set/p_vaccess.cc --- tests/core/site_set/p_vaccess.cc (revision 2965) +++ tests/core/site_set/p_vaccess.cc (working copy) @@ -58,6 +58,7 @@ if (s(v).nsites() == 0) continue; std::cout << int(v) << ": "; + mln_piter_(Arr) p(s(v)); for_all(p) std::cout << p << ' '; Index: tests/morpho/tree/compute_parent.cc --- tests/morpho/tree/compute_parent.cc (revision 2965) +++ tests/morpho/tree/compute_parent.cc (working copy) @@ -31,13 +31,13 @@ #include <mln/core/image/image2d.hh> #include <mln/core/alias/neighb2d.hh> - -#include <mln/debug/println.hh> -#include <mln/debug/iota.hh> - #include <mln/core/var.hh> #include <mln/core/image/image_if.hh> +#include <mln/core/site_set/p_array.hh> + +#include <mln/level/sort_psites.hh> #include <mln/pw/value.hh> +#include <mln/debug/println.hh> #include <mln/morpho/tree/compute_parent.hh> @@ -55,26 +55,20 @@ debug::println(sub); mln_VAR(par, morpho::tree::compute_parent(sub, c4(), sub.domain())); - debug::println(par); + debug::println("par =", par); } -/* - { - image2d<unsigned> ima(3, 3); - debug::iota(ima); - debug::println(ima); - - debug::println( morpho::tree::compute_parent(ima, c4(), ima.domain()) ); - } - - { - image2d<unsigned> ima(3, 3); - level::fill(ima, 0); + unsigned char vals[] = { 3, 2, 1, + 3, 2, 3, + 3, 4, 1 }; + image2d<unsigned char> ima = make::image2d(vals); debug::println(ima); - debug::println( morpho::tree::compute_parent(ima, c4(), ima.domain()) ); + typedef p_array<point2d> S; + S s = level::sort_psites_increasing(ima); + mln_VAR(par, morpho::tree::compute_parent(ima, c4(), s)); + debug::println("par =", par); } -*/ } Index: tests/morpho/tree/data.cc --- tests/morpho/tree/data.cc (revision 2965) +++ tests/morpho/tree/data.cc (working copy) @@ -31,14 +31,10 @@ #include <mln/core/image/image2d.hh> #include <mln/core/alias/neighb2d.hh> -#include <mln/pw/image.hh> - -#include <mln/debug/println.hh> -#include <mln/debug/iota.hh> -#include <mln/morpho/elementary/dilation.hh> - #include <mln/core/site_set/p_array.hh> + #include <mln/level/sort_psites.hh> +#include <mln/debug/println.hh> #include <mln/morpho/tree/data.hh> @@ -47,11 +43,12 @@ { using namespace mln; - typedef image2d<unsigned> I; - I ima(3, 3); - debug::iota(ima); + typedef image2d<unsigned char> I; + unsigned char vals[] = { 3, 2, 1, + 3, 2, 3, + 3, 4, 1 }; + I ima = make::image2d(vals); - ima = morpho::elementary::dilation(ima, c8()); debug::println("ima = ", ima); typedef p_array<point2d> S; Index: mln/core/site_set/p_vaccess.hh --- mln/core/site_set/p_vaccess.hh (revision 2965) +++ mln/core/site_set/p_vaccess.hh (working copy) @@ -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,10 +29,9 @@ #ifndef MLN_CORE_SITE_SET_P_VACCESS_HH # define MLN_CORE_SITE_SET_P_VACCESS_HH -/*! \file mln/core/site_set/p_vaccess.hh - * - * \todo Fix the FIXMEs. - */ +/// \file mln/core/site_set/p_vaccess.hh +/// +/// \todo Fix the FIXMEs. # include <utility> # include <mln/core/site_set/p_double.hh> @@ -81,7 +81,10 @@ /// Value_Set associated type. typedef mln::value::set<V> vset; + typedef vset t_eligible_values_set; // FIXME: Required by value set iterators... + /// Inner site set associated type. + typedef S pset; /// Psite associated type. typedef p_double_psite<self_, S> psite; Index: img/fly.pgm --- img/fly.pgm (revision 0) +++ img/fly.pgm (revision 0) @@ -0,0 +1,5 @@ +P5 +# CREATOR: GIMP PNM Filter Version 1.1 +5 5 +255 +�|��jt���uuZ�l�kWvm�kI}�u \ No newline at end of file