Commit 192d87fa authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Small fixes.

	* headers.mk: update dist headers.

	* mln/canvas/morpho/all.hh: remove non existing included headers.

	* mln/morpho/tree/compute_attribute_image.hh,
	* mln/canvas/morpho/attribute_filter.hh: add missing include.

	* tests/core/image/plain.cc
	* mln/level/compare.hh,
	* mln/core/pixter2d.hh: add more preconditions.

	* mln/io/dicom/load.hh: update doc.

	* mln/morpho/essential.hh,
	* mln/morpho/all.hh,
	* mln/morpho/closing/algebraic.hh: revamp.

	* mln/morpho/closing/all.hh,
	* mln/morpho/closing/essential.hh,
	* mln/morpho/opening/all.hh,
	* mln/morpho/opening/essential.hh: new files.

	* tests/unit_test/unit-tests.mk: update test list.

git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@3453 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent a18ebc89
2009-03-02 Guillaume Lazzara <lazzara@lrde.epita.fr>
Small fixes.
* headers.mk: update dist headers.
* mln/canvas/morpho/all.hh: remove non existing included headers.
* mln/morpho/tree/compute_attribute_image.hh,
* mln/canvas/morpho/attribute_filter.hh: add missing include.
* tests/core/image/plain.cc
* mln/level/compare.hh,
* mln/core/pixter2d.hh: add more preconditions.
* mln/io/dicom/load.hh: update doc.
* mln/morpho/essential.hh,
* mln/morpho/all.hh,
* mln/morpho/closing/algebraic.hh: revamp.
* mln/morpho/closing/all.hh,
* mln/morpho/closing/essential.hh,
* mln/morpho/opening/all.hh,
* mln/morpho/opening/essential.hh: new files.
* tests/unit_test/unit-tests.mk: update test list.
2009-03-01 Edwin Carlinet <carlinet@lrde.epita.fr>
 
Make area_on_vertices work with new algebraic code [POST-RUSH].
......@@ -359,6 +359,7 @@ mln/value/int_s.hh \
mln/value/rgb8.hh \
mln/value/int_s32.hh \
mln/value/float01_.hh \
mln/value/int_u12.hh \
mln/value/rgb16.hh \
mln/value/int_u32.hh \
mln/value/gl8.hh \
......@@ -534,9 +535,7 @@ mln/canvas/all.hh \
mln/canvas/distance_front.hh \
mln/canvas/morpho/internal/find_root.hh \
mln/canvas/morpho/all.hh \
mln/canvas/morpho/connected_filter.hh \
mln/canvas/morpho/algebraic_filter.hh \
mln/canvas/morpho/algebraic_union_find.hh \
mln/canvas/morpho/attribute_filter.hh \
mln/canvas/morpho/essential.hh \
mln/canvas/essential.hh \
mln/metal/is_const.hh \
......@@ -623,29 +622,39 @@ mln/morpho/skeleton_constrained.hh \
mln/morpho/complementation.hh \
mln/morpho/line_gradient.hh \
mln/morpho/hit_or_miss.hh \
mln/morpho/closing_height.hh \
mln/morpho/plus.hh \
mln/morpho/general.hh \
mln/morpho/internal/elementary.hh \
mln/morpho/contrast.hh \
mln/morpho/opening_area.hh \
mln/morpho/opening_height.hh \
mln/morpho/thickening.hh \
mln/morpho/dilation.hh \
mln/morpho/closing/all.hh \
mln/morpho/closing/algebraic.hh \
mln/morpho/closing/leveling.hh \
mln/morpho/closing/area_on_vertices.hh \
mln/morpho/closing/area.hh \
mln/morpho/closing/volume.hh \
mln/morpho/closing/height.hh \
mln/morpho/closing/essential.hh \
mln/morpho/laplacian.hh \
mln/morpho/all.hh \
mln/morpho/opening_algebraic.hh \
mln/morpho/opening_attribute.hh \
mln/morpho/opening_volume.hh \
mln/morpho/closing_algebraic.hh \
mln/morpho/watershed/flooding.hh \
mln/morpho/watershed/all.hh \
mln/morpho/closing_area_on_vertices.hh \
mln/morpho/closing_volume.hh \
mln/morpho/opening/all.hh \
mln/morpho/opening/algebraic.hh \
mln/morpho/opening/leveling.hh \
mln/morpho/opening/area_on_vertices.hh \
mln/morpho/opening/area.hh \
mln/morpho/opening/volume.hh \
mln/morpho/opening/height.hh \
mln/morpho/opening/essential.hh \
mln/morpho/attribute/all.hh \
mln/morpho/attribute/volume.hh \
mln/morpho/attribute/sum.hh \
mln/morpho/attribute/height.hh \
mln/morpho/attribute/sharpness.hh \
mln/morpho/attribute/card.hh \
mln/morpho/attribute/count_adjacent_vertices.hh \
mln/morpho/minus.hh \
mln/morpho/gradient.hh \
mln/morpho/tree/max.hh \
......@@ -654,16 +663,16 @@ mln/morpho/tree/all.hh \
mln/morpho/tree/utils.hh \
mln/morpho/tree/data.hh \
mln/morpho/tree/compute_attribute_image.hh \
mln/morpho/opening_area_on_vertices.hh \
mln/morpho/general.spe.hh \
mln/morpho/min.hh \
mln/morpho/closing.hh \
mln/morpho/top_hat.hh \
mln/morpho/erosion.hh \
mln/morpho/leveling_filter.hh \
mln/morpho/closing_sum.hh \
mln/morpho/Rd.hh \
mln/morpho/closing_area.hh \
mln/morpho/thick_miss.hh \
mln/morpho/algebraic_filter.hh \
mln/morpho/closing_attribute.hh \
mln/morpho/rank_filter.hh \
mln/morpho/essential.hh \
......
......@@ -47,9 +47,7 @@ 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>
# include <mln/canvas/morpho/attribute_filter.hh>
#endif // ! MLN_CANVAS_MORPHO_ALL_HH
......@@ -38,6 +38,8 @@
# include <mln/core/concept/neighborhood.hh>
# include <mln/core/concept/accumulator.hh>
# include <mln/level/sort_offsets.hh>
# include <mln/trait/accumulators.hh>
# include <mln/util/pix.hh>
......
......@@ -136,6 +136,8 @@ namespace mln
row_offset_(image.bbox().ncols() + border_x2_)
{
mln_precondition(image.is_valid());
mln_precondition(image_.is_valid());
mln_precondition(image_.buffer() == image.buffer());
}
template <typename I>
......@@ -156,6 +158,7 @@ namespace mln
void
fwd_pixter2d<I>::start_()
{
mln_precondition(image_.is_valid());
eor_ = & opt::at(image_, geom::min_row(image_), geom::max_col(image_)) + 1;
}
......
// Copyright (C) 2009 EPITA Research and Development Laboratory
// 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
......@@ -28,13 +28,10 @@
#ifndef MLN_IO_DICOM_LOAD_HH
# define MLN_IO_DICOM_LOAD_HH
/*!
* \file mln/io/magick/load.hh
*
* \brief Define a function which loads an image of kind magick with
* given path.
*
*/
/// \file mln/io/magick/load.hh
///
/// \brief Define a function which loads an image of kind magick with
/// given path.
# include <mln/core/image/image2d.hh>
# include <mln/core/image/image3d.hh>
......@@ -57,12 +54,11 @@ namespace mln
namespace dicom
{
/*! Load a dicom image in a Milena image.
*
* \param[out] ima A reference to the image which will receive
* data.
* \param[in] filename The source.
*/
/// Load a dicom image in a Milena image.
///
/// \param[out] ima A reference to the image which will receive
/// data.
/// \param[in] filename The source.
template <typename I>
void load(Image<I>& ima,
const std::string& filename);
......
......@@ -90,6 +90,8 @@ namespace mln
const L& lhs = exact(lhs_);
const R& rhs = exact(rhs_);
mln_precondition(lhs.is_valid());
mln_precondition(rhs.is_valid());
mln_precondition(lhs.domain() == rhs.domain());
return test::predicate(lhs_, rhs_, F());
......
......@@ -57,7 +57,6 @@ namespace mln
# include <mln/morpho/closing.hh>
# include <mln/morpho/closing/all.hh>
# include <mln/morpho/complementation.hh>
# include <mln/morpho/contrast.hh>
# include <mln/morpho/dilation.hh>
......@@ -71,7 +70,6 @@ namespace mln
# include <mln/morpho/min.hh>
# include <mln/morpho/minus.hh>
# include <mln/morpho/opening.hh>
# include <mln/morpho/opening/all.hh>
# include <mln/morpho/plus.hh>
# include <mln/morpho/Rd.hh>
# include <mln/morpho/rank_filter.hh>
......@@ -85,7 +83,9 @@ namespace mln
// Sub-directories.
# include <mln/morpho/attribute/all.hh>
# include <mln/morpho/closing/all.hh>
# include <mln/morpho/elementary/all.hh>
# include <mln/morpho/opening/all.hh>
# include <mln/morpho/tree/all.hh>
# include <mln/morpho/watershed/all.hh>
......
......@@ -37,15 +37,20 @@
# include <mln/morpho/algebraic_filter.hh>
namespace mln {
namespace morpho {
namespace closing {
namespace mln
{
/// Morphological algebraic closing.
template <typename I, typename N, typename A>
mln_concrete(I)
algebraic(const Image<I>& input, const Neighborhood<N>& nbh,
const Accumulator<A>& accu, const mln_result(A)& lambda);
namespace morpho
{
namespace closing
{
/// Morphological algebraic closing.
template <typename I, typename N, typename A>
mln_concrete(I)
algebraic(const Image<I>& input, const Neighborhood<N>& nbh,
const Accumulator<A>& accu, const mln_result(A)& lambda);
......@@ -53,33 +58,35 @@ namespace mln {
# ifndef MLN_INCLUDE_ONLY
template <typename I, typename N, typename A>
inline
mln_concrete(I)
algebraic(const Image<I>& input, const Neighborhood<N>& nbh,
const Accumulator<A>& accu, const mln_result(A)& lambda)
{
trace::entering("morpho::closing::algebraic");
template <typename I, typename N, typename A>
inline
mln_concrete(I)
algebraic(const Image<I>& input, const Neighborhood<N>& nbh,
const Accumulator<A>& accu, const mln_result(A)& lambda)
{
trace::entering("morpho::closing::algebraic");
mln_precondition(exact(input).is_valid());
mln_precondition(mlc_not_equal(mln_trait_accumulator_when_pix(A),
trait::accumulator::when_pix::not_ok)::value);
mln_precondition(exact(input).is_valid());
mln_precondition(mlc_not_equal(mln_trait_accumulator_when_pix(A),
trait::accumulator::when_pix::not_ok)::value);
mln_concrete(I) output;
output = algebraic_filter(input, nbh, accu, lambda,
/* increasing = */ true);
mln_concrete(I) output;
output = algebraic_filter(input, nbh, accu, lambda,
/* increasing = */ true);
mln_postcondition(output >= input);
mln_postcondition(output >= input);
trace::exiting("morpho::closing::algebraic");
return output;
}
trace::exiting("morpho::closing::algebraic");
return output;
}
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::morpho::closing
} // end of namespace mln::morpho
} // end of namespace mln
......
// 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_MORPHO_CLOSING_ALL_HH
# define MLN_MORPHO_CLOSING_ALL_HH
/// \file mln/morpho/closing/all.hh
///
/// File that includes all closing attributes.
#include <mln/morpho/closing/algebraic.hh>
#include <mln/morpho/closing/leveling.hh>
#include <mln/morpho/closing/area_on_vertices.hh>
#include <mln/morpho/closing/area.hh>
#include <mln/morpho/closing/volume.hh>
#include <mln/morpho/closing/height.hh>
#endif // ! MLN_MORPHO_CLOSING_ALL_HH
// 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_MORPHO_CLOSING_ESSENTIAL_HH
# define MLN_MORPHO_CLOSING_ESSENTIAL_HH
/// \file mln/morpho/closing/all.hh
///
/// File that includes essential closing attributes.
#include <mln/morpho/closing/algebraic.hh>
#include <mln/morpho/closing/leveling.hh>
#include <mln/morpho/closing/area.hh>
#include <mln/morpho/closing/volume.hh>
#include <mln/morpho/closing/height.hh>
#endif // ! MLN_MORPHO_CLOSING_ESSENTIAL_HH
......@@ -41,12 +41,12 @@
# include <mln/morpho/includes.hh>
# include <mln/morpho/laplacian.hh>
# include <mln/morpho/meyer_wst.hh>
# include <mln/morpho/opening/area.hh>
# include <mln/morpho/opening/attribute.hh>
# include <mln/morpho/opening.hh>
# include <mln/morpho/rank_filter.hh>
# include <mln/morpho/top_hat.hh>
# include <mln/morpho/opening/essential.hh>
# include <mln/morpho/closing/essential.hh>
# include <mln/morpho/elementary/essential.hh>
......
// 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_MORPHO_OPENING_ALL_HH
# define MLN_MORPHO_OPENING_ALL_HH
/// \file mln/morpho/opening/all.hh
///
/// File that includes all opening attributes.
#include <mln/morpho/opening/algebraic.hh>
#include <mln/morpho/opening/leveling.hh>
#include <mln/morpho/opening/area_on_vertices.hh>
#include <mln/morpho/opening/area.hh>
#include <mln/morpho/opening/volume.hh>
#include <mln/morpho/opening/height.hh>
#endif // ! MLN_MORPHO_OPENING_ALL_HH
// 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_MORPHO_OPENING_ESSENTIAL_HH
# define MLN_MORPHO_OPENING_ESSENTIAL_HH
/// \file mln/morpho/opening/all.hh
///
/// File that includes essential opening attributes.
#include <mln/morpho/opening/algebraic.hh>
#include <mln/morpho/opening/leveling.hh>
#include <mln/morpho/opening/area.hh>
#include <mln/morpho/opening/volume.hh>
#include <mln/morpho/opening/height.hh>
#endif // ! MLN_MORPHO_OPENING_ESSENTIAL_HH
// 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
......@@ -35,6 +36,7 @@
/// \todo Specialize for low quant (and try fastest).
# include <mln/core/concept/image.hh>
# include <mln/trait/accumulators.hh>
# include <mln/util/pix.hh>
# include <mln/data/fill.hh>
......@@ -67,7 +69,7 @@ namespace mln
template <typename A, typename T>
mln_ch_value(typename T::function, mln_result(A))
compute_attribute_image(const Accumulator<A>& a, const T& t);
compute_attribute_image(const Accumulator<A>& a, const T& t);
......@@ -118,7 +120,7 @@ namespace mln
template <typename A, typename T>
inline
mln_ch_value(typename T::function, mln_result(A))
compute_attribute_image(const Accumulator<A>& a_, const T& t)
compute_attribute_image(const Accumulator<A>& a_, const T& t)
{
trace::entering("morpho::tree::compute_attribute_image");
......
......@@ -62,6 +62,8 @@ int main()
ima(point2d(0,0)) = 124;
mln_assertion(exact(ima).is_valid());
mln_assertion(exact(lena).is_valid());
mln_assertion(ima != lena);
ima2 = lena;
......
......@@ -354,6 +354,7 @@ mln_value_int_s \
mln_value_rgb8 \
mln_value_int_s32 \
mln_value_float01_ \
mln_value_int_u12 \
mln_value_rgb16 \
mln_value_int_u32 \
mln_value_gl8 \
......@@ -527,9 +528,7 @@ mln_canvas_all \
mln_canvas_distance_front \
mln_canvas_morpho_internal_find_root \
mln_canvas_morpho_all \
mln_canvas_morpho_connected_filter \
mln_canvas_morpho_algebraic_filter \
mln_canvas_morpho_algebraic_union_find \
mln_canvas_morpho_attribute_filter \
mln_canvas_morpho_essential \
mln_canvas_essential \
mln_metal_is_const \
......@@ -616,29 +615,39 @@ mln_morpho_skeleton_constrained \
mln_morpho_complementation \
mln_morpho_line_gradient \
mln_morpho_hit_or_miss \
mln_morpho_closing_height \
mln_morpho_plus \
mln_morpho_general \
mln_morpho_internal_elementary \
mln_morpho_contrast \
mln_morpho_opening_area \
mln_morpho_opening_height \
mln_morpho_thickening \
mln_morpho_dilation \
mln_morpho_closing_all \
mln_morpho_closing_algebraic \
mln_morpho_closing_leveling \
mln_morpho_closing_area_on_vertices \
mln_morpho_closing_area \
mln_morpho_closing_volume \
mln_morpho_closing_height \
mln_morpho_closing_essential \
mln_morpho_laplacian \
mln_morpho_all \
mln_morpho_opening_algebraic \
mln_morpho_opening_attribute \
mln_morpho_opening_volume \
mln_morpho_closing_algebraic \
mln_morpho_watershed_flooding \
mln_morpho_watershed_all \
mln_morpho_closing_area_on_vertices \
mln_morpho_closing_volume \
mln_morpho_opening_all \
mln_morpho_opening_algebraic \
mln_morpho_opening_leveling \
mln_morpho_opening_area_on_vertices \
mln_morpho_opening_area \
mln_morpho_opening_volume \
mln_morpho_opening_height \
mln_morpho_opening_essential \
mln_morpho_attribute_all \
mln_morpho_attribute_volume \
mln_morpho_attribute_sum \
mln_morpho_attribute_height \
mln_morpho_attribute_sharpness \
mln_morpho_attribute_card \
mln_morpho_attribute_count_adjacent_vertices \
mln_morpho_minus \
mln_morpho_gradient \
mln_morpho_tree_max \
......@@ -647,15 +656,15 @@ mln_morpho_tree_all \
mln_morpho_tree_utils \
mln_morpho_tree_data \
mln_morpho_tree_compute_attribute_image \
mln_morpho_opening_area_on_vertices \
mln_morpho_min \
mln_morpho_closing \
mln_morpho_top_hat \
mln_morpho_erosion \
mln_morpho_leveling_filter \
mln_morpho_closing_sum \
mln_morpho_Rd \
mln_morpho_closing_area \
mln_morpho_thick_miss \