Commit 71e317d4 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

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.

git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@3420 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 4887a2e3
2009-02-24 Guillaume Lazzara <z@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@lrde.epita.fr>
 
Update tutorial.
......@@ -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>
......
......@@ -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)
......
......@@ -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
......
......@@ -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
......@@ -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,
......
// 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
// 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_CANVAS_MORPHO_FIND_ROOT_HH
# define MLN_CANVAS_MORPHO_FIND_ROOT_HH
/// \file mln/canvas/morpho/internal/find_root.hh.hh
///
/// Routines to handle parent image.
///
/// \todo write a 'parent' image instead?
namespace mln
{
namespace canvas
{
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
} // end of namespace mln
#endif // ! MLN_CANVAS_MORPHO_FIND_ROOT_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
......
......@@ -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
......
......@@ -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
......
......@@ -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>
......
......@@ -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
......
// 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
......@@ -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
}
......@@ -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
......
// 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>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment