
* mln/make/attachment.hh, * mln/make/cell.hh, * mln/make/detachment.hh, * mln/topo/detach_cell.hh: Do not require the face passed as argument to be a facet. --- milena/ChangeLog | 10 ++++++++++ milena/mln/make/attachment.hh | 15 +++++---------- milena/mln/make/cell.hh | 11 ++--------- milena/mln/make/detachment.hh | 17 ++++++----------- milena/mln/topo/detach_cell.hh | 14 ++++---------- 5 files changed, 27 insertions(+), 40 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index a4a1345..6b55e2a 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,15 @@ 2011-02-24 Roland Levillain <roland@lrde.epita.fr> + Revamp topology-related routines. + + * mln/make/attachment.hh, + * mln/make/cell.hh, + * mln/make/detachment.hh, + * mln/topo/detach_cell.hh: + Do not require the face passed as argument to be a facet. + +2011-02-24 Roland Levillain <roland@lrde.epita.fr> + Make the interface of thinning algorithms uniform w.r.t. functors. * mln/topo/skeleton/priority_driven_thinning.hh diff --git a/milena/mln/make/attachment.hh b/milena/mln/make/attachment.hh index 63eca65..8247afe 100644 --- a/milena/mln/make/attachment.hh +++ b/milena/mln/make/attachment.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -32,7 +33,6 @@ # include <mln/core/image/complex_image.hh> # include <mln/make/cell.hh> -# include <mln/topo/is_facet.hh> namespace mln { @@ -41,10 +41,10 @@ namespace mln { /** \brief Compute the attachment of the cell corresponding to the - facet \a f to the image \a ima. + face \a f to the image \a ima. - \param ima The input image to which the facet is attached. - \param f The psite corresponding to the attached facet. + \param ima The input image to which the face is attached. + \param f The psite corresponding to the attached face. \param nbh An adjacency relationship between faces (should return the set of (n-1)- and (n+1)-faces adjacent to an n-face). @@ -52,8 +52,6 @@ namespace mln \return A set of faces containing the attachment. \pre ima is an image of Boolean values. - \pre \a f is a facet (it does not belong to any face of higher - dimension). We do not use the fomal definition of the attachment here (see couprie.08.pami). We use the following (equivalent) definition: @@ -74,9 +72,6 @@ namespace mln attachment(const Image<I>& ima_, const mln_psite(I)& f, const Neighborhood<N>& nbh_) { - // FIXME: The current implementation of topo::is_facet is too - // naive: it does not take the values of the image into account. - mln_precondition(topo::is_facet(f)); mlc_equal(mln_value(I), bool)::check(); I ima = exact(ima_); diff --git a/milena/mln/make/cell.hh b/milena/mln/make/cell.hh index 44c34ae..f873cbb 100644 --- a/milena/mln/make/cell.hh +++ b/milena/mln/make/cell.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2009, 2011 EPITA Research and Development Laboratory (LRDE) // // This file is part of Olena. // @@ -34,8 +34,6 @@ # include <mln/core/image/complex_neighborhoods.hh> # include <mln/core/image/complex_neighborhood_piter.hh> -# include <mln/topo/is_facet.hh> - namespace mln { @@ -43,10 +41,7 @@ namespace mln { /** Compute the set of faces of the cell corresponding to the - facet \a f. - - \pre \a f is a facet (it does not belong to any face of higher - dimension). + face \a f. \return An mln::p_set of sites (faces) containing the attachment. */ @@ -62,8 +57,6 @@ namespace mln p_set< complex_psite<D, G> > cell(const complex_psite<D, G>& f) { - mln_precondition(topo::is_facet(f)); - typedef complex_psite<D, G> psite; typedef p_set<psite> faces_t; diff --git a/milena/mln/make/detachment.hh b/milena/mln/make/detachment.hh index 88b70a0..8feff54 100644 --- a/milena/mln/make/detachment.hh +++ b/milena/mln/make/detachment.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -32,7 +33,6 @@ # include <mln/core/image/complex_image.hh> # include <mln/make/cell.hh> -# include <mln/topo/is_facet.hh> namespace mln { @@ -41,19 +41,17 @@ namespace mln { /** \brief Compute the detachment of the cell corresponding to the - facet \a f from the image \a ima. + face \a f from the image \a ima. - \param ima The input image from which the facet is to be + \param ima The input image from which the face is to be detached. - \param f The psite corresponding to the facet to detach. + \param f The psite corresponding to the face to detach. \param nbh An adjacency relationship between faces (should return the set of (n-1)- and (n+1)-faces adjacent to an n-face). \return A set of faces containing the detachment. - \pre \a f is a facet (it does not belong to any face of higher - dimension). \pre \a ima is an image of Boolean values. We do not use the fomal definition of the detachment here (see @@ -66,7 +64,7 @@ namespace mln complex resulting from the collapsing of CELL onto IMA, but the part that is removed, i.e., the detached part CELL - ATTACHMENT. It would be wise to rename this routine to - something else. */ + something else, e.g., `detached'. */ template <typename I, typename N> p_set<mln_psite(I)> detachment(const Image<I>& ima, const mln_psite(I)& f, @@ -81,9 +79,6 @@ namespace mln detachment(const Image<I>& ima_, const mln_psite(I)& f, const Neighborhood<N>& nbh_) { - // FIXME: The current implementation of topo::is_facet is too - // naive: it does not take the values of the image into account. - mln_precondition(topo::is_facet(f)); mlc_equal(mln_value(I), bool)::check(); I ima = exact(ima_); diff --git a/milena/mln/topo/detach_cell.hh b/milena/mln/topo/detach_cell.hh index 250babf..761142e 100644 --- a/milena/mln/topo/detach_cell.hh +++ b/milena/mln/topo/detach_cell.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2009, 2010, 2011 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of Olena. // @@ -32,7 +33,6 @@ # include <mln/core/site_set/p_set.hh> # include <mln/core/image/complex_image.hh> # include <mln/make/detachment.hh> -# include <mln/topo/is_facet.hh> namespace mln { @@ -65,7 +65,7 @@ namespace mln \pre \a ima is an image of Boolean values. - \param ima The input image from which the facet is to be + \param ima The input image from which the cell is to be detached. \param nbh An adjacency relationship between faces (should return the set of (n-1)- and (n+1)-faces @@ -82,10 +82,7 @@ namespace mln /** Detach the cell corresponding to \a f from \a ima. - \pre \a f is a facet (it does not belong to any face of - higher dimension). - - \param f The psite corresponding to the facet to detach. + \param f The psite corresponding to the cell to detach. \param nbh An adjacency relationship between faces (should return the set of (n-1)- and (n+1)-faces adjacent to an n-face). */ @@ -131,9 +128,6 @@ namespace mln detach_cell<I, N>::operator()(const mln_psite(I)& f) { mln_precondition(ima_); - // FIXME: The current implementation of topo::is_facet is too - // naive: it does not take the values of the image into account. - mln_precondition(topo::is_facet(f)); typedef p_set<mln_psite(I)> faces_t; -- 1.5.6.5