3296: Add is_valid() to window and neighborhood.

* mln/core/internal/neighborhood_base.hh, * mln/core/internal/window_base.hh: add is_valid() * mln/accu/transform.hh, * mln/accu/transform_diagonal.hh, * mln/accu/transform_directional.hh, * mln/accu/transform_snake.hh, * mln/accu/transform_stop.hh, * mln/canvas/distance_front.hh, * mln/canvas/distance_geodesic.hh, * mln/canvas/labeling.hh, * mln/convert/to_image.hh, * mln/core/concept/neighborhood.hh, * mln/core/concept/window.hh, * mln/core/w_window.hh, * mln/geom/delta.hh, * mln/labeling/background.hh, * mln/labeling/foreground.hh, * mln/labeling/level.hh, * mln/level/median.hh, * mln/linear/convolve.hh, * mln/morpho/elementary/closing.hh, * mln/morpho/elementary/dilation.hh, * mln/morpho/elementary/erosion.hh, * mln/morpho/elementary/gradient.hh, * mln/morpho/elementary/gradient_external.hh, * mln/morpho/elementary/gradient_internal.hh, * mln/morpho/elementary/laplacian.hh, * mln/morpho/elementary/opening.hh, * mln/morpho/elementary/top_hat.hh, * mln/morpho/general.hh, * mln/morpho/tree/compute_parent.hh, * mln/morpho/tree/max.hh, * mln/transform/distance_front.hh, * mln/transform/distance_geodesic.hh, * mln/transform/influence_zone_front.hh, * mln/transform/influence_zone_geodesic.hh, * mln/win/sym.hh: enable preconditions. --- milena/ChangeLog | 43 +++++++++++++++++++++ milena/mln/accu/transform.hh | 25 ++++++------ milena/mln/accu/transform_diagonal.hh | 5 +- milena/mln/accu/transform_directional.hh | 5 +- milena/mln/accu/transform_snake.hh | 5 +- milena/mln/accu/transform_stop.hh | 21 +++++----- milena/mln/canvas/distance_front.hh | 5 +- milena/mln/canvas/distance_geodesic.hh | 5 +- milena/mln/canvas/labeling.hh | 6 +- milena/mln/convert/to_image.hh | 6 +- milena/mln/core/concept/neighborhood.hh | 2 +- milena/mln/core/concept/window.hh | 10 ++--- milena/mln/core/internal/neighborhood_base.hh | 10 +++++ milena/mln/core/internal/window_base.hh | 29 ++++++++++---- milena/mln/core/w_window.hh | 2 +- milena/mln/geom/delta.hh | 8 ++-- milena/mln/labeling/background.hh | 2 +- milena/mln/labeling/foreground.hh | 2 +- milena/mln/labeling/level.hh | 2 +- milena/mln/level/median.hh | 6 +- milena/mln/linear/convolve.hh | 6 +- milena/mln/morpho/elementary/closing.hh | 12 +++--- milena/mln/morpho/elementary/dilation.hh | 7 ++- milena/mln/morpho/elementary/erosion.hh | 4 +- milena/mln/morpho/elementary/gradient.hh | 4 +- milena/mln/morpho/elementary/gradient_external.hh | 7 ++- milena/mln/morpho/elementary/gradient_internal.hh | 7 ++- milena/mln/morpho/elementary/laplacian.hh | 5 +- milena/mln/morpho/elementary/opening.hh | 12 +++--- milena/mln/morpho/elementary/top_hat.hh | 20 +++++----- milena/mln/morpho/general.hh | 2 +- milena/mln/morpho/tree/compute_parent.hh | 2 +- milena/mln/morpho/tree/max.hh | 2 +- milena/mln/transform/distance_front.hh | 4 +- milena/mln/transform/distance_geodesic.hh | 2 +- milena/mln/transform/influence_zone_front.hh | 4 +- milena/mln/transform/influence_zone_geodesic.hh | 2 +- milena/mln/win/sym.hh | 4 +- 38 files changed, 189 insertions(+), 116 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 5debdb3..772b56b 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,4 +1,47 @@ 2009-02-05 Guillaume Lazzara <z@lrde.epita.fr> + + Add is_valid() to window and neighborhood. + + * mln/core/internal/neighborhood_base.hh, + * mln/core/internal/window_base.hh: add is_valid() + + * mln/accu/transform.hh, + * mln/accu/transform_diagonal.hh, + * mln/accu/transform_directional.hh, + * mln/accu/transform_snake.hh, + * mln/accu/transform_stop.hh, + * mln/canvas/distance_front.hh, + * mln/canvas/distance_geodesic.hh, + * mln/canvas/labeling.hh, + * mln/convert/to_image.hh, + * mln/core/concept/neighborhood.hh, + * mln/core/concept/window.hh, + * mln/core/w_window.hh, + * mln/geom/delta.hh, + * mln/labeling/background.hh, + * mln/labeling/foreground.hh, + * mln/labeling/level.hh, + * mln/level/median.hh, + * mln/linear/convolve.hh, + * mln/morpho/elementary/closing.hh, + * mln/morpho/elementary/dilation.hh, + * mln/morpho/elementary/erosion.hh, + * mln/morpho/elementary/gradient.hh, + * mln/morpho/elementary/gradient_external.hh, + * mln/morpho/elementary/gradient_internal.hh, + * mln/morpho/elementary/laplacian.hh, + * mln/morpho/elementary/opening.hh, + * mln/morpho/elementary/top_hat.hh, + * mln/morpho/general.hh, + * mln/morpho/tree/compute_parent.hh, + * mln/morpho/tree/max.hh, + * mln/transform/distance_front.hh, + * mln/transform/distance_geodesic.hh, + * mln/transform/influence_zone_front.hh, + * mln/transform/influence_zone_geodesic.hh, + * mln/win/sym.hh: enable preconditions. + +2009-02-05 Guillaume Lazzara <z@lrde.epita.fr> Cleanup accu::rms. diff --git a/milena/mln/accu/transform.hh b/milena/mln/accu/transform.hh index f5f9096..b673549 100644 --- a/milena/mln/accu/transform.hh +++ b/milena/mln/accu/transform.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 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 @@ -47,13 +48,13 @@ namespace mln template <typename I, typename A, typename W> mln_ch_value(I, mln_result(A)) - transform(const Image<I>& input, + transform(const Image<I>& input, const Accumulator<A>& a, const Window<W>& win); template <typename I, typename A, typename W> mln_ch_value(I, mln_accu_with(A, mln_value(I))::result) - transform(const Image<I>& input, + transform(const Image<I>& input, const Meta_Accumulator<A>& a, const Window<W>& win); @@ -69,7 +70,7 @@ namespace mln namespace generic { - + template <typename I, typename A, typename W> mln_ch_value(I, mln_result(A)) transform(const Image<I>& input_, @@ -83,10 +84,10 @@ namespace mln A a = exact(a_); mln_precondition(input.is_valid()); - // mln_precondition(win.is_valid()); + mln_precondition(win.is_valid()); extension::adjust(input, win); - + mln_ch_value(I, mln_result(A)) output; initialize(output, input); @@ -106,7 +107,7 @@ namespace mln } // end of namespace mln::accu::impl::generic - + // Fastest version. template <typename I, typename A, typename W> @@ -120,10 +121,10 @@ namespace mln A a = exact(a_); mln_precondition(input.is_valid()); - // mln_precondition(win.is_valid()); + mln_precondition(win.is_valid()); extension::adjust(input, win); - + typedef mln_ch_value(I, mln_result(A)) O; O output; initialize(output, input); @@ -143,7 +144,7 @@ namespace mln return output; } - + } // end of namespace mln::accu::impl @@ -189,7 +190,7 @@ namespace mln trace::entering("accu::transform"); mln_precondition(exact(input).is_valid()); - // mln_precondition(exact(win).is_valid()); + mln_precondition(exact(win).is_valid()); mln_ch_value(I, mln_result(A)) output; output = internal::transform_dispatch(input, a, win); @@ -205,7 +206,7 @@ namespace mln trace::entering("accu::transform"); mln_precondition(exact(input).is_valid()); - // mln_precondition(exact(win).is_valid()); + mln_precondition(exact(win).is_valid()); typedef mln_accu_with(A, mln_value(I)) A_; A_ a_ = accu::unmeta(exact(a), mln_value(I)()); diff --git a/milena/mln/accu/transform_diagonal.hh b/milena/mln/accu/transform_diagonal.hh index 18d396b..c8788e6 100644 --- a/milena/mln/accu/transform_diagonal.hh +++ b/milena/mln/accu/transform_diagonal.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 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 @@ -90,7 +91,7 @@ namespace mln mln_precondition(input.is_valid()); mln_precondition(! win.is_empty()); - // mln_precondition(! win.is_valid()); + mln_precondition(! win.is_valid()); (void) input; (void) win; diff --git a/milena/mln/accu/transform_directional.hh b/milena/mln/accu/transform_directional.hh index 16f5dd0..6a78fcd 100644 --- a/milena/mln/accu/transform_directional.hh +++ b/milena/mln/accu/transform_directional.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 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 @@ -88,7 +89,7 @@ namespace mln mln_precondition(input.is_valid()); mln_precondition(! win.is_empty()); - // mln_precondition(! win.is_valid()); + mln_precondition(! win.is_valid()); (void) input; (void) win; diff --git a/milena/mln/accu/transform_snake.hh b/milena/mln/accu/transform_snake.hh index fa3da5b..98bcf93 100644 --- a/milena/mln/accu/transform_snake.hh +++ b/milena/mln/accu/transform_snake.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 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 @@ -83,7 +84,7 @@ namespace mln mln_precondition(input.is_valid()); mln_precondition(! win.is_empty()); - // mln_precondition(! win.is_valid()); + mln_precondition(! win.is_valid()); (void) input; (void) win; diff --git a/milena/mln/accu/transform_stop.hh b/milena/mln/accu/transform_stop.hh index 1978b32..bfbc3a4 100644 --- a/milena/mln/accu/transform_stop.hh +++ b/milena/mln/accu/transform_stop.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 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 @@ -65,7 +66,7 @@ namespace mln namespace generic { - + template <typename I, typename A, typename W> mln_ch_value(I, mln_result(A)) transform_stop(const Image<I>& input_, @@ -79,10 +80,10 @@ namespace mln A a = exact(a_); mln_precondition(input.is_valid()); - // mln_precondition(win.is_valid()); + mln_precondition(win.is_valid()); extension::adjust(input, win); - + mln_ch_value(I, mln_result(A)) output; initialize(output, input); @@ -106,7 +107,7 @@ namespace mln } // end of namespace mln::accu::impl::generic - + // Fastest version. template <typename I, typename A, typename W> @@ -120,10 +121,10 @@ namespace mln A a = exact(a_); mln_precondition(input.is_valid()); - // mln_precondition(win.is_valid()); + mln_precondition(win.is_valid()); extension::adjust(input, win); - + typedef mln_ch_value(I, mln_result(A)) O; O output; initialize(output, input); @@ -147,7 +148,7 @@ namespace mln return output; } - + } // end of namespace mln::accu::impl @@ -193,7 +194,7 @@ namespace mln trace::entering("accu::transform_stop"); mln_precondition(exact(input).is_valid()); - // mln_precondition(exact(win).is_valid()); + mln_precondition(exact(win).is_valid()); mln_ch_value(I, mln_result(A)) output; output = internal::transform_stop_dispatch(input, a, win); @@ -209,7 +210,7 @@ namespace mln trace::entering("accu::transform_stop"); mln_precondition(exact(input).is_valid()); - // mln_precondition(exact(win).is_valid()); + mln_precondition(exact(win).is_valid()); typedef mln_accu_with(A, mln_value(I)) A_; A_ a_ = accu::unmeta(exact(a), mln_value(I)()); diff --git a/milena/mln/canvas/distance_front.hh b/milena/mln/canvas/distance_front.hh index caefa91..ac02d2c 100644 --- a/milena/mln/canvas/distance_front.hh +++ b/milena/mln/canvas/distance_front.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 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 @@ -75,7 +76,7 @@ namespace mln const W& w_win = exact(w_win_); mln_precondition(input.is_valid()); - // mln_precondition(w_win.is_valid()); + mln_precondition(w_win.is_valid()); typedef mln_site(I) P; typedef std::vector<P> bucket_t; diff --git a/milena/mln/canvas/distance_geodesic.hh b/milena/mln/canvas/distance_geodesic.hh index 123bb24..f51e900 100644 --- a/milena/mln/canvas/distance_geodesic.hh +++ b/milena/mln/canvas/distance_geodesic.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 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 @@ -70,7 +71,7 @@ namespace mln const N& nbh = exact(nbh_); mln_precondition(input.is_valid()); - // mln_precondition(nbh.is_valid()); + mln_precondition(nbh.is_valid()); mln_ch_value(I, D) dmap; // Distance map is aux data. initialize(dmap, input); diff --git a/milena/mln/canvas/labeling.hh b/milena/mln/canvas/labeling.hh index c8a9e5c..cdd0b10 100644 --- a/milena/mln/canvas/labeling.hh +++ b/milena/mln/canvas/labeling.hh @@ -1,5 +1,5 @@ -// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory -// (LRDE) +// 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 @@ -70,7 +70,7 @@ namespace mln const N& nbh = exact(nbh_); mln_precondition(input.is_valid()); - // mln_precondition(nbh.is_valid()); + mln_precondition(nbh.is_valid()); (void) input; (void) nbh; diff --git a/milena/mln/convert/to_image.hh b/milena/mln/convert/to_image.hh index e71aeda..9be01d3 100644 --- a/milena/mln/convert/to_image.hh +++ b/milena/mln/convert/to_image.hh @@ -108,7 +108,7 @@ namespace mln to_image(const Window<W>& win) { mln_is_simple_window(W)::check(); - // mln_precondition(exact(win).is_valid()); + mln_precondition(exact(win).is_valid()); mln_image_from_grid(mln_site(W)::grid, bool) tmp; convert::from_to(win, tmp); return tmp; @@ -120,7 +120,7 @@ namespace mln to_image(const Weighted_Window<W>& w_win) { mln_is_simple_window(W)::check(); - // mln_precondition(exact(w_win).is_valid()); + mln_precondition(exact(w_win).is_valid()); mln_image_from_grid(mln_site(W)::grid, mln_weight(W)) tmp; convert::from_to(exact(w_win), tmp); return tmp; @@ -131,7 +131,7 @@ namespace mln mln_image_from_grid(mln_site(N)::grid, bool) to_image(const Neighborhood<N>& nbh) { - // mln_precondition(exact(nbh).is_valid()); + mln_precondition(exact(nbh).is_valid()); return to_image(exact(nbh).win()); } diff --git a/milena/mln/core/concept/neighborhood.hh b/milena/mln/core/concept/neighborhood.hh index f5df84a..5547865 100644 --- a/milena/mln/core/concept/neighborhood.hh +++ b/milena/mln/core/concept/neighborhood.hh @@ -152,7 +152,7 @@ namespace mln const I& ima = exact(ima_); const N& nbh = exact(nbh_); mln_precondition(ima.is_valid()); - // mln_precondition(nbh.is_valid()); + mln_precondition(nbh.is_valid()); return offsets_wrt(ima, nbh.win()); } diff --git a/milena/mln/core/concept/window.hh b/milena/mln/core/concept/window.hh index 3b4dfe5..64b05fe 100644 --- a/milena/mln/core/concept/window.hh +++ b/milena/mln/core/concept/window.hh @@ -1,5 +1,5 @@ -// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory -// (LRDE) +// 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 @@ -34,8 +34,6 @@ /// /// \todo Operator== should test if the cmp is possible. /// -/// \todo Add an is_valid() method. -/// /// \todo The is_centered() method could also exist when the window is /// not regular... @@ -327,7 +325,7 @@ namespace mln const I& ima = exact(ima_); const W& win = exact(win_); mln_precondition(ima.is_valid()); - // mln_precondition(win.is_valid()); + mln_precondition(win.is_valid()); util::array<int> arr; unsigned n = win.size(); @@ -357,7 +355,7 @@ namespace mln const W& win = exact(win_); I& ima = exact(ima_); - // mln_precondition(win.is_valid()); + mln_precondition(win.is_valid()); mln_precondition(! ima.is_valid()); // Hack (below) to avoid circular dependency. diff --git a/milena/mln/core/internal/neighborhood_base.hh b/milena/mln/core/internal/neighborhood_base.hh index 35349fc..210408e 100644 --- a/milena/mln/core/internal/neighborhood_base.hh +++ b/milena/mln/core/internal/neighborhood_base.hh @@ -133,6 +133,9 @@ namespace mln /// Site associated type. typedef mln_site(W) site; + /// Return true by default. + bool is_valid() const; + protected: neighborhood_base(); }; @@ -151,6 +154,13 @@ namespace mln { } + template <typename W, typename E> + inline + bool + neighborhood_base<W,E>::is_valid() const + { + return true; + } // neighborhood_impl diff --git a/milena/mln/core/internal/window_base.hh b/milena/mln/core/internal/window_base.hh index 68f9f83..3ab8664 100644 --- a/milena/mln/core/internal/window_base.hh +++ b/milena/mln/core/internal/window_base.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 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 @@ -28,10 +29,9 @@ #ifndef MLN_CORE_INTERNAL_WINDOW_BASE_HH # define MLN_CORE_INTERNAL_WINDOW_BASE_HH -/*! \file mln/core/internal/window_base.hh - * - * \brief Definition of a base class for window classes. - */ +/// \file mln/core/internal/window_base.hh +/// +/// Definition of a base class for window classes. # include <mln/core/concept/window.hh> @@ -43,10 +43,10 @@ namespace mln { - /*! A base class for window classes. - * - * \p D is a dpsite type. - */ + /// A base class for window classes. + /// + /// \p D is a dpsite type. + /// template <typename D, typename E> struct window_base : public Window<E> { @@ -64,6 +64,9 @@ namespace mln // This method is used in the neighborhood window-adapter. bool is_neighbable_() const; + /// return true by default. + bool is_valid() const; + protected: window_base(); }; @@ -80,6 +83,14 @@ namespace mln template <typename D, typename E> inline bool + window_base<D,E>::is_valid() const + { + return true; + } + + template <typename D, typename E> + inline + bool window_base<D,E>::is_neighbable_() const { return exact(this)->is_symmetric() && ! exact(this)->is_centered(); diff --git a/milena/mln/core/w_window.hh b/milena/mln/core/w_window.hh index ac55e2a..adacb7e 100644 --- a/milena/mln/core/w_window.hh +++ b/milena/mln/core/w_window.hh @@ -348,7 +348,7 @@ namespace mln I& ima = exact(ima_); mln_precondition(! ima.is_valid()); - // mln_precondition(w_win.is_valid()); + mln_precondition(w_win.is_valid()); ima.init_(geom::bbox(w_win)); { diff --git a/milena/mln/geom/delta.hh b/milena/mln/geom/delta.hh index dd7dac4..68afa31 100644 --- a/milena/mln/geom/delta.hh +++ b/milena/mln/geom/delta.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2008 EPITA Research and Development Laboratory +// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory // (LRDE) // // This file is part of the Olena Library. This library is free @@ -98,7 +98,7 @@ namespace mln template <typename W> unsigned delta(const Window<W>& win) { - // mln_precondition(exact(win).is_valid()); + mln_precondition(exact(win).is_valid()); return internal::delta_dispatch(mln_trait_window_support(W)(), mln_trait_window_definition(W)(), exact(win)); @@ -107,14 +107,14 @@ namespace mln template <typename W> unsigned delta(const Weighted_Window<W>& wwin) { - // mln_precondition(exact(wwin).is_valid()); + mln_precondition(exact(wwin).is_valid()); return delta(exact(wwin).win()); } template <typename N> unsigned delta(const Neighborhood<N>& nbh) { - // mln_precondition(exact(nbh).is_valid()); + mln_precondition(exact(nbh).is_valid()); return delta(exact(nbh).win()); } diff --git a/milena/mln/labeling/background.hh b/milena/mln/labeling/background.hh index 30187bd..14e48eb 100644 --- a/milena/mln/labeling/background.hh +++ b/milena/mln/labeling/background.hh @@ -77,7 +77,7 @@ namespace mln mlc_equal(mln_trait_image_kind(I), mln::trait::image::kind::binary)::check(); mln_precondition(exact(input).is_valid()); - // mln_precondition(exact(nbh).is_valid()); + mln_precondition(exact(nbh).is_valid()); mln_ch_value(I, L) output = labeling::level(input, false, nbh, nlabels); diff --git a/milena/mln/labeling/foreground.hh b/milena/mln/labeling/foreground.hh index b5a28e4..b86a718 100644 --- a/milena/mln/labeling/foreground.hh +++ b/milena/mln/labeling/foreground.hh @@ -77,7 +77,7 @@ namespace mln mlc_equal(mln_trait_image_kind(I), mln::trait::image::kind::binary)::check(); mln_precondition(exact(input).is_valid()); - // mln_precondition(exact(nbh).is_valid()); + mln_precondition(exact(nbh).is_valid()); mln_ch_value(I, L) output = labeling::level(input, true, nbh, nlabels); diff --git a/milena/mln/labeling/level.hh b/milena/mln/labeling/level.hh index 17850bc..563e9b9 100644 --- a/milena/mln/labeling/level.hh +++ b/milena/mln/labeling/level.hh @@ -79,7 +79,7 @@ namespace mln L& nlabels) { mln_precondition(exact(input).is_valid()); - // mln_precondition(exact(nbh).is_valid()); + mln_precondition(exact(nbh).is_valid()); (void) input; (void) val; diff --git a/milena/mln/level/median.hh b/milena/mln/level/median.hh index 29eaa99..4a5c3cd 100644 --- a/milena/mln/level/median.hh +++ b/milena/mln/level/median.hh @@ -1,5 +1,5 @@ -// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory -// (LRDE) +// 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 @@ -79,7 +79,7 @@ namespace mln median_tests(const Image<I>& input, const Window<W>& win) { mln_precondition(exact(input).is_valid()); - // mln_precondition(exact(win).is_valid()); + mln_precondition(exact(win).is_valid()); (void) input; (void) win; } diff --git a/milena/mln/linear/convolve.hh b/milena/mln/linear/convolve.hh index 1996f76..64779df 100644 --- a/milena/mln/linear/convolve.hh +++ b/milena/mln/linear/convolve.hh @@ -1,5 +1,5 @@ -// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory -// (LRDE) +// 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 @@ -75,7 +75,7 @@ namespace mln const Weighted_Window<W>& w_win) { mln_precondition(exact(input).is_valid()); - // mln_precondition(exact(w_win).is_valid()); + mln_precondition(exact(w_win).is_valid()); (void) input; (void) w_win; } diff --git a/milena/mln/morpho/elementary/closing.hh b/milena/mln/morpho/elementary/closing.hh index fef94c5..eb1b72f 100644 --- a/milena/mln/morpho/elementary/closing.hh +++ b/milena/mln/morpho/elementary/closing.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 @@ -28,10 +29,9 @@ #ifndef MLN_MORPHO_ELEMENTARY_CLOSING_HH # define MLN_MORPHO_ELEMENTARY_CLOSING_HH -/*! \file mln/morpho/elementary/closing.hh - * - * \brief Morphological elementary closing. - */ +/// \file mln/morpho/elementary/closing.hh +/// +/// Morphological elementary closing. # include <mln/morpho/elementary/erosion.hh> # include <mln/morpho/elementary/dilation.hh> @@ -62,7 +62,7 @@ namespace mln trace::entering("morpho::elementary::closing"); mln_precondition(exact(input).is_valid()); - // mln_precondition(exact(nbh).is_valid()); + mln_precondition(exact(nbh).is_valid()); mln_concrete(I) output = erosion(dilation(input, nbh), nbh); diff --git a/milena/mln/morpho/elementary/dilation.hh b/milena/mln/morpho/elementary/dilation.hh index 8488100..9b169aa 100644 --- a/milena/mln/morpho/elementary/dilation.hh +++ b/milena/mln/morpho/elementary/dilation.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2008 EPITA Research and Development Laboratory +// Copyright (C) 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 @@ -100,10 +101,10 @@ namespace mln trace::entering("morpho::elementary::dilation"); mln_precondition(exact(input).is_valid()); - // mln_precondition(exact(nbh).is_valid()); + mln_precondition(exact(nbh).is_valid()); mln_concrete(I) output = internal::dilation_dispatch(input, nbh); - + mln_postcondition(output >= input); trace::exiting("morpho::elementary::dilation"); return output; diff --git a/milena/mln/morpho/elementary/erosion.hh b/milena/mln/morpho/elementary/erosion.hh index 765dabe..b51a552 100644 --- a/milena/mln/morpho/elementary/erosion.hh +++ b/milena/mln/morpho/elementary/erosion.hh @@ -100,10 +100,10 @@ namespace mln trace::entering("morpho::elementary::erosion"); mln_precondition(exact(input).is_valid()); - // mln_precondition(exact(nbh).is_valid()); + mln_precondition(exact(nbh).is_valid()); mln_concrete(I) output = internal::erosion_dispatch(input, nbh); - + mln_postcondition(output <= input); trace::exiting("morpho::elementary::erosion"); return output; diff --git a/milena/mln/morpho/elementary/gradient.hh b/milena/mln/morpho/elementary/gradient.hh index 5c98801..9973afb 100644 --- a/milena/mln/morpho/elementary/gradient.hh +++ b/milena/mln/morpho/elementary/gradient.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2008 EPITA Research and Development Laboratory +// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory // (LRDE) // // This file is part of the Olena Library. This library is free @@ -62,7 +62,7 @@ namespace mln gradient_tests(const Image<I>& input, const Neighborhood<N>& nbh) { mln_precondition(exact(input).is_valid()); - // mln_precondition(exact(nbh).is_valid()); + mln_precondition(exact(nbh).is_valid()); (void) input; (void) nbh; } diff --git a/milena/mln/morpho/elementary/gradient_external.hh b/milena/mln/morpho/elementary/gradient_external.hh index 6403845..27056db 100644 --- a/milena/mln/morpho/elementary/gradient_external.hh +++ b/milena/mln/morpho/elementary/gradient_external.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2008 EPITA Research and Development Laboratory +// Copyright (C) 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 @@ -111,10 +112,10 @@ namespace mln trace::entering("morpho::elementary::gradient_external"); mln_precondition(exact(input).is_valid()); - // mln_precondition(exact(nbh).is_valid()); + mln_precondition(exact(nbh).is_valid()); mln_concrete(I) output = internal::gradient_external_dispatch(input, nbh); - + trace::exiting("morpho::elementary::gradient_external"); return output; } diff --git a/milena/mln/morpho/elementary/gradient_internal.hh b/milena/mln/morpho/elementary/gradient_internal.hh index 5bc3f3e..844daac 100644 --- a/milena/mln/morpho/elementary/gradient_internal.hh +++ b/milena/mln/morpho/elementary/gradient_internal.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2008 EPITA Research and Development Laboratory +// Copyright (C) 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 @@ -111,10 +112,10 @@ namespace mln trace::entering("morpho::elementary::gradient_internal"); mln_precondition(exact(input).is_valid()); - // mln_precondition(exact(nbh).is_valid()); + mln_precondition(exact(nbh).is_valid()); mln_concrete(I) output = internal::gradient_internal_dispatch(input, nbh); - + mln_postcondition(output <= input); trace::exiting("morpho::elementary::gradient_internal"); return output; diff --git a/milena/mln/morpho/elementary/laplacian.hh b/milena/mln/morpho/elementary/laplacian.hh index 87b0d92..974504c 100644 --- a/milena/mln/morpho/elementary/laplacian.hh +++ b/milena/mln/morpho/elementary/laplacian.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 @@ -66,7 +67,7 @@ namespace mln trace::entering("morpho::elementary::laplacian"); mln_precondition(exact(input).is_valid()); - // mln_precondition(exact(nbh).is_valid()); + mln_precondition(exact(nbh).is_valid()); mln_trait_op_minus_twice(mln_concrete(I)) output; output = gradient_external(input, nbh) - gradient_internal(input, nbh); diff --git a/milena/mln/morpho/elementary/opening.hh b/milena/mln/morpho/elementary/opening.hh index 9b19087..50e8df5 100644 --- a/milena/mln/morpho/elementary/opening.hh +++ b/milena/mln/morpho/elementary/opening.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 @@ -28,10 +29,9 @@ #ifndef MLN_MORPHO_ELEMENTARY_OPENING_HH # define MLN_MORPHO_ELEMENTARY_OPENING_HH -/*! \file mln/morpho/elementary/opening.hh - * - * \brief Morphological elementary opening. - */ +/// \file mln/morpho/elementary/opening.hh +/// +/// Morphological elementary opening. # include <mln/morpho/elementary/erosion.hh> # include <mln/morpho/elementary/dilation.hh> @@ -62,7 +62,7 @@ namespace mln trace::entering("morpho::elementary::opening"); mln_precondition(exact(input).is_valid()); - // mln_precondition(exact(nbh).is_valid()); + mln_precondition(exact(nbh).is_valid()); mln_concrete(I) output = dilation(erosion(input, nbh), nbh); diff --git a/milena/mln/morpho/elementary/top_hat.hh b/milena/mln/morpho/elementary/top_hat.hh index 4bce465..2f5423d 100644 --- a/milena/mln/morpho/elementary/top_hat.hh +++ b/milena/mln/morpho/elementary/top_hat.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 @@ -28,12 +29,11 @@ #ifndef MLN_MORPHO_ELEMENTARY_TOP_HAT_HH # define MLN_MORPHO_ELEMENTARY_TOP_HAT_HH -/*! \file mln/morpho/elementary/top_hat.hh - * - * \brief Morphological elementary top-hats. - * - * \todo Save memory. - */ +/// \file mln/morpho/elementary/top_hat.hh +/// +/// Morphological elementary top-hats. +/// +/// \todo Save memory. # include <mln/morpho/elementary/opening.hh> # include <mln/morpho/elementary/closing.hh> @@ -89,7 +89,7 @@ namespace mln { trace::entering("morpho::elementary::top_hat_white"); mln_precondition(exact(input).is_valid()); - // mln_precondition(exact(nbh).is_valid()); + mln_precondition(exact(nbh).is_valid()); mln_concrete(I) output = morpho::minus(input, opening(input, nbh)); @@ -107,7 +107,7 @@ namespace mln { trace::entering("morpho::elementary::top_hat_black"); mln_precondition(exact(input).is_valid()); - // mln_precondition(exact(nbh).is_valid()); + mln_precondition(exact(nbh).is_valid()); mln_concrete(I) output = morpho::minus(closing(input, nbh), input); @@ -125,7 +125,7 @@ namespace mln { trace::entering("morpho::elementary::top_hat_self_complementary"); mln_precondition(exact(input).is_valid()); - // mln_precondition(exact(nbh).is_valid()); + mln_precondition(exact(nbh).is_valid()); mln_concrete(I) output = morpho::minus(closing(input, nbh), opening(input, nbh)); diff --git a/milena/mln/morpho/general.hh b/milena/mln/morpho/general.hh index 5ece056..f4590ea 100644 --- a/milena/mln/morpho/general.hh +++ b/milena/mln/morpho/general.hh @@ -82,7 +82,7 @@ namespace mln mln_precondition(input.is_valid()); mln_precondition(! win.is_empty()); - // mln_precondition(win.is_valid()); + mln_precondition(win.is_valid()); (void) op; (void) input; diff --git a/milena/mln/morpho/tree/compute_parent.hh b/milena/mln/morpho/tree/compute_parent.hh index 7cfc1d6..3c33e81 100644 --- a/milena/mln/morpho/tree/compute_parent.hh +++ b/milena/mln/morpho/tree/compute_parent.hh @@ -92,7 +92,7 @@ namespace mln const S& s = exact(s_); mln_precondition(f.is_valid()); - // mln_precondition(nbh.is_valid()); + mln_precondition(nbh.is_valid()); mln_precondition(s == f.domain()); (void) f; diff --git a/milena/mln/morpho/tree/max.hh b/milena/mln/morpho/tree/max.hh index b904fff..24938f5 100644 --- a/milena/mln/morpho/tree/max.hh +++ b/milena/mln/morpho/tree/max.hh @@ -69,7 +69,7 @@ namespace mln const N& nbh = exact(nbh_); mln_precondition(f.is_valid()); - // mln_precondition(nbh.is_valid()); + mln_precondition(nbh.is_valid()); // For the max-tree, childhood maps "increasing level": p_array<mln_psite(I)> s = level::sort_psites_increasing(f); diff --git a/milena/mln/transform/distance_front.hh b/milena/mln/transform/distance_front.hh index 4e9feb9..6054aab 100644 --- a/milena/mln/transform/distance_front.hh +++ b/milena/mln/transform/distance_front.hh @@ -61,8 +61,8 @@ namespace mln trace::entering("transform::distance_front"); mln_precondition(exact(input).is_valid()); - // mln_precondition(exact(nbh).is_valid()); - // mln_precondition(exact(w_win).is_valid()); + mln_precondition(exact(nbh).is_valid()); + mln_precondition(exact(w_win).is_valid()); mln_ch_value(I, D) output; internal::distance_functor<I> f; diff --git a/milena/mln/transform/distance_geodesic.hh b/milena/mln/transform/distance_geodesic.hh index e076309..eb4bfa6 100644 --- a/milena/mln/transform/distance_geodesic.hh +++ b/milena/mln/transform/distance_geodesic.hh @@ -59,7 +59,7 @@ namespace mln trace::entering("transform::distance_geodesic"); mln_precondition(exact(input).is_valid()); - // mln_precondition(exact(nbh).is_valid()); + mln_precondition(exact(nbh).is_valid()); mln_ch_value(I, D) output; internal::distance_functor<I> f; diff --git a/milena/mln/transform/influence_zone_front.hh b/milena/mln/transform/influence_zone_front.hh index 014f5d6..55e7138 100644 --- a/milena/mln/transform/influence_zone_front.hh +++ b/milena/mln/transform/influence_zone_front.hh @@ -65,8 +65,8 @@ namespace mln trace::entering("transform::influence_zone_front"); mln_precondition(exact(input).is_valid()); - // mln_precondition(exact(nbh).is_valid()); - // mln_precondition(exact(w_win).is_valid()); + mln_precondition(exact(nbh).is_valid()); + mln_precondition(exact(w_win).is_valid()); internal::influence_zone_functor<I> f; (void) mln::canvas::distance_front(input, nbh, w_win, max, f); diff --git a/milena/mln/transform/influence_zone_geodesic.hh b/milena/mln/transform/influence_zone_geodesic.hh index ca8e56b..7a92cff 100644 --- a/milena/mln/transform/influence_zone_geodesic.hh +++ b/milena/mln/transform/influence_zone_geodesic.hh @@ -66,7 +66,7 @@ namespace mln trace::entering("transform::influence_zone_geodesic"); mln_precondition(exact(input).is_valid()); - // mln_precondition(exact(nbh).is_valid()); + mln_precondition(exact(nbh).is_valid()); internal::influence_zone_functor<I> f; (void) mln::canvas::distance_geodesic(input, nbh, max, f); diff --git a/milena/mln/win/sym.hh b/milena/mln/win/sym.hh index 208f75a..cc0a680 100644 --- a/milena/mln/win/sym.hh +++ b/milena/mln/win/sym.hh @@ -62,7 +62,7 @@ namespace mln W sym(const Window<W>& win) { trace::entering("win::sym"); - // mln_precondition(win.is_valid()); + mln_precondition(exact(win).is_valid()); W tmp = exact(win); tmp.sym(); trace::exiting("win::sym"); @@ -74,7 +74,7 @@ namespace mln W sym(const Weighted_Window<W>& w_win) { trace::entering("win::sym"); - // mln_precondition(win.is_valid()); + mln_precondition(exact(w_win).is_valid()); W tmp = exact(w_win); tmp.sym(); trace::exiting("win::sym"); -- 1.5.6.5
participants (1)
-
Guillaume Lazzara