Commit 7b475d5b authored by Roland Levillain's avatar Roland Levillain
Browse files

Merge branch 'next' into next-next

Conflicts:
	ChangeLog
	milena/ChangeLog
parents 6342ded2 c4bb3f89
2011-05-12 Guillaume Lazzara <z@lrde.epita.fr>
* mln/io/dicom/load.hh: Fix invalid data while loading large
image.
2010-12-10 Roland Levillain <roland@lrde.epita.fr>
Ensure non implemented reconstructions on sets abort at run time.
* mln/morpho/reconstruction/by_dilation/union_find.hh,
* mln/morpho/reconstruction/by_erosion/union_find.hh
(union_find_dispatch(image::kind::logic, Image, Image, Neighborhood)):
Here.
* tests/morpho/reconstruction/by_dilation/union_find.cc,
* tests/morpho/reconstruction/by_erosion/union_find.cc:
Rename as...
* tests/morpho/reconstruction/by_dilation/union_find_on_functions.cc,
* tests/morpho/reconstruction/by_erosion/union_find_on_functions.cc:
...these.
* tests/morpho/reconstruction/by_dilation/union_find_on_sets.cc,
* tests/morpho/reconstruction/by_erosion/union_find_on_sets.cc:
New tests.
* tests/morpho/reconstruction/by_dilation/Makefile.am,
* tests/morpho/reconstruction/by_erosion/Makefile.am:
Adjust.
(check_PROGRAMS): Add union_find_on_sets.
(union_find_on_sets_SOURCES): New.
(XFAIL_TESTS): New. Add union_find_on_sets.
2011-05-20 Thierry GERAUD <thierry.geraud@lrde.epita.fr>
 
* img/lena.pgm: Replace by official version;
// 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.
//
......@@ -139,14 +140,21 @@ namespace mln
algebra::vec<mln_site_(I)::dim, unsigned int> vmin;
algebra::vec<mln_site_(I)::dim, unsigned int> vmax;
algebra::vec<mln_site_(I)::dim, unsigned int> vdims;
for (int i = 0; i < ndims; ++i)
int j = ndims - 1;
for (int i = 0; i < ndims; ++i, --j)
{
vmin[i] = 0;
vmax[i] = dims[i] - 1;
if (i == 0)
vdims[i] = 1;
vdims[j] = 1;
else
vdims[i] = dims[i - 1] * vdims[i - 1];
vdims[j] = dims[i - 1] * vdims[j + 1];
}
if (ndims > 1)
{
std::swap(vmin[0], vmin[1]);
std::swap(vmax[0], vmax[1]);
}
mln_site(I) pmin(vmin);
......@@ -155,25 +163,23 @@ namespace mln
initialize(ima, result);
mln_piter(I) p(ima.domain());
unsigned int index = 0;
for_all(p)
{
index = 0;
for (int i = 0; i < ndims; ++i)
{
index += p.to_site().to_vec()[i] * vdims[i];
index += p[i] * vdims[i];
}
ima(p) = (unsigned char) dataBuffer[(index * bytes_allocated) * samples_per_pixel];
mln_value(I) v = (unsigned char) dataBuffer[(index * bytes_allocated) * samples_per_pixel];
// FIXME: RGB support, HighBit if HB == 1
for (int j = 0; j < bytes_allocated; ++j)
for (unsigned int j = 0; j < bytes_allocated; ++j)
{
ima(p) += ((unsigned char) dataBuffer[(index * bytes_allocated + j) * samples_per_pixel]) * 256 * j;
v += ((unsigned char) dataBuffer[(index * bytes_allocated + j) * samples_per_pixel]) * 256 * j;
}
/*std::cout << "[ x = " << p.to_site().to_vec()[0]
<< " | y = " << p.to_site().to_vec()[1]
<< " | z = " << p.to_site().to_vec()[2]
<< " ] => " << ima(p)
<< std::endl;*/
ima(p) = v;
}
delete(dataBuffer);
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -26,7 +27,11 @@
#ifndef MLN_MORPHO_RECONSTRUCTION_BY_DILATION_UNION_FIND_HH
# define MLN_MORPHO_RECONSTRUCTION_BY_DILATION_UNION_FIND_HH
# include <cstdlib>
# include <iostream>
# include <vector>
# include <mln/core/concept/image.hh>
# include <mln/core/concept/neighborhood.hh>
# include <mln/data/fill.hh>
......@@ -221,6 +226,16 @@ namespace mln
const Neighborhood<N>& nbh)
{
// FIXME: Not yet implemented.
std::cerr
<< __FILE__ << ":" << __LINE__ << ": error:\n"
"mln::morpho::reconstruction::by_dilation::internal::\n"
" union_find_dispatch(mln::trait::image::kind::logic,\n"
" const mln::Image<I>&,\n"
" const mln::Image<J>&,\n"
" const mln::Neighborhood<N>&)\n"
"not implemented."
<< std::endl;
std::abort();
}
template <typename I, typename J, typename N>
......
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -26,7 +27,11 @@
#ifndef MLN_MORPHO_RECONSTRUCTION_BY_EROSION_UNION_FIND_HH
# define MLN_MORPHO_RECONSTRUCTION_BY_EROSION_UNION_FIND_HH
# include <cstdlib>
# include <iostream>
# include <vector>
# include <mln/core/concept/image.hh>
# include <mln/core/concept/neighborhood.hh>
# include <mln/data/fill.hh>
......@@ -219,6 +224,16 @@ namespace mln
const Neighborhood<N>& nbh)
{
// FIXME: Not yet implemented.
std::cerr
<< __FILE__ << ":" << __LINE__ << ": error:\n"
"mln::morpho::reconstruction::by_erosion::internal::\n"
" union_find_dispatch(mln::trait::image::kind::logic,\n"
" const mln::Image<I>&,\n"
" const mln::Image<J>&,\n"
" const mln::Neighborhood<N>&)\n"
"not implemented."
<< std::endl;
std::abort();
}
template <typename I, typename J, typename N>
......
# Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE).
# Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE).
#
# This file is part of Olena.
#
......@@ -16,12 +16,14 @@
include $(top_srcdir)/milena/tests/tests.mk
check_PROGRAMS = \
union_find
union_find_SOURCES = union_find.cc
union_find_on_functions \
union_find_on_sets
union_find_on_functions_SOURCES = union_find_on_functions.cc
union_find_on_sets_SOURCES = union_find_on_sets.cc
TESTS = $(check_PROGRAMS)
# Reconstruction by dilation on sets in not implemented yet.
XFAIL_TESTS = union_find_on_sets
......@@ -50,6 +50,7 @@ int main()
mln_assertion(out == lena);
}
// FIXME: Is this part really meaningful as-is?
{
initialize(lena_2, lena);
data::fill(lena_2, lena);
......
// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
// Olena is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, version 2 of the License.
//
// Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
//
// As a special exception, you may use this file as part of a free
// software project 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.
#include <mln/core/image/image2d.hh>
#include <mln/core/alias/neighb2d.hh>
#include <mln/pw/all.hh>
#include <mln/io/pbm/load.hh>
#include <mln/data/compare.hh>
#include <mln/morpho/reconstruction/by_dilation/union_find.hh>
#include "tests/data.hh"
int main()
{
using namespace mln;
using namespace morpho::reconstruction::by_dilation;
image2d<bool> lena, lena_2, out;
io::pbm::load(lena, MLN_IMG_DIR "/tiny.pbm");
{
out = union_find(lena, lena, c4());
mln_assertion(out == lena);
}
// FIXME: Is this part really meaningful as-is?
{
initialize(lena_2, lena);
data::fill(lena_2, lena);
out = union_find(lena_2, lena, c4());
}
}
# Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE).
# Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE).
#
# This file is part of Olena.
#
......@@ -16,12 +16,14 @@
include $(top_srcdir)/milena/tests/tests.mk
check_PROGRAMS = \
union_find
union_find_SOURCES = union_find.cc
union_find_on_functions \
union_find_on_sets
union_find_on_functions_SOURCES = union_find_on_functions.cc
union_find_on_sets_SOURCES = union_find_on_sets.cc
TESTS = $(check_PROGRAMS)
# Reconstruction by erosion on sets in not implemented yet.
XFAIL_TESTS = union_find_on_sets
......@@ -50,6 +50,7 @@ int main()
mln_assertion(out == lena);
}
// FIXME: Is this part really meaningful as-is?
{
initialize(lena_2, lena);
data::fill(lena_2, lena);
......
// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
// Olena is free software: you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation, version 2 of the License.
//
// Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
//
// As a special exception, you may use this file as part of a free
// software project 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.
#include <mln/core/image/image2d.hh>
#include <mln/core/alias/neighb2d.hh>
#include <mln/pw/all.hh>
#include <mln/io/pbm/load.hh>
#include <mln/data/compare.hh>
#include <mln/morpho/reconstruction/by_erosion/union_find.hh>
#include "tests/data.hh"
int main()
{
using namespace mln;
using namespace morpho::reconstruction::by_erosion;
image2d<bool> lena, lena_2, out;
io::pbm::load(lena, MLN_IMG_DIR "/tiny.pbm");
{
out = union_find(lena, lena, c4());
mln_assertion(out == lena);
}
// FIXME: Is this part really meaningful as-is?
{
initialize(lena_2, lena);
data::fill(lena_2, lena);
out = union_find(lena_2, lena, c4());
}
}
......@@ -4679,9 +4679,9 @@ v * tests/filter/objects_on_border.cc,
arguments.
* src/binarization/fg_sauvola_ms.cc,
* src/binarization/sauvola.cc,
* src/binarization/sauvola_ms.cc,
* src/binarization/sauvola_ms_split.cc,
* src/binarization/sauvola.cc,
* src/binarization/sauvola_ms.cc,
* src/binarization/sauvola_ms_split.cc,
* src/binarization/sauvola_debug.cc: New.
2010-03-29 Guillaume Lazzara <z@lrde.epita.fr>
......
Markdown is supported
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